Skip to content

Commit

Permalink
Fixed #334
Browse files Browse the repository at this point in the history
  • Loading branch information
DisasterMoo committed Aug 25, 2019
1 parent 44ea5cf commit 1ceae66
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/main/java/net/dries007/tfc/objects/te/TEPitKiln.java
Expand Up @@ -276,12 +276,12 @@ public int getStrawCount()

public boolean tryLight()
{
if (hasFuel() && isValid())
if (hasFuel() && isValid() && !isLit())
{
BlockPos above = pos.add(0, 1, 0);
BlockPos above = pos.up();
if (Blocks.FIRE.canPlaceBlockAt(world, above))
{
for (EnumFacing facing : EnumFacing.Plane.HORIZONTAL)
for (EnumFacing facing : EnumFacing.HORIZONTALS)
{
if (!world.isSideSolid(pos.offset(facing), facing.getOpposite()))
{
Expand All @@ -291,6 +291,22 @@ public boolean tryLight()
burnTicksToGo = ConfigTFC.GENERAL.pitKilnTime;
updateBlock();
world.setBlockState(above, Blocks.FIRE.getDefaultState());
//Light other adjacent pit kilns
for (EnumFacing solidBlock : EnumFacing.HORIZONTALS)
{
for (EnumFacing pitBlock : EnumFacing.HORIZONTALS)
{
BlockPos pitPos = pos.offset(solidBlock).offset(pitBlock);
if (!pitPos.equals(pos))
{
TEPitKiln pitKiln = Helpers.getTE(world, pitPos, TEPitKiln.class);
if (pitKiln != null)
{
pitKiln.tryLight();
}
}
}
}
return true;
}
}
Expand Down

0 comments on commit 1ceae66

Please sign in to comment.