Fix broken hopper logic when moving more than one item in a stack

This commit is contained in:
Thinkofdeath 2014-04-24 20:07:39 +01:00
parent 74c275f71c
commit 3139af91dc

View File

@ -1,4 +1,4 @@
From 4abf7241f8d31fc5a9aa42f461c996f435f7c171 Mon Sep 17 00:00:00 2001
From 0467adc477c07485d63c96122b135c5b4ab5602b Mon Sep 17 00:00:00 2001
From: erocs <github@erocs.org>
Date: Sun, 8 Sep 2013 12:06:15 -0700
Subject: [PATCH] Hopper Customisations
@ -6,7 +6,7 @@ Subject: [PATCH] Hopper Customisations
Allows editing hopper cooldowns and amount transferred per tick.
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index 48a882a..e661462 100644
index 48a882a..ba015aa 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -189,12 +189,18 @@ public class TileEntityHopper extends TileEntity implements IHopper {
@ -47,6 +47,15 @@ index 48a882a..e661462 100644
return false;
}
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), i);
@@ -275,7 +281,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
return true;
}
- this.setItem(j, itemstack);
+ this.setItem(j, itemstack1); // Spigot
}
}
@@ -379,7 +385,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (itemstack != null && canTakeItemFromInventory(iinventory, itemstack, i, j)) {
ItemStack itemstack1 = itemstack.cloneItemStack();
@ -68,6 +77,15 @@ index 48a882a..e661462 100644
}
return false;
@@ -416,7 +422,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
return true;
}
- iinventory.setItem(i, itemstack1);
+ iinventory.setItem(i, itemstack2); // Spigot
}
return false;
@@ -502,7 +508,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (flag) {