Search in sources :

Example 1 with TileEntityCustomWood

use of com.infinityraider.agricraft.tiles.TileEntityCustomWood in project AgriCraft by AgriCraft.

the class BlockCustomWood method setTag.

protected void setTag(IBlockAccess world, BlockPos pos, ItemStack stack) {
    TileEntity te = world.getTileEntity(pos);
    if (te != null && te instanceof TileEntityCustomWood) {
        TileEntityCustomWood tile = (TileEntityCustomWood) te;
        stack.setTagCompound(tile.getMaterialTag());
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityCustomWood(com.infinityraider.agricraft.tiles.TileEntityCustomWood)

Example 2 with TileEntityCustomWood

use of com.infinityraider.agricraft.tiles.TileEntityCustomWood in project AgriCraft by AgriCraft.

the class BlockCustomWood method onBlockPlacedBy.

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
    TileEntity te = world.getTileEntity(pos);
    if (te instanceof TileEntityCustomWood) {
        TileEntityCustomWood tileEntity = (TileEntityCustomWood) te;
        tileEntity.setMaterial(stack);
    }
    super.onBlockPlacedBy(world, pos, state, placer, stack);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityCustomWood(com.infinityraider.agricraft.tiles.TileEntityCustomWood)

Aggregations

TileEntityCustomWood (com.infinityraider.agricraft.tiles.TileEntityCustomWood)2 TileEntity (net.minecraft.tileentity.TileEntity)2