ForgePatch/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch

43 lines
1.5 KiB
Diff

--- a/net/minecraft/tileentity/TileEntityHopper.java
+++ b/net/minecraft/tileentity/TileEntityHopper.java
@@ -159,6 +159,7 @@
}
private boolean func_145883_k() {
+ if (net.minecraftforge.items.VanillaInventoryCodeHooks.insertHook(this)) return true;
IInventory iinventory = this.func_145895_l();
if (iinventory == null) {
return false;
@@ -234,6 +235,8 @@
}
public static boolean func_145891_a(IHopper p_145891_0_) {
+ Boolean ret = net.minecraftforge.items.VanillaInventoryCodeHooks.extractHook(p_145891_0_);
+ if (ret != null) return ret;
IInventory iinventory = func_145884_b(p_145891_0_);
if (iinventory != null) {
EnumFacing enumfacing = EnumFacing.DOWN;
@@ -399,7 +402,7 @@
BlockPos blockpos = new BlockPos(p_145893_1_, p_145893_3_, p_145893_5_);
IBlockState iblockstate = p_145893_0_.func_180495_p(blockpos);
Block block = iblockstate.func_177230_c();
- if (block.func_149716_u()) {
+ if (iblockstate.hasTileEntity()) {
TileEntity tileentity = p_145893_0_.func_175625_s(blockpos);
if (tileentity instanceof IInventory) {
iinventory = (IInventory)tileentity;
@@ -483,4 +486,13 @@
}
}
+
+ @Override
+ protected net.minecraftforge.items.IItemHandler createUnSidedHandler() {
+ return new net.minecraftforge.items.VanillaHopperItemHandler(this);
+ }
+
+ public long getLastUpdateTime() {
+ return this.field_190578_g;
+ }
}