Search in sources :

Example 1 with IrrigationConnection

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);
}
Also used : IrrigationConnection(com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection)

Example 2 with IrrigationConnection

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);
}
Also used : IrrigationConnection(com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection) TileEntityTank(com.infinityraider.agricraft.tiles.irrigation.TileEntityTank) EnumFacing(net.minecraft.util.EnumFacing)

Example 3 with IrrigationConnection

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);
}
Also used : IrrigationConnection(com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection) EnumFacing(net.minecraft.util.EnumFacing) TileEntityChannel(com.infinityraider.agricraft.tiles.irrigation.TileEntityChannel)

Example 4 with IrrigationConnection

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);
}
Also used : IrrigationConnection(com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection)

Aggregations

IrrigationConnection (com.infinityraider.agricraft.api.v1.irrigation.IrrigationConnection)4 EnumFacing (net.minecraft.util.EnumFacing)2 TileEntityChannel (com.infinityraider.agricraft.tiles.irrigation.TileEntityChannel)1 TileEntityTank (com.infinityraider.agricraft.tiles.irrigation.TileEntityTank)1