mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 04:52:26 +00:00
Fix #1236 Normal logs are not flammable(in world) and add flammability to the wood pile
This commit is contained in:
1 parent
0405151a8e
commit
2c173766cb
2 files changed
+40
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in new issue
Block a user