use of com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection in project AgriCraft by AgriCraft.
the class RenderChannel method renderWoodChannel.
protected void renderWoodChannel(ITessellator tessellator, IBlockState state, TextureAtlasSprite icon) {
final IrrigationConnection metas = new IrrigationConnection();
metas.read(state);
this.renderBottom(tessellator, icon);
this.renderSide(tessellator, state, EnumFacing.NORTH, metas.get(EnumFacing.NORTH), icon);
this.renderSide(tessellator, state, EnumFacing.EAST, metas.get(EnumFacing.EAST), icon);
this.renderSide(tessellator, state, EnumFacing.SOUTH, metas.get(EnumFacing.SOUTH), icon);
this.renderSide(tessellator, state, EnumFacing.WEST, metas.get(EnumFacing.WEST), icon);
}
use of com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection in project AgriCraft by AgriCraft.
the class BlockWaterTank method getActualState.
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
final Optional<TileEntityTank> tile = WorldHelper.getTile(world, pos, TileEntityTank.class);
if (!tile.isPresent()) {
return state;
}
tile.get().checkConnections();
final IrrigationConnection sides = new IrrigationConnection();
for (EnumFacing facing : EnumFacing.VALUES) {
sides.set(facing, tile.get().getConnectionType(facing));
}
return sides.write(state);
}
use of com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection in project AgriCraft by AgriCraft.
the class AbstractBlockWaterChannel method getActualState.
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
final Optional<TileEntityChannel> tile = WorldHelper.getTile(world, pos, TileEntityChannel.class);
if (!tile.isPresent()) {
return state;
}
tile.get().checkConnections();
final IrrigationConnection sides = new IrrigationConnection();
for (EnumFacing facing : EnumFacing.HORIZONTALS) {
sides.set(facing, tile.get().getConnectionType(facing));
}
return sides.write(state);
}
use of com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection in project AgriCraft by AgriCraft.
the class RenderTank method renderWorldBlockWoodStatic.
@Override
protected void renderWorldBlockWoodStatic(ITessellator tess, IExtendedBlockState state, BlockWaterTank block, EnumFacing side, TextureAtlasSprite sprite) {
final IrrigationConnection connections = new IrrigationConnection();
connections.read(state);
renderSide(tess, EnumFacing.NORTH, connections.get(EnumFacing.NORTH), sprite);
renderSide(tess, EnumFacing.EAST, connections.get(EnumFacing.EAST), sprite);
renderSide(tess, EnumFacing.SOUTH, connections.get(EnumFacing.SOUTH), sprite);
renderSide(tess, EnumFacing.WEST, connections.get(EnumFacing.WEST), sprite);
renderBottom(tess, connections.get(EnumFacing.DOWN), sprite);
}
Aggregations