use of mods.railcraft.api.signals.SignalAspect in project Railcraft by Railcraft.
the class TESRSignalBox method renderTileEntityAt.
@Override
public void renderTileEntityAt(TileBoxBase tile, double x, double y, double z, float partialTicks, int destroyStage) {
super.renderTileEntityAt(tile, x, y, z, partialTicks, destroyStage);
// Aspect
for (EnumFacing side : EnumFacing.HORIZONTALS) {
SignalAspect aspect = tile.getBoxSignalAspect(side).getDisplayAspect();
TextureAtlasSprite texture = RenderTools.getTexture(BlockMachineSignalBox.lampTextures[aspect.getTextureIndex()]);
lampInfo.setTexture(side, texture);
lampInfo.glow = !aspect.isOffState();
lampInfo.setRenderSide(side, !tile.isConnected(side));
}
doRenderAspect(x, y, z);
}
use of mods.railcraft.api.signals.SignalAspect in project Railcraft by Railcraft.
the class TESRSignalLamp method renderTileEntityAt.
@Override
public void renderTileEntityAt(TileSignalBase tile, double x, double y, double z, float partialTicks, int destroyStage) {
EnumFacing side = tile.getFacing();
SignalAspect aspect = tile.getSignalAspect().getDisplayAspect();
TextureAtlasSprite texture = RenderTools.getTexture(BlockMachineSignalBox.lampTextures[aspect.getTextureIndex()]);
lampInfo.setTexture(side, texture);
lampInfo.lightSource = aspect.getTextureBrightness();
doRenderAspect(x, y, z);
}
use of mods.railcraft.api.signals.SignalAspect in project Railcraft by Railcraft.
the class GuiAspectAction method onButtonPressed.
protected void onButtonPressed(GuiButton button) {
if (button.id <= 4) {
SignalAspect aspect = SignalAspect.VALUES[button.id];
aspects[aspect.ordinal()] = !aspects[aspect.ordinal()];
((GuiToggleButton) button).active = aspects[aspect.ordinal()];
}
}
use of mods.railcraft.api.signals.SignalAspect in project Railcraft by Railcraft.
the class TileBoxController method update.
@Override
public void update() {
super.update();
if (Game.isClient(worldObj)) {
controller.tickClient();
return;
}
controller.tickServer();
SignalAspect prevAspect = controller.getAspect();
if (controller.isBeingPaired())
controller.setAspect(SignalAspect.BLINK_YELLOW);
else if (controller.isPaired())
controller.setAspect(determineAspect());
else
controller.setAspect(SignalAspect.BLINK_RED);
if (prevAspect != controller.getAspect())
sendUpdateToClient();
}
use of mods.railcraft.api.signals.SignalAspect in project Railcraft by Railcraft.
the class TileBoxReceiver method update.
@Override
public void update() {
super.update();
if (Game.isClient(getWorld())) {
receiver.tickClient();
return;
}
receiver.tickServer();
SignalAspect prevAspect = receiver.getAspect();
if (receiver.isBeingPaired())
receiver.setAspect(SignalAspect.BLINK_YELLOW);
else if (!receiver.isPaired())
receiver.setAspect(SignalAspect.BLINK_RED);
if (prevAspect != receiver.getAspect() || clock % FORCED_UPDATE == 0) {
updateNeighbors();
sendUpdateToClient();
}
}
Aggregations