2014-03-26 20:34:47 +00:00
|
|
|
From c802b1ee3ad985d70fe4036ef7d83fc705611159 Mon Sep 17 00:00:00 2001
|
2014-01-08 03:45:45 +00:00
|
|
|
From: bloodshot <jdroque@gmail.com>
|
|
|
|
Date: Mon, 6 Jan 2014 18:02:01 -0500
|
|
|
|
Subject: [PATCH] Update Client's Hand when BlockPlaceEvent Cancelled
|
|
|
|
|
|
|
|
Send a Packet103SetSlot to client when a BlockPlaceEvent is cancelled.
|
|
|
|
|
|
|
|
Fixes BUKKIT-5284
|
|
|
|
|
|
|
|
Currently, whenever a player places a block in a protected area the
|
|
|
|
equipped itemstack size on client is never updated properly since the
|
|
|
|
client thinks the block was placed. The reason this happens is because
|
|
|
|
ItemStack.matches returns true since the server does not decrement stack
|
|
|
|
size if a BlockPlaceEvent is cancelled. This causes
|
|
|
|
PlayerConnection.a(handlePlace) not to send the appropriate packet to
|
|
|
|
client which causes the bug.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2014-03-26 20:34:47 +00:00
|
|
|
index 248d48e..28bf9d4 100644
|
2014-01-08 03:45:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2014-02-24 07:04:12 +00:00
|
|
|
@@ -638,7 +638,9 @@ public class PlayerConnection implements PacketPlayInListener {
|
2014-01-08 03:45:45 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j());
|
|
|
|
+ if (!this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j())) {
|
|
|
|
+ always = true; // force Packet103SetSlot to be sent to client to update ItemStack count
|
|
|
|
+ }
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
--
|
2014-03-26 20:34:47 +00:00
|
|
|
1.8.5.2.msysgit.0
|
2014-01-08 03:45:45 +00:00
|
|
|
|