mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-26 01:32:02 -07:00
Add permission for command blocks
This commit is contained in:
@@ -110,9 +110,9 @@
|
||||
+ this.player.connection.send(tileentity.getUpdatePacket());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
return;
|
||||
}
|
||||
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, pos, direction, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND);
|
||||
+ if (event.isCancelled()) {
|
||||
@@ -123,10 +123,10 @@
|
||||
+ if (tileentity != null) {
|
||||
+ this.player.connection.send(tileentity.getUpdatePacket());
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
if (this.isCreative()) {
|
||||
this.destroyAndAck(pos, sequence, "creative destroy");
|
||||
return;
|
||||
@@ -214,7 +214,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -242,10 +341,65 @@
|
||||
@@ -242,19 +341,78 @@
|
||||
|
||||
public boolean destroyBlock(BlockPos pos) {
|
||||
BlockState iblockdata = this.level.getBlockState(pos);
|
||||
@@ -281,7 +281,10 @@
|
||||
BlockEntity tileentity = this.level.getBlockEntity(pos);
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
@@ -255,6 +409,10 @@
|
||||
- if (block instanceof GameMasterBlock && !this.player.canUseGameMasterBlocks()) {
|
||||
+ if (block instanceof GameMasterBlock && !this.player.canUseGameMasterBlocks() && !(block instanceof net.minecraft.world.level.block.CommandBlock && (this.player.isCreative() && this.player.getBukkitEntity().hasPermission("minecraft.commandblock")))) { // Paper - command block permission
|
||||
this.level.sendBlockUpdated(pos, iblockdata, iblockdata, 3);
|
||||
return false;
|
||||
} else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) {
|
||||
return false;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user