testserver/CraftBukkit-Patches/0040-Update-Inventory-and-H...

25 lines
1.1 KiB
Diff
Raw Normal View History

2015-05-25 12:05:40 +00:00
From b4a7cd5471a376e966c3219af2ca080129a620e4 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 14 Sep 2013 10:16:38 +1000
Subject: [PATCH] Update Inventory and Health for PlayerConsumeItemEvent
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
2015-05-09 20:23:26 +00:00
index 32dd2e1..51f196a 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -300,6 +300,10 @@ public abstract class EntityHuman extends EntityLiving {
// Update client
if (this instanceof EntityPlayer) {
2014-11-28 01:17:45 +00:00
((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.getSlot((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.g));
+ // Spigot Start
+ ((EntityPlayer) this).getBukkitEntity().updateInventory();
+ ((EntityPlayer) this).getBukkitEntity().updateScaledHealth();
+ // Spigot End
}
return;
}
--
2015-05-09 20:23:26 +00:00
2.1.4