Routing system should accept I(Sided)Inventory
Stupid non-capability using n00bz0rz
This commit is contained in:
parent
6315d38c8a
commit
eb76760919
3 changed files with 26 additions and 4 deletions
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.item.routing.IItemFilterProvider;
|
|||
import WayofTime.bloodmagic.routing.DefaultItemFilter;
|
||||
import WayofTime.bloodmagic.routing.IInputItemRoutingNode;
|
||||
import WayofTime.bloodmagic.routing.IItemFilter;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -30,9 +31,9 @@ public class TileInputRoutingNode extends TileFilteredRoutingNode implements IIn
|
|||
TileEntity tile = worldObj.getTileEntity(pos.offset(side));
|
||||
if (tile != null)
|
||||
{
|
||||
if (tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()))
|
||||
IItemHandler handler = Utils.getInventory(tile, side.getOpposite());
|
||||
if (handler != null)
|
||||
{
|
||||
IItemHandler handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite());
|
||||
ItemStack filterStack = this.getFilterStack(side);
|
||||
|
||||
if (filterStack == null || !(filterStack.getItem() instanceof IItemFilterProvider))
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.item.routing.IItemFilterProvider;
|
|||
import WayofTime.bloodmagic.routing.DefaultItemFilter;
|
||||
import WayofTime.bloodmagic.routing.IItemFilter;
|
||||
import WayofTime.bloodmagic.routing.IOutputItemRoutingNode;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -30,9 +31,9 @@ public class TileOutputRoutingNode extends TileFilteredRoutingNode implements IO
|
|||
TileEntity tile = worldObj.getTileEntity(pos.offset(side));
|
||||
if (tile != null)
|
||||
{
|
||||
if (tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()))
|
||||
IItemHandler handler = Utils.getInventory(tile, side.getOpposite());
|
||||
if (handler != null)
|
||||
{
|
||||
IItemHandler handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite());
|
||||
ItemStack filterStack = this.getFilterStack(side);
|
||||
|
||||
if (filterStack == null || !(filterStack.getItem() instanceof IItemFilterProvider))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue