mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-02 21:22:05 -07:00
Feat: Add 'with' methods to CommandSourceStack (#11868)
This commit is contained in:
@@ -18,6 +18,37 @@
|
||||
|
||||
public CommandSourceStack(
|
||||
CommandSource source,
|
||||
@@ -187,6 +_,30 @@
|
||||
this.chatMessageChainer
|
||||
);
|
||||
}
|
||||
+
|
||||
+ // Paper start - Expose 'with' functions from the CommandSourceStack
|
||||
+ @Override
|
||||
+ public CommandSourceStack withLocation(org.bukkit.Location location) {
|
||||
+ return this.getLocation().equals(location)
|
||||
+ ? this
|
||||
+ : new CommandSourceStack(
|
||||
+ this.source,
|
||||
+ new Vec3(location.x(), location.y(), location.z()),
|
||||
+ new Vec2(location.getPitch(), location.getYaw()),
|
||||
+ ((org.bukkit.craftbukkit.CraftWorld) location.getWorld()).getHandle(),
|
||||
+ this.permissionLevel,
|
||||
+ this.textName,
|
||||
+ this.displayName,
|
||||
+ this.server,
|
||||
+ this.entity,
|
||||
+ this.silent,
|
||||
+ this.resultCallback,
|
||||
+ this.anchor,
|
||||
+ this.signingContext,
|
||||
+ this.chatMessageChainer
|
||||
+ );
|
||||
+ }
|
||||
+ // Paper end - Expose 'with' functions from the CommandSourceStack
|
||||
|
||||
public CommandSourceStack withRotation(Vec2 rotation) {
|
||||
return this.rotation.equals(rotation)
|
||||
@@ -391,9 +_,44 @@
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user