summaryrefslogtreecommitdiffstats
path: root/nms-patches/TileEntityHopper.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/TileEntityHopper.patch')
-rw-r--r--nms-patches/TileEntityHopper.patch28
1 files changed, 14 insertions, 14 deletions
diff --git a/nms-patches/TileEntityHopper.patch b/nms-patches/TileEntityHopper.patch
index a1367334..043e2bd9 100644
--- a/nms-patches/TileEntityHopper.patch
+++ b/nms-patches/TileEntityHopper.patch
@@ -1,7 +1,7 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/TileEntityHopper.java 2014-11-28 17:43:43.401707428 +0000
-+++ src/main/java/net/minecraft/server/TileEntityHopper.java 2014-11-28 17:38:19.000000000 +0000
-@@ -2,11 +2,45 @@
-
+--- /home/matt/mc-dev-private//net/minecraft/server/TileEntityHopper.java 2015-02-26 22:40:23.147608133 +0000
++++ src/main/java/net/minecraft/server/TileEntityHopper.java 2015-02-26 22:40:23.151608133 +0000
+@@ -3,12 +3,46 @@
+ import java.util.Iterator;
import java.util.List;
+// CraftBukkit start
@@ -18,7 +18,7 @@
private ItemStack[] items = new ItemStack[5];
private String f;
private int g = -1;
-+
+
+ // CraftBukkit start - add fields and methods
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
+ private int maxStack = MAX_STACK;
@@ -42,11 +42,12 @@
+ public void setMaxStackSize(int size) {
+ maxStack = size;
+ }
-+ // CraftBukkit end
-
++ // CraftBukkit end
++
public TileEntityHopper() {}
-@@ -119,7 +153,7 @@
+ public void a(NBTTagCompound nbttagcompound) {
+@@ -120,7 +154,7 @@
}
public int getMaxStackSize() {
@@ -55,13 +56,13 @@
}
public boolean a(EntityHuman entityhuman) {
-@@ -215,10 +249,35 @@
+@@ -216,10 +250,35 @@
for (int i = 0; i < this.getSize(); ++i) {
if (this.getItem(i) != null) {
ItemStack itemstack = this.getItem(i).cloneItemStack();
- ItemStack itemstack1 = addItem(iinventory, this.splitStack(i, 1), enumdirection);
+ // ItemStack itemstack1 = addItem(iinventory, this.splitStack(i, 1), enumdirection);
-+
++
+ // CraftBukkit start - Call event when pushing items into other inventories
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(this.splitStack(i, 1));
+
@@ -93,7 +94,7 @@
return true;
}
-@@ -325,10 +384,41 @@
+@@ -330,10 +389,41 @@
if (itemstack != null && b(iinventory, itemstack, i, enumdirection)) {
ItemStack itemstack1 = itemstack.cloneItemStack();
@@ -119,7 +120,7 @@
+ if (ihopper instanceof TileEntityHopper) {
+ ((TileEntityHopper) ihopper).d(8); // Delay hopper checks
+ } else if (ihopper instanceof EntityMinecartHopper) {
-+ ((EntityMinecartHopper) ihopper).l(4); // Delay hopper minecart checks
++ ((EntityMinecartHopper) ihopper).m(4); // Delay hopper minecart checks
+ }
+
+ return false;
@@ -137,7 +138,7 @@
return true;
}
-@@ -344,6 +434,14 @@
+@@ -349,6 +439,13 @@
if (entityitem == null) {
return false;
} else {
@@ -148,7 +149,6 @@
+ return false;
+ }
+ // CraftBukkit end
-+
ItemStack itemstack = entityitem.getItemStack().cloneItemStack();
ItemStack itemstack1 = addItem(iinventory, itemstack, (EnumDirection) null);