use of pneumaticCraft.common.tileentity.TileEntityPressureTube in project PneumaticCraft by MineMaarten.
the class WailaFMPHandler method getWailaBody.
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config) {
TileEntityPressureTube tube = ModInteractionUtils.getInstance().getTube(accessor.getTileEntity());
if (tube != null) {
NBTTagCompound tubeTag = accessor.getNBTData().getCompoundTag("tube");
tube.currentAir = tubeTag.getInteger("currentAir");
WailaPneumaticHandler.addTipToMachine(currenttip, tube);
TubeModule module = BlockPressureTube.getLookedModule(accessor.getWorld(), accessor.getTileEntity().xCoord, accessor.getTileEntity().yCoord, accessor.getTileEntity().zCoord, accessor.getPlayer());
if (module != null) {
WailaTubeModuleHandler.addModuleInfo(currenttip, tube, tubeTag, module.getDirection());
}
}
return currenttip;
}
use of pneumaticCraft.common.tileentity.TileEntityPressureTube in project PneumaticCraft by MineMaarten.
the class PartPressureTube method update.
@Override
public void update() {
//Log.info("sides connected " + world().isRemote + ": " + Arrays.toString(sidesConnected));
if (Config.convertMultipartsToBlocks && !world().isRemote) {
Log.info("Converting Pressure Tube part to Pressure Tube block at " + x() + ", " + y() + ", " + z());
Block pressureTube = Block.getBlockFromItem(getItem().getItem());
world().setBlock(x(), y(), z(), pressureTube);
TileEntityPressureTube t = (TileEntityPressureTube) world().getTileEntity(x(), y(), z());
NBTTagCompound tag = new NBTTagCompound();
tube.writeToNBTI(tag);
t.readFromNBT(tag);
world().notifyBlocksOfNeighborChange(x(), y(), z(), pressureTube);
return;
}
tube.updateEntityI();
}
Aggregations