diff --git a/patches/net/minecraft/server/management/ItemInWorldManager.java.patch b/patches/net/minecraft/server/management/ItemInWorldManager.java.patch index f51f6ce9..126ae429 100644 --- a/patches/net/minecraft/server/management/ItemInWorldManager.java.patch +++ b/patches/net/minecraft/server/management/ItemInWorldManager.java.patch @@ -44,19 +44,18 @@ public class ItemInWorldManager { /** Forge reach distance */ -@@ -135,15 +155,29 @@ +@@ -135,15 +155,28 @@ public void onBlockClicked(int p_73074_1_, int p_73074_2_, int p_73074_3_, int p_73074_4_) { + // CraftBukkit start -+ //org.bukkit.event.player.PlayerInteractEvent cbEvent = CraftEventFactory.callPlayerInteractEvent(this.thisPlayerMP, Action.LEFT_CLICK_BLOCK, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_, this.thisPlayerMP.inventory.getCurrentItem()); -+ if (!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(p_73074_1_, p_73074_2_, p_73074_3_)) { - PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(thisPlayerMP, Action.LEFT_CLICK_BLOCK, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_, theWorld); - if (event.isCanceled()) ++ org.bukkit.event.player.PlayerInteractEvent cbEvent = CraftEventFactory.callPlayerInteractEvent(this.thisPlayerMP, Action.LEFT_CLICK_BLOCK, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_, this.thisPlayerMP.inventory.getCurrentItem()); + net.minecraftforge.event.entity.player.PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(this.thisPlayerMP, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_, theWorld); // Forge -+ org.bukkit.event.player.PlayerInteractEvent cbEvent = event.cb; ++ //org.bukkit.event.player.PlayerInteractEvent cbEvent = event.cb; + if (event.isCanceled()) { - thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, theWorld)); @@ -77,7 +76,7 @@ if (this.isCreative()) { if (!this.theWorld.extinguishFire((EntityPlayer)null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_)) -@@ -157,30 +191,56 @@ +@@ -157,30 +190,56 @@ float f = 1.0F; Block block = this.theWorld.getBlock(p_73074_1_, p_73074_2_, p_73074_3_); @@ -146,7 +145,7 @@ if (!block.isAir(theWorld, p_73074_1_, p_73074_2_, p_73074_3_) && f >= 1.0F) { this.tryHarvestBlock(p_73074_1_, p_73074_2_, p_73074_3_); -@@ -197,6 +257,10 @@ +@@ -197,6 +256,10 @@ } } } @@ -157,7 +156,7 @@ } public void uncheckedTryHarvestBlock(int p_73082_1_, int p_73082_2_, int p_73082_3_) -@@ -269,6 +333,12 @@ +@@ -269,6 +332,12 @@ return false; } Block block = this.theWorld.getBlock(p_73084_1_, p_73084_2_, p_73084_3_); @@ -170,7 +169,7 @@ int l = this.theWorld.getBlockMetadata(p_73084_1_, p_73084_2_, p_73084_3_); this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, p_73084_1_, p_73084_2_, p_73084_3_, Block.getIdFromBlock(block) + (this.theWorld.getBlockMetadata(p_73084_1_, p_73084_2_, p_73084_3_) << 12)); boolean flag = false; -@@ -312,6 +382,7 @@ +@@ -312,6 +381,7 @@ public boolean tryUseItem(EntityPlayer p_73085_1_, World p_73085_2_, ItemStack p_73085_3_) { int i = p_73085_3_.stackSize; @@ -178,7 +177,7 @@ int j = p_73085_3_.getItemDamage(); ItemStack itemstack1 = p_73085_3_.useItemRightClick(p_73085_2_, p_73085_1_); -@@ -350,57 +421,106 @@ +@@ -350,57 +420,106 @@ public boolean activateBlockOrUseItem(EntityPlayer p_73078_1_, World p_73078_2_, ItemStack p_73078_3_, int p_73078_4_, int p_73078_5_, int p_73078_6_, int p_73078_7_, float p_73078_8_, float p_73078_9_, float p_73078_10_) {