From 2c173766cb4770ca4ed992528b0959d4d37d8118 Mon Sep 17 00:00:00 2001 From: Nedelosk Date: Tue, 24 May 2016 21:29:59 +0200 Subject: [PATCH] Fix #1236 Normal logs are not flammable(in world) and add flammability to the wood pile --- .../arboriculture/blocks/BlockArbLog.java | 2 +- .../arboriculture/blocks/BlockPile.java | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArbLog.java b/src/main/java/forestry/arboriculture/blocks/BlockArbLog.java index 249a69cd6..323fe3fef 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArbLog.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArbLog.java @@ -210,7 +210,7 @@ public abstract class BlockArbLog extends BlockLog implements IWoodTyped, IState if (fireproof) { return 0; } - return super.getFlammability(world, pos, face); + return 5; } @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockPile.java b/src/main/java/forestry/arboriculture/blocks/BlockPile.java index c63665d6a..41ee88e4d 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockPile.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockPile.java @@ -523,6 +523,45 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro return null; } + @Override + public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) { + if(getPileType() == EnumPileType.WOOD){ + TileEntity tile = world.getTileEntity(pos); + if (tile instanceof ICharcoalPileComponent) { + + ITree tree = ((ICharcoalPileComponent)tile).getTree(); + if(tree != null){ + ItemStack wood = tree.getGenome().getPrimary().getWoodProvider().getWoodStack(); + if(wood != null){ + Block block = Block.getBlockFromItem(wood.getItem()); + return block.getFlammability(world, pos, face); + } + } + } + } + return super.getFlammability(world, pos, face); + } + + @Override + public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) { + if(getPileType() == EnumPileType.WOOD){ + TileEntity tile = world.getTileEntity(pos); + if (tile instanceof ICharcoalPileComponent) { + + ITree tree = ((ICharcoalPileComponent)tile).getTree(); + if(tree != null){ + ItemStack wood = tree.getGenome().getPrimary().getWoodProvider().getWoodStack(); + if(wood != null){ + Block block = Block.getBlockFromItem(wood.getItem()); + return block.getFireSpreadSpeed(world, pos, face); + } + } + } + } + return super.getFireSpreadSpeed(world, pos, face); + + } + @Override public float getBlockHardness(IBlockState blockState, World world, BlockPos pos) { if(getPileType() == EnumPileType.WOOD){