use of forestry.farming.tiles.TileFarm in project ForestryMC by ForestryMC.
the class BlockFarm method onBlockPlacedBy.
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
super.onBlockPlacedBy(world, pos, state, placer, stack);
if (stack.getTagCompound() == null) {
return;
}
TileFarm tile = TileUtil.getTile(world, pos, TileFarm.class);
if (tile != null) {
tile.setFarmBlockTexture(EnumFarmBlockTexture.getFromCompound(stack.getTagCompound()));
}
}
use of forestry.farming.tiles.TileFarm in project ForestryMC by ForestryMC.
the class ModelFarmBlock method getWorldKey.
@Override
protected Key getWorldKey(IBlockState state) {
IExtendedBlockState stateExtended = (IExtendedBlockState) state;
IBlockAccess world = stateExtended.getValue(UnlistedBlockAccess.BLOCKACCESS);
BlockPos pos = stateExtended.getValue(UnlistedBlockPos.POS);
TileFarm farm = TileUtil.getTile(world, pos, TileFarm.class);
EnumFarmBlockTexture texture = EnumFarmBlockTexture.BRICK;
EnumFarmBlockType type = EnumFarmBlockType.PLAIN;
if (farm != null) {
texture = farm.getFarmBlockTexture();
type = farm.getFarmBlockType();
}
return new Key(texture, type);
}
Aggregations