2015-11-12 16:27:14 +00:00
|
|
|
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java
|
|
|
|
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java
|
2016-06-23 06:39:36 +00:00
|
|
|
@@ -251,6 +251,7 @@
|
2016-01-17 16:41:34 +00:00
|
|
|
|
|
|
|
private boolean func_145883_k()
|
|
|
|
{
|
|
|
|
+ if (net.minecraftforge.items.VanillaInventoryCodeHooks.insertHook(this)) { return true; }
|
|
|
|
IInventory iinventory = this.func_145895_l();
|
|
|
|
|
|
|
|
if (iinventory == null)
|
2016-06-23 06:39:36 +00:00
|
|
|
@@ -357,6 +358,7 @@
|
2016-01-17 16:41:34 +00:00
|
|
|
|
|
|
|
public static boolean func_145891_a(IHopper p_145891_0_)
|
|
|
|
{
|
|
|
|
+ if (net.minecraftforge.items.VanillaInventoryCodeHooks.extractHook(p_145891_0_)) { return true; }
|
|
|
|
IInventory iinventory = func_145884_b(p_145891_0_);
|
|
|
|
|
|
|
|
if (iinventory != null)
|
2016-06-23 06:39:36 +00:00
|
|
|
@@ -506,17 +508,31 @@
|
2015-11-12 16:27:14 +00:00
|
|
|
|
|
|
|
if (itemstack == null)
|
|
|
|
{
|
|
|
|
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
|
2015-11-22 05:46:26 +00:00
|
|
|
+ int max = Math.min(p_174916_1_.func_77976_d(), p_174916_0_.func_70297_j_());
|
|
|
|
+ if (max >= p_174916_1_.field_77994_a)
|
2015-11-12 16:27:14 +00:00
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
p_174916_0_.func_70299_a(p_174916_2_, p_174916_1_);
|
2015-11-12 16:27:14 +00:00
|
|
|
p_174916_1_ = null;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ p_174916_0_.func_70299_a(p_174916_2_, p_174916_1_.func_77979_a(max));
|
2015-11-12 16:27:14 +00:00
|
|
|
+ }
|
|
|
|
flag = true;
|
|
|
|
}
|
2015-11-22 05:46:26 +00:00
|
|
|
else if (func_145894_a(itemstack, p_174916_1_))
|
2015-11-12 16:27:14 +00:00
|
|
|
{
|
2015-11-22 05:46:26 +00:00
|
|
|
- int i = p_174916_1_.func_77976_d() - itemstack.field_77994_a;
|
2015-11-12 16:27:14 +00:00
|
|
|
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
|
2015-11-22 05:46:26 +00:00
|
|
|
+ int max = Math.min(p_174916_1_.func_77976_d(), p_174916_0_.func_70297_j_());
|
|
|
|
+ if (max > itemstack.field_77994_a)
|
2015-11-12 16:27:14 +00:00
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ int i = max - itemstack.field_77994_a;
|
|
|
|
int j = Math.min(p_174916_1_.field_77994_a, i);
|
|
|
|
p_174916_1_.field_77994_a -= j;
|
|
|
|
itemstack.field_77994_a += j;
|
2015-11-12 16:27:14 +00:00
|
|
|
flag = j > 0;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flag)
|
2016-06-23 06:39:36 +00:00
|
|
|
@@ -662,4 +678,10 @@
|
2016-01-17 16:41:34 +00:00
|
|
|
this.field_145900_a[i] = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ protected net.minecraftforge.items.IItemHandler createUnSidedHandler()
|
|
|
|
+ {
|
|
|
|
+ return new net.minecraftforge.items.VanillaHopperItemHandler(this);
|
|
|
|
+ }
|
|
|
|
}
|