use of net.minecraftforge.common.property.IExtendedBlockState in project ForestryMC by ForestryMC.
the class ModelCamouflaged method getWorldKey.
@Override
protected Key getWorldKey(IBlockState state) {
IExtendedBlockState stateExtended = (IExtendedBlockState) state;
IBlockAccess world = stateExtended.getValue(UnlistedBlockAccess.BLOCKACCESS);
BlockPos pos = stateExtended.getValue(UnlistedBlockPos.POS);
return new Key(stateExtended, world, pos, state.getBlock().getMetaFromState(state));
}
use of net.minecraftforge.common.property.IExtendedBlockState in project RFTools by McJty.
the class CamoShieldBlock method getExtendedState.
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
IExtendedBlockState extendedBlockState = (IExtendedBlockState) state;
IBlockState mimicBlock = getMimicBlock(world, pos);
if (mimicBlock != null) {
return extendedBlockState.withProperty(CAMOID, new CamoBlockId(mimicBlock));
} else {
return extendedBlockState;
}
}
use of net.minecraftforge.common.property.IExtendedBlockState in project Binnie by ForestryMC.
the class BlockCeramicBrick method getWorldKey.
@Override
@SideOnly(Side.CLIENT)
public CeramicBrickPair getWorldKey(IBlockState state) {
IExtendedBlockState extendedState = (IExtendedBlockState) state;
IBlockAccess world = extendedState.getValue(UnlistedBlockAccess.BLOCKACCESS);
BlockPos pos = extendedState.getValue(UnlistedBlockPos.POS);
TileCeramicBrick ceramic = TileUtil.getTile(world, pos, TileCeramicBrick.class);
if (ceramic != null) {
return ceramic.pair();
}
return CeramicBrickPair.EMPTY;
}
use of net.minecraftforge.common.property.IExtendedBlockState in project Binnie by ForestryMC.
the class ModelMutlipass method bakeModel.
@Override
protected IBakedModel bakeModel(IBlockState state, K key, B block) {
if (key == null) {
return null;
}
AABBModelBaker baker = new AABBModelBaker();
if (state instanceof IExtendedBlockState) {
IExtendedBlockState stateExtended = (IExtendedBlockState) state;
IBlockAccess world = stateExtended.getValue(UnlistedBlockAccess.BLOCKACCESS);
BlockPos pos = stateExtended.getValue(UnlistedBlockPos.POS);
baker.setModelBounds(state.getBoundingBox(world, pos));
} else {
baker.setModelBounds(block.getItemBoundingBox());
}
bakeBlock(block, key, baker, false);
blockModel = baker.bakeModel(false);
onCreateModel(blockModel);
return blockModel;
}
use of net.minecraftforge.common.property.IExtendedBlockState in project Binnie by ForestryMC.
the class ModelMultiFence method getWorldKey.
@Override
protected Key getWorldKey(IBlockState state) {
IExtendedBlockState stateExtended = (IExtendedBlockState) state;
IBlockAccess world = stateExtended.getValue(UnlistedBlockAccess.BLOCKACCESS);
BlockPos pos = stateExtended.getValue(UnlistedBlockPos.POS);
int meta = TileEntityMetadata.getTileMetadata(world, pos);
return new Key(meta, state.getValue(BlockFence.WEST), state.getValue(BlockFence.EAST), state.getValue(BlockFence.NORTH), state.getValue(BlockFence.SOUTH));
}
Aggregations