summaryrefslogtreecommitdiffstats
path: root/nms-patches/PlayerInteractManager.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-28 23:06:03 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-11-28 23:07:00 +0000
commite79587649124b0c04257a7548cda6b194bb3cf7a (patch)
tree9cc74fd217a796e147177a09f99cc457ef6e5913 /nms-patches/PlayerInteractManager.patch
parent443e45e276f4d9fef9f80d4a157db2294fc39456 (diff)
downloadcraftbukkit-e79587649124b0c04257a7548cda6b194bb3cf7a.tar
craftbukkit-e79587649124b0c04257a7548cda6b194bb3cf7a.tar.gz
craftbukkit-e79587649124b0c04257a7548cda6b194bb3cf7a.tar.lz
craftbukkit-e79587649124b0c04257a7548cda6b194bb3cf7a.tar.xz
craftbukkit-e79587649124b0c04257a7548cda6b194bb3cf7a.zip
Fix interaction issues
Diffstat (limited to 'nms-patches/PlayerInteractManager.patch')
-rw-r--r--nms-patches/PlayerInteractManager.patch26
1 files changed, 8 insertions, 18 deletions
diff --git a/nms-patches/PlayerInteractManager.patch b/nms-patches/PlayerInteractManager.patch
index 246be7a0..e1a0777f 100644
--- a/nms-patches/PlayerInteractManager.patch
+++ b/nms-patches/PlayerInteractManager.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/PlayerInteractManager.java 2014-11-28 17:43:43.329707430 +0000
-+++ src/main/java/net/minecraft/server/PlayerInteractManager.java 2014-11-28 17:38:18.000000000 +0000
+--- ../work/decompile-8eb82bde//net/minecraft/server/PlayerInteractManager.java 2014-11-28 23:05:41.725278672 +0000
++++ src/main/java/net/minecraft/server/PlayerInteractManager.java 2014-11-28 22:57:12.389289000 +0000
@@ -1,5 +1,13 @@
package net.minecraft.server;
@@ -43,7 +43,7 @@
if (this.isCreative()) {
if (!this.world.douseFire((EntityHuman) null, blockposition, enumdirection)) {
this.breakBlock(blockposition);
-@@ -121,15 +142,49 @@
+@@ -121,14 +142,48 @@
}
}
@@ -85,16 +85,15 @@
+ // Let the client know the block still exists
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
+ return;
- }
-
++ }
++
+ if (blockEvent.getInstaBreak()) {
+ f = 2.0f;
-+ }
+ }
+ // CraftBukkit end
-+
+
if (block.getMaterial() != Material.AIR && f >= 1.0F) {
this.breakBlock(blockposition);
- } else {
@@ -146,6 +201,7 @@
public void a(BlockPosition blockposition) {
@@ -211,7 +210,7 @@
if (this.gamemode == EnumGamemode.SPECTATOR) {
TileEntity tileentity = world.getTileEntity(blockposition);
-@@ -312,6 +439,75 @@
+@@ -312,6 +439,66 @@
return itemstack.placeItem(entityhuman, world, blockposition, enumdirection, f, f1, f2);
}
}
@@ -272,15 +271,6 @@
+ itemstack.count = k1;
+ }
+ }
-+
-+ // If we have 'true' and no explicit deny *or* an explicit allow -- run the item part of the hook
-+ if (itemstack != null && ((!result && event.useItemInHand() != Event.Result.DENY) || event.useItemInHand() == Event.Result.ALLOW)) {
-+ if (itemstack.getItem() instanceof ItemBucket || itemstack.getItem() instanceof ItemFood) {
-+ this.useItem(entityhuman, world, itemstack);
-+ } else {
-+ itemstack.placeItem(entityhuman, world, blockposition, enumdirection, f, f1, f2);
-+ }
-+ }
+ }
+ return result;
+ // CraftBukkit end