Skip to content

Commit

Permalink
Add back the randomly aging (non 0 meta) fires.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchej123 committed Sep 10, 2023
1 parent acbc864 commit 1347804
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ public void updateTick(World world, int x, int y, int z, Random rand) {
world.setBlock(xT, yT, zT, targetTransform, 0, 3);
}
}
if (blockMeta >= 15) {

if (blockMeta < 15 && blockMeta > 0) {
// Randomly increase the age of a fire
// 0 meta is considered a source and never increases, for any other meta we have a chance to increase
final int newMeta = Math.min(blockMeta + rand.nextInt(3) / 2, 15);
if (newMeta > blockMeta) {
world.setBlockMetadataWithNotify(x, y, z, newMeta, 4);
}
} else if (blockMeta >= 15) {
// No spreading if we're at max meta
return;
}
Expand Down

0 comments on commit 1347804

Please sign in to comment.