use of com.bluepowermod.part.tube.TubeLogic in project BluePower by Qmunity.
the class IOHelper method insert.
public static ItemStack insert(TileEntity tile, ItemStack itemStack, ForgeDirection direction, TubeColor color, boolean simulate) {
if (tile == null || itemStack == null)
return itemStack;
if (tile instanceof ITubeConnection) {
TubeStack tubeStack = ((ITubeConnection) tile).acceptItemFromTube(new TubeStack(itemStack, direction.getOpposite(), color), direction, simulate);
if (tubeStack == null)
return null;
return tubeStack.stack;
}
IInventory inv = getInventoryForTE(tile);
if (inv != null)
return insert(inv, itemStack, direction.ordinal(), simulate);
PneumaticTube tube = MultipartCompatibility.getPart(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, PneumaticTube.class);
if (tube != null) {
// we don't need to check connections, that's catched earlier.
TubeLogic logic = tube.getLogic();
return logic.injectStack(itemStack, direction.getOpposite(), color, simulate) ? null : itemStack;
}
return itemStack;
}
use of com.bluepowermod.part.tube.TubeLogic in project BluePower by Qmunity.
the class MessageRedirectTubeStack method handleClientSide.
@Override
public void handleClientSide(EntityPlayer player) {
PneumaticTube tube = MultipartCompatibility.getPart(player.worldObj, x, y, z, PneumaticTube.class);
if (tube == null)
return;
TubeLogic logic = tube.getLogic();
if (logic == null)
return;
logic.onClientTubeRedirectPacket(stack);
}
Aggregations