use of com.almuradev.almura.shared.inventory.DualItemHandlerContainer in project Almura by AlmuraDev.
the class CapabilityDualItemHandlerGuiHandler method getServerGuiElement.
@Nullable
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
final TileEntity te = world.getTileEntity(new BlockPos(x, y, z));
if (te == null || !(te instanceof MultiSlotTileEntity)) {
return null;
}
final IItemHandler teItemHandler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
if (teItemHandler == null) {
return null;
}
final IItemHandler playerItemHandler = player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
if (playerItemHandler == null) {
return null;
}
return new DualItemHandlerContainer(teItemHandler, playerItemHandler);
}
Aggregations