Fix interaction issues

This commit is contained in:
Thinkofdeath
2014-11-28 23:06:03 +00:00
parent 443e45e276
commit e795876491
3 changed files with 49 additions and 113 deletions

View File

@@ -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