use of forestry.farming.blocks.EnumFarmBlockType 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);
}
use of forestry.farming.blocks.EnumFarmBlockType in project ForestryMC by ForestryMC.
the class ModelFarmBlock method getInventoryKey.
@Override
protected Key getInventoryKey(ItemStack stack) {
EnumFarmBlockTexture texture = EnumFarmBlockTexture.getFromCompound(stack.getTagCompound());
EnumFarmBlockType type = EnumFarmBlockType.VALUES[stack.getItemDamage()];
return new Key(texture, type);
}
Aggregations