use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class LogisticsTriggerProvider method getInternalTriggers.
@Override
public Collection<ITriggerInternal> getInternalTriggers(IStatementContainer pipe) {
if (pipe.getTile() instanceof LPBCTileGenericPipe) {
LogisticsTileGenericPipe lPipe = ((LPBCTileGenericPipe) pipe.getTile()).getLpPipe();
LinkedList<ITriggerInternal> triggers = new LinkedList<>();
if (lPipe.pipe instanceof PipeItemsSupplierLogistics || lPipe.pipe instanceof PipeItemsFluidSupplier) {
triggers.add(BuildCraftProxy.LogisticsFailedTrigger);
}
if (lPipe.pipe instanceof PipeItemsCraftingLogistics) {
triggers.add(BuildCraftProxy.LogisticsCraftingTrigger);
}
if (lPipe.pipe instanceof CoreRoutedPipe) {
//Only show this conditional on Gates that can accept parameters
triggers.add(BuildCraftProxy.LogisticsHasDestinationTrigger);
}
if (!triggers.isEmpty()) {
return triggers;
}
}
return null;
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class BuildCraftProxy method getBCRenderTESR.
@Override
public IBCRenderTESR getBCRenderTESR() {
return new IBCRenderTESR() {
@Override
@SneakyThrows(Exception.class)
public void renderWires(LogisticsTileGenericPipe pipe, double x, double y, double z) {
TileGenericPipe tgPipe = (TileGenericPipe) pipe.tilePart.getOriginal();
ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, PipeRendererTESR.INSTANCE, "renderGatesWires", new Class[] { TileGenericPipe.class, double.class, double.class, double.class }, new Object[] { tgPipe, x, y, z });
}
@Override
@SneakyThrows(Exception.class)
public void dynamicRenderPluggables(LogisticsTileGenericPipe pipe, double x, double y, double z) {
TileGenericPipe tgPipe = (TileGenericPipe) pipe.tilePart.getOriginal();
ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, PipeRendererTESR.INSTANCE, "renderPluggables", new Class[] { TileGenericPipe.class, double.class, double.class, double.class }, new Object[] { tgPipe, x, y, z });
}
};
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class LogisticsNewSolidBlockWorldRenderer method renderWorldBlock.
public void renderWorldBlock(IBlockAccess world, LogisticsSolidTileEntity blockTile, RenderBlocks renderer, int x, int y, int z) {
Tessellator tess = Tessellator.instance;
SimpleServiceLocator.cclProxy.getRenderState().reset();
SimpleServiceLocator.cclProxy.getRenderState().setUseNormals(true);
SimpleServiceLocator.cclProxy.getRenderState().setAlphaOverride(0xff);
BlockRotation rotation = BlockRotation.ZERO;
int brightness = 0;
IIconTransformation icon;
if (blockTile != null) {
BlockRotation.getRotation(blockTile.getRotation());
brightness = new DoubleCoordinates(blockTile).getBlock(world).getMixedBrightnessForBlock(world, blockTile.xCoord, blockTile.yCoord, blockTile.zCoord);
icon = SimpleServiceLocator.cclProxy.createIconTransformer(LogisticsSolidBlock.getNewIcon(world, blockTile.xCoord, blockTile.yCoord, blockTile.zCoord));
} else {
brightness = LogisticsPipes.LogisticsSolidBlock.getMixedBrightnessForBlock(world, x, y, z);
icon = SimpleServiceLocator.cclProxy.createIconTransformer(LogisticsSolidBlock.getNewIcon(world, x, y, z));
}
tess.setColorOpaque_F(1F, 1F, 1F);
tess.setBrightness(brightness);
//Draw
LogisticsNewSolidBlockWorldRenderer.block.get(rotation).render(new LPTranslation(x, y, z), icon);
if (blockTile != null) {
DoubleCoordinates pos = new DoubleCoordinates(blockTile);
for (CoverSides side : CoverSides.values()) {
boolean render = true;
DoubleCoordinates newPos = CoordinateUtils.sum(pos, side.getDir(rotation));
TileEntity sideTile = newPos.getTileEntity(blockTile.getWorldObj());
if (sideTile instanceof LogisticsTileGenericPipe) {
LogisticsTileGenericPipe tilePipe = (LogisticsTileGenericPipe) sideTile;
if (tilePipe.renderState.pipeConnectionMatrix.isConnected(side.getDir(rotation).getOpposite())) {
render = false;
}
}
if (render) {
LogisticsNewSolidBlockWorldRenderer.texturePlate_Outer.get(side).get(rotation).render(new LPTranslation(x, y, z), icon);
LogisticsNewSolidBlockWorldRenderer.texturePlate_Inner.get(side).get(rotation).render(new LPTranslation(x, y, z), icon);
}
}
}
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class PipeMultiBlockTransportLogistics method handleTileReachedServer.
@Override
protected void handleTileReachedServer(LPTravelingItemServer arrivingItem, TileEntity tile, ForgeDirection dir) {
markChunkModified(tile);
if (tile instanceof LogisticsTileGenericPipe && ((LogisticsTileGenericPipe) tile).pipe instanceof CoreMultiBlockPipe) {
passToNextPipe(arrivingItem, tile);
return;
} else if (tile instanceof LogisticsTileGenericSubMultiBlock) {
List<LogisticsTileGenericPipe> masterTile = ((LogisticsTileGenericSubMultiBlock) tile).getMainPipe();
if (!masterTile.isEmpty()) {
if (masterTile.size() > 1) {
throw new UnsupportedOperationException();
}
passToNextPipe(arrivingItem, masterTile.get(0));
return;
}
}
Explosion explosion = new Explosion(this.getWorld(), null, this.getPipe().getX(), this.getPipe().getY(), this.getPipe().getZ(), 4.0F);
explosion.isFlaming = false;
explosion.isSmoking = true;
explosion.doExplosionB(true);
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class PipeTransportLogistics method handleItemPositionPacket.
public void handleItemPositionPacket(int travelId, ForgeDirection input, ForgeDirection output, float speed, float position, float yaw) {
WeakReference<LPTravelingItemClient> ref = LPTravelingItem.clientList.get(travelId);
LPTravelingItemClient item = null;
if (ref != null) {
item = ref.get();
}
if (item == null) {
sendItemContentRequest(travelId);
item = new LPTravelingItemClient(travelId, position, input, output, yaw);
item.setSpeed(speed);
LPTravelingItem.clientList.put(travelId, new WeakReference<>(item));
} else {
if (item.getContainer() instanceof LogisticsTileGenericPipe) {
((LogisticsTileGenericPipe) item.getContainer()).pipe.transport.items.scheduleRemoval(item);
((LogisticsTileGenericPipe) item.getContainer()).pipe.transport.items.removeScheduledItems();
}
item.updateInformation(input, output, speed, position, yaw);
}
//update lastTicked so we don't double-move items
item.lastTicked = MainProxy.getGlobalTick();
if (items.get(travelId) == null) {
items.add(item);
}
//getPipe().spawnParticle(Particles.OrangeParticle, 1);
}
Aggregations