Search in sources :

Example 31 with IExtendedBlockState

use of net.minecraftforge.common.property.IExtendedBlockState in project BetterWithAddons by DaedalusGame.

the class BlockRopeSideways method getExtendedState.

@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
    TileEntity te = world instanceof ChunkCache ? ((ChunkCache) world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos);
    ItemStack planks = ItemStack.EMPTY;
    if (te instanceof TileEntityRopeSideways) {
        TileEntityRopeSideways tile = (TileEntityRopeSideways) te;
        planks = tile.getPlanks();
    }
    return ((IExtendedBlockState) state).withProperty(HELD_PLANKS, planks);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityRopeSideways(betterwithaddons.tileentity.TileEntityRopeSideways) ChunkCache(net.minecraft.world.ChunkCache) IExtendedBlockState(net.minecraftforge.common.property.IExtendedBlockState) ItemStack(net.minecraft.item.ItemStack)

Aggregations

IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)31 IBlockState (net.minecraft.block.state.IBlockState)9 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)8 TileEntity (net.minecraft.tileentity.TileEntity)8 OBJState (net.minecraftforge.client.model.obj.OBJModel.OBJState)8 BlockPos (net.minecraft.util.math.BlockPos)6 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)5 TileEntityImmersiveConnectable (blusunrize.immersiveengineering.api.energy.wires.TileEntityImmersiveConnectable)4 ItemStack (net.minecraft.item.ItemStack)4 EnumFacing (net.minecraft.util.EnumFacing)4 Block (net.minecraft.block.Block)3 Minecraft (net.minecraft.client.Minecraft)3 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)3 ResourceLocation (net.minecraft.util.ResourceLocation)3 TRSRTransformation (net.minecraftforge.common.model.TRSRTransformation)3 CustomWoodType (com.infinityraider.agricraft.utility.CustomWoodType)2 ArrayList (java.util.ArrayList)2 ChunkCache (net.minecraft.world.ChunkCache)2 IBlockAccess (net.minecraft.world.IBlockAccess)2 IModel (net.minecraftforge.client.model.IModel)2