From 3376baa3c581f4f9107af9529035d7ef96f5112c Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 22 Sep 2021 15:04:12 +0100 Subject: [PATCH] Remove needless EditSession#getWorld for setting blocks/biomes in a couple of cases #32 IntellectualSites/FastAsyncWorldEdit-Adapters#7 --- .../sk89q/worldedit/function/generator/ForestGenerator.java | 2 +- .../sk89q/worldedit/regions/shape/ArbitraryBiomeShape.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index 2c4bfadca..a042fd16c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -60,7 +60,7 @@ public class ForestGenerator implements RegionFunction { // we trick editsession history here in the first call editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); // and then trick the generator here by directly setting into the world - editSession.getWorld().setBlock(position, BlockTypes.AIR.getDefaultState()); + editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); // so that now the generator can generate the tree boolean success = treeType.generate(editSession, position); if (!success) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryBiomeShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryBiomeShape.java index 2bea6ca97..9f2ef87b0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryBiomeShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryBiomeShape.java @@ -135,7 +135,7 @@ public abstract class ArbitraryBiomeShape { if (!hollow) { final BiomeType material = getBiome(x, y, z, baseBiome); if (material != null) { - editSession.getWorld().setBiome(position, material); + editSession.setBiome(position, material); ++affected; } @@ -151,7 +151,7 @@ public abstract class ArbitraryBiomeShape { continue; } - editSession.getWorld().setBiome(position, material); + editSession.setBiome(position, material); ++affected; }