use of com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationComponent in project AgriCraft by AgriCraft.
the class TileEntityIrrigationChannelRenderer method drawConnectionWest.
protected void drawConnectionWest(ITessellator tessellator, TileEntityIrrigationChannel tile, float partialTicks) {
TileEntityIrrigationComponent component = tile.getNeighbour(Direction.WEST);
if (component == null) {
return;
}
float y1 = tile.getRenderLevel(partialTicks) - tile.getPos().getY();
float y2 = this.getConnectionLevel(tile, component, partialTicks);
if (dontRenderConnection(tile, component, y2)) {
return;
}
if (tile.isClosed()) {
y1 = y2;
}
float minX = 0;
float maxX = 6;
float minZ = 6;
float maxZ = 10;
tessellator.addScaledVertexWithUV(maxX, Constants.WHOLE * y1, minZ, this.getWaterTexture(), maxX, minZ);
tessellator.addScaledVertexWithUV(minX, Constants.WHOLE * y2, minZ, this.getWaterTexture(), minX, minZ);
tessellator.addScaledVertexWithUV(minX, Constants.WHOLE * y2, maxZ, this.getWaterTexture(), minX, maxZ);
tessellator.addScaledVertexWithUV(maxX, Constants.WHOLE * y1, maxZ, this.getWaterTexture(), maxX, maxZ);
}
use of com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationComponent in project AgriCraft by AgriCraft.
the class TileEntityIrrigationChannelRenderer method drawConnectionNorth.
protected void drawConnectionNorth(ITessellator tessellator, TileEntityIrrigationChannel tile, float partialTicks) {
TileEntityIrrigationComponent component = tile.getNeighbour(Direction.NORTH);
if (component == null) {
return;
}
float y1 = tile.getRenderLevel(partialTicks) - tile.getPos().getY();
float y2 = this.getConnectionLevel(tile, component, partialTicks);
if (dontRenderConnection(tile, component, y2)) {
return;
}
if (tile.isClosed()) {
y1 = y2;
}
float minX = 6;
float maxX = 10;
float minZ = 0;
float maxZ = 6;
tessellator.addScaledVertexWithUV(maxX, Constants.WHOLE * y2, minZ, this.getWaterTexture(), maxX, minZ);
tessellator.addScaledVertexWithUV(minX, Constants.WHOLE * y2, minZ, this.getWaterTexture(), minX, minZ);
tessellator.addScaledVertexWithUV(minX, Constants.WHOLE * y1, maxZ, this.getWaterTexture(), minX, maxZ);
tessellator.addScaledVertexWithUV(maxX, Constants.WHOLE * y1, maxZ, this.getWaterTexture(), maxX, maxZ);
}
use of com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationComponent in project AgriCraft by AgriCraft.
the class TileEntityIrrigationChannelRenderer method drawConnectionSouth.
protected void drawConnectionSouth(ITessellator tessellator, TileEntityIrrigationChannel tile, float partialTicks) {
TileEntityIrrigationComponent component = tile.getNeighbour(Direction.SOUTH);
if (component == null) {
return;
}
float y1 = tile.getRenderLevel(partialTicks) - tile.getPos().getY();
float y2 = this.getConnectionLevel(tile, component, partialTicks);
if (dontRenderConnection(tile, component, y2)) {
return;
}
if (tile.isClosed()) {
y1 = y2;
}
float minX = 6;
float maxX = 10;
float minZ = 10;
float maxZ = 16;
tessellator.addScaledVertexWithUV(maxX, Constants.WHOLE * y1, minZ, this.getWaterTexture(), maxX, minZ);
tessellator.addScaledVertexWithUV(minX, Constants.WHOLE * y1, minZ, this.getWaterTexture(), minX, minZ);
tessellator.addScaledVertexWithUV(minX, Constants.WHOLE * y2, maxZ, this.getWaterTexture(), minX, maxZ);
tessellator.addScaledVertexWithUV(maxX, Constants.WHOLE * y2, maxZ, this.getWaterTexture(), maxX, maxZ);
}
use of com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationComponent in project AgriCraft by AgriCraft.
the class AgriProbeIrrigationBlockInfoProvider method addIrrigationProbeInfo.
protected void addIrrigationProbeInfo(IProbeInfo info, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileEntityIrrigationComponent) {
if (tile instanceof TileEntityIrrigationChannel) {
TileEntityIrrigationChannel channel = (TileEntityIrrigationChannel) tile;
if (channel.hasValve()) {
if (channel.isOpen()) {
info.text(AgriToolTips.VALVE_INFO_OPEN);
} else {
info.text(AgriToolTips.VALVE_INFO_CLOSED);
}
}
}
TileEntityIrrigationComponent component = (TileEntityIrrigationComponent) tile;
info.progress(component.getContent(), component.getCapacity(), new ProgressStyle().filledColor(0xff327DCD).alternateFilledColor(0xff3732CD).suffix(" mB"));
}
}
Aggregations