Add permission for command blocks
This commit is contained in:
@@ -26,3 +26,12 @@
|
||||
if (powered != flag1) {
|
||||
blockEntity.setPowered(powered);
|
||||
if (powered) {
|
||||
@@ -141,7 +152,7 @@
|
||||
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
|
||||
BlockEntity tileentity = world.getBlockEntity(pos);
|
||||
|
||||
- if (tileentity instanceof CommandBlockEntity && player.canUseGameMasterBlocks()) {
|
||||
+ if (tileentity instanceof CommandBlockEntity && (player.canUseGameMasterBlocks() || (player.isCreative() && player.getBukkitEntity().hasPermission("minecraft.commandblock")))) { // Paper - command block permission
|
||||
player.openCommandBlock((CommandBlockEntity) tileentity);
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user