use of mekanism.common.content.network.transmitter.DiversionTransporter in project Mekanism by mekanism.
the class RenderLogisticalTransporter method render.
@Override
protected void render(TileEntityLogisticalTransporterBase tile, float partialTick, MatrixStack matrix, IRenderTypeBuffer renderer, int light, int overlayLight, IProfiler profiler) {
LogisticalTransporterBase transporter = tile.getTransmitter();
Collection<TransporterStack> inTransit = transporter.getTransit();
BlockPos pos = tile.getBlockPos();
if (!inTransit.isEmpty()) {
matrix.pushPose();
itemRenderer.init(tile.getLevel(), pos);
float partial = partialTick * transporter.tier.getSpeed();
Collection<TransporterStack> reducedTransit = getReducedTransit(inTransit);
for (TransporterStack stack : reducedTransit) {
float[] stackPos = TransporterUtils.getStackPosition(transporter, stack, partial);
matrix.pushPose();
matrix.translate(stackPos[0], stackPos[1], stackPos[2]);
matrix.scale(0.75F, 0.75F, 0.75F);
itemRenderer.renderAsStack(matrix, renderer, stack.itemStack);
matrix.popPose();
if (stack.color != null) {
modelBox.render(matrix, renderer, MekanismRenderer.FULL_LIGHT, overlayLight, stackPos[0], stackPos[1], stackPos[2], stack.color);
}
}
matrix.popPose();
}
if (transporter instanceof DiversionTransporter) {
PlayerEntity player = Minecraft.getInstance().player;
ItemStack itemStack = player.inventory.getSelected();
if (!itemStack.isEmpty() && itemStack.getItem() instanceof ItemConfigurator) {
BlockRayTraceResult rayTraceResult = MekanismUtils.rayTrace(player);
if (!rayTraceResult.getType().equals(Type.MISS) && rayTraceResult.getBlockPos().equals(pos)) {
Direction side = tile.getSideLookingAt(player, rayTraceResult.getDirection());
matrix.pushPose();
matrix.scale(0.5F, 0.5F, 0.5F);
matrix.translate(0.5, 0.5, 0.5);
MekanismRenderer.renderObject(getOverlayModel((DiversionTransporter) transporter, side), matrix, renderer.getBuffer(Atlases.translucentCullBlockSheet()), MekanismRenderer.getColorARGB(255, 255, 255, 0.8F), MekanismRenderer.FULL_LIGHT, overlayLight, FaceDisplay.FRONT);
matrix.popPose();
}
}
}
}
use of mekanism.common.content.network.transmitter.DiversionTransporter in project Mekanism by mekanism.
the class TileEntityDiversionTransporter method incrementMode.
@ComputerMethod
private void incrementMode(Direction side) {
DiversionTransporter transmitter = getTransmitter();
transmitter.updateMode(side, transmitter.modes[side.ordinal()].getNext());
}
use of mekanism.common.content.network.transmitter.DiversionTransporter in project Mekanism by mekanism.
the class TileEntityDiversionTransporter method decrementMode.
@ComputerMethod
private void decrementMode(Direction side) {
DiversionTransporter transmitter = getTransmitter();
transmitter.updateMode(side, transmitter.modes[side.ordinal()].getPrevious());
}
Aggregations