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

43 lines
1.6 KiB
Diff

--- a/net/minecraft/tileentity/HopperTileEntity.java
+++ b/net/minecraft/tileentity/HopperTileEntity.java
@@ -133,6 +133,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;
@@ -177,6 +178,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) {
Direction direction = Direction.DOWN;
@@ -325,7 +328,7 @@
Block block = blockstate.func_177230_c();
if (block instanceof ISidedInventoryProvider) {
iinventory = ((ISidedInventoryProvider)block).func_219966_a(blockstate, p_145893_0_, blockpos);
- } else if (block.func_235695_q_()) {
+ } else if (blockstate.hasTileEntity()) {
TileEntity tileentity = p_145893_0_.func_175625_s(blockpos);
if (tileentity instanceof IInventory) {
iinventory = (IInventory)tileentity;
@@ -404,4 +407,13 @@
protected Container func_213906_a(int p_213906_1_, PlayerInventory p_213906_2_) {
return new HopperContainer(p_213906_1_, p_213906_2_, this);
}
+
+ @Override
+ protected net.minecraftforge.items.IItemHandler createUnSidedHandler() {
+ return new net.minecraftforge.items.VanillaHopperItemHandler(this);
+ }
+
+ public long getLastUpdateTime() {
+ return this.field_190578_g;
+ }
}