Fix cmd permission levels for command blocks

This commit is contained in:
Jake Potrebic
2022-01-24 15:32:02 -08:00
parent 4bb84c46ac
commit b0579722db
4 changed files with 60 additions and 35 deletions

View File

@@ -15,3 +15,12 @@
public void setCommand(String command) {
super.setCommand(command);
CommandBlockEntity.this.setChanged();
@@ -51,7 +58,7 @@
public CommandSourceStack createCommandSourceStack() {
Direction enumdirection = (Direction) CommandBlockEntity.this.getBlockState().getValue(CommandBlock.FACING);
- return new CommandSourceStack(this, Vec3.atCenterOf(CommandBlockEntity.this.worldPosition), new Vec2(0.0F, enumdirection.toYRot()), this.getLevel(), 2, this.getName().getString(), this.getName(), this.getLevel().getServer(), (Entity) null);
+ return new CommandSourceStack(this, Vec3.atCenterOf(CommandBlockEntity.this.worldPosition), new Vec2(0.0F, enumdirection.toYRot()), this.getLevel(), this.getLevel().paperConfig().commandBlocks.permissionsLevel, this.getName().getString(), this.getName(), this.getLevel().getServer(), (Entity) null); // Paper - configurable command block perm level
}
@Override