use of net.minecraftforge.common.property.IExtendedBlockState in project YABBA by LatvianModder.
the class BakedBarrelBlockModel method getQuads.
@Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
if (state instanceof IExtendedBlockState) {
IExtendedBlockState statex = (IExtendedBlockState) state;
BarrelLook look = statex.getValue(BlockAdvancedBarrelBase.LOOK);
if (look == null) {
look = BarrelLook.DEFAULT;
}
BarrelModel model = look.getModel();
BarrelSkin skin = look.getSkin();
if (MinecraftForgeClient.getRenderLayer() == ClientUtils.getStrongest(model.layer, skin.layer)) {
return get(BarrelLook.get(model.id, skin.id)).getQuads(state.getValue(BlockAdvancedBarrelBase.ROTATION).getModelRotationIndexFromFacing(state.getValue(BlockHorizontal.FACING)));
}
}
return Collections.emptyList();
}
use of net.minecraftforge.common.property.IExtendedBlockState in project HorsePower by GoryMoon.
the class BlockHPChoppingBase method getExtendedState.
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
IExtendedBlockState extendedState = (IExtendedBlockState) state;
TileEntityHPBase tile = getTileEntity(world, pos);
if (tile != null) {
return getExtendedState(tile, tile.getExtendedState(extendedState));
}
return super.getExtendedState(state, world, pos);
}
use of net.minecraftforge.common.property.IExtendedBlockState in project HorsePower by GoryMoon.
the class BlockHandGrindstone method onBlockPlacedBy.
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
worldIn.setBlockState(pos, ((IExtendedBlockState) state).withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(PART, HandGrindstoneModels.BASE), 2);
TileEntityHandGrindstone tile = getTileEntity(worldIn, pos);
if (tile == null)
return;
tile.setForward(placer.getAdjustedHorizontalFacing().getOpposite());
}
use of net.minecraftforge.common.property.IExtendedBlockState in project ForestryMC by ForestryMC.
the class ModelBlockCustom method bakeModel.
protected IBakedModel bakeModel(IBlockState state, K key, B block) {
if (state instanceof IExtendedBlockState) {
IExtendedBlockState stateExtended = (IExtendedBlockState) state;
IBlockAccess world = stateExtended.getValue(UnlistedBlockAccess.BLOCKACCESS);
BlockPos pos = stateExtended.getValue(UnlistedBlockPos.POS);
}
return blockModel = bakeBlock(block, key, false);
}
use of net.minecraftforge.common.property.IExtendedBlockState 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