Fixed brewing stand returning incorrect solts for side inventories.

This commit is contained in:
LexManos 2016-06-18 15:49:21 -07:00
parent 5c15dd714e
commit 3f15c7b05b

View file

@ -63,22 +63,27 @@
} }
} }
@@ -367,6 +366,21 @@ @@ -367,6 +366,26 @@
} }
} }
+ net.minecraftforge.items.IItemHandler handlerInput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.UP); + net.minecraftforge.items.IItemHandler handlerInput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.UP);
+ net.minecraftforge.items.IItemHandler handlerOutput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.DOWN); + net.minecraftforge.items.IItemHandler handlerOutput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.DOWN);
+ net.minecraftforge.items.IItemHandler handlerSides = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.NORTH);
+ +
+ @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked")
+ @Override + @Override
+ public <T> T getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.util.EnumFacing facing) + public <T> T getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.util.EnumFacing facing)
+ { + {
+ if (facing != null && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) + if (facing != null && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
+ {
+ if (facing == EnumFacing.UP) + if (facing == EnumFacing.UP)
+ return (T) handlerInput; + return (T) handlerInput;
+ else + else if (facing == EnumFacing.DOWN)
+ return (T) handlerOutput; + return (T) handlerOutput;
+ else
+ return (T) handlerSides;
+ }
+ return super.getCapability(capability, facing); + return super.getCapability(capability, facing);
+ } + }
+ +