summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-12-21 19:04:01 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-12-21 19:04:01 +0000
commitdbdf6cacbf42e7cd87cc4fb068e3086ac9462942 (patch)
tree585012090627f003336e162649b04d1295ab0a07 /nms-patches
parent53fc3cf74f0c336f6a718b4c33e53a605887dd8a (diff)
downloadcraftbukkit-dbdf6cacbf42e7cd87cc4fb068e3086ac9462942.tar
craftbukkit-dbdf6cacbf42e7cd87cc4fb068e3086ac9462942.tar.gz
craftbukkit-dbdf6cacbf42e7cd87cc4fb068e3086ac9462942.tar.lz
craftbukkit-dbdf6cacbf42e7cd87cc4fb068e3086ac9462942.tar.xz
craftbukkit-dbdf6cacbf42e7cd87cc4fb068e3086ac9462942.zip
Only allow command blocks to be placed by op'd players
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/PlayerInteractManager.patch12
1 files changed, 8 insertions, 4 deletions
diff --git a/nms-patches/PlayerInteractManager.patch b/nms-patches/PlayerInteractManager.patch
index f5662ce3..8debad8d 100644
--- a/nms-patches/PlayerInteractManager.patch
+++ b/nms-patches/PlayerInteractManager.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/PlayerInteractManager.java 2014-12-09 12:19:57.555618161 +0000
-+++ src/main/java/net/minecraft/server/PlayerInteractManager.java 2014-12-09 12:16:26.307622849 +0000
+--- ../work/decompile-8eb82bde/net/minecraft/server/PlayerInteractManager.java 2014-12-21 19:03:39.124516788 +0000
++++ src/main/java/net/minecraft/server/PlayerInteractManager.java 2014-12-21 19:03:39.128516787 +0000
@@ -1,5 +1,13 @@
package net.minecraft.server;
@@ -216,7 +216,7 @@
if (this.gamemode == EnumGamemode.SPECTATOR) {
TileEntity tileentity = world.getTileEntity(blockposition);
-@@ -312,6 +444,68 @@
+@@ -312,6 +444,72 @@
return itemstack.placeItem(entityhuman, world, blockposition, enumdirection, f, f1, f2);
}
}
@@ -229,7 +229,11 @@
+ if (this.gamemode == EnumGamemode.SPECTATOR) {
+ TileEntity tileentity = world.getTileEntity(blockposition);
+ cancelledBlock = !(tileentity instanceof ITileInventory || tileentity instanceof IInventory);
-+ }
++ }
++
++ if (!entityhuman.getBukkitEntity().isOp() && itemstack != null && Block.asBlock(itemstack.getItem()) instanceof BlockCommand) {
++ cancelledBlock = true;
++ }
+
+ PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(entityhuman, Action.RIGHT_CLICK_BLOCK, blockposition, enumdirection, itemstack, cancelledBlock);
+ firedInteract = true;