From 1a13afb6e34873e2749772c09a9141a7ffe4d2f5 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Tue, 1 Oct 2019 23:06:47 +0100 Subject: [PATCH] Don't pass null into leaf update tick, fixes #186 and #269 --- .../wizardry/worldgen/WorldGenSurfaceStructure.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/electroblob/wizardry/worldgen/WorldGenSurfaceStructure.java b/src/main/java/electroblob/wizardry/worldgen/WorldGenSurfaceStructure.java index c55ba7c4..464c023c 100644 --- a/src/main/java/electroblob/wizardry/worldgen/WorldGenSurfaceStructure.java +++ b/src/main/java/electroblob/wizardry/worldgen/WorldGenSurfaceStructure.java @@ -244,7 +244,7 @@ public abstract class WorldGenSurfaceStructure implements IWorldGenerator { spawnStructure(random, world, origin, template, settings, structureFile); - if(!Wizardry.settings.fastWorldgen) removeFloatingTrees(world, box); + if(!Wizardry.settings.fastWorldgen) removeFloatingTrees(world, box, random); structureMap.put(ChunkPos.asLong(origin.getX() >> 4, origin.getZ() >> 4), settings.getBoundingBox()); @@ -306,7 +306,7 @@ public abstract class WorldGenSurfaceStructure implements IWorldGenerator { } /** Finds and removes any floating bits of tree in and above the given structure bounding box. */ - protected static void removeFloatingTrees(World world, StructureBoundingBox boundingBox){ + protected static void removeFloatingTrees(World world, StructureBoundingBox boundingBox, Random random){ boolean changed = true; int y = boundingBox.minY; @@ -354,7 +354,7 @@ public abstract class WorldGenSurfaceStructure implements IWorldGenerator { } for(int i=0; i<16; i++){ - leaves.forEach(p -> world.getBlockState(p).getBlock().updateTick(world, p, world.getBlockState(p), null)); + leaves.forEach(p -> world.getBlockState(p).getBlock().updateTick(world, p, world.getBlockState(p), random)); } // Finally, remove all the items that were dropped as a result of leaf decay