Check the value returned from useItemInHand() so plugins can properly cancel it - SPIGOT-764

This commit is contained in:
DemonWav 2015-05-22 22:52:05 -05:00
parent 529e4cd74a
commit 961287a4cc

View File

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/PlayerInteractManager.java 2015-02-26 22:40:23.011608135 +0000
+++ src/main/java/net/minecraft/server/PlayerInteractManager.java 2015-02-26 22:40:23.011608135 +0000
--- ../work/decompile-b7d1577c//net/minecraft/server/PlayerInteractManager.java 2015-05-23 09:43:31.941237938 -0500
+++ src/main/java/net/minecraft/server/PlayerInteractManager.java 2015-05-23 09:43:31.949238036 -0500
@@ -1,5 +1,13 @@
package net.minecraft.server;
@ -269,7 +269,7 @@
+ result = blockdata.getBlock().interact(world, blockposition, blockdata, entityhuman, enumdirection, f, f1, f2);
+ }
+
+ if (itemstack != null && !result) {
+ if (itemstack != null && !result && !interactResult) { // add !interactResult SPIGOT-764
+ int j1 = itemstack.getData();
+ int k1 = itemstack.count;
+