From 97a4d2e10380ce2338da73fac9e1ef4d8a1b439b Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 23 Nov 2019 04:45:43 +0000 Subject: [PATCH] Fixed regen --- .../main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 2 +- .../sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java | 2 +- .../worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_14_R4.java | 2 +- .../src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java | 2 +- .../java/com/sk89q/worldedit/command/HistorySubCommands.java | 2 +- .../java/com/sk89q/worldedit/command/RegionCommands.java | 5 +++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index a12965769..63291192d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -192,7 +192,7 @@ public class BukkitWorld extends AbstractWorld { public boolean regenerate(Region region, EditSession editSession) { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); if (adapter != null) { - return adapter.regenerate(this, region, editSession); + return adapter.regenerate(getWorld(), region, editSession); } /* BaseBlock[] history = new BaseBlock[16 * 16 * (getMaxY() + 1)]; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 3fe0a73d5..6cd25cf8b 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -235,7 +235,7 @@ public interface BukkitImplAdapter extends IBukkitAdapter { throw new UnsupportedOperationException("Cannot send fake chunks"); } - default boolean regenerate(com.sk89q.worldedit.world.World world, Region region, EditSession editSession) { + default boolean regenerate(org.bukkit.World world, Region region, EditSession editSession) { return editSession.regenerate(region); } } \ No newline at end of file diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_14_R4.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_14_R4.java index efa094056..396fdf825 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_14_R4.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_14_R4.java @@ -378,7 +378,7 @@ public final class FAWE_Spigot_v1_14_R4 extends CachedBukkitAdapter implements I } @Override - public boolean regenerate(com.sk89q.worldedit.world.World world, Region region, EditSession editSession) { + public boolean regenerate(org.bukkit.World world, Region region, EditSession editSession) { WorldServer originalWorld = ((CraftWorld) world).getHandle(); ChunkProviderServer provider = originalWorld.getChunkProvider(); if (!(provider instanceof ChunkProviderServer)) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java b/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java index 4ebfde40a..5f88b283f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java @@ -223,7 +223,7 @@ public class WorldWrapper extends AbstractWorld { @Override public boolean regenerate(Region region, EditSession session) { - return session.regenerate(region); + return parent.regenerate(region, session); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java index 47e6345cf..822e20528 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java @@ -330,7 +330,7 @@ public class HistorySubCommands { RollbackOptimizedHistory edit = input.get(); UUID uuid = edit.getUUID(); int index = edit.getIndex(); - if (!edit.getBDFile().exists()) { + if (!edit.isEmpty()) { database.delete(uuid, index); return TextComponent.empty(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index c757b8b3d..d84b91dc4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -656,13 +656,14 @@ public class RegionCommands { @CommandPermissions("worldedit.regen") @Logging(REGION) @Confirm(Confirm.Processor.REGION) - public void regenerateChunk(Actor actor, LocalSession session, EditSession editSession, @Selection Region region, + public void regenerateChunk(Actor actor, World world, LocalSession session, EditSession editSession, @Selection Region region, @Arg(def = "", desc = "Regenerate with biome") BiomeType biome, @Arg(def = "", desc = "Regenerate with seed") Long seed) throws WorldEditException { Mask mask = session.getMask(); session.setMask((Mask) null); session.setSourceMask((Mask) null); - editSession.regenerate(region, biome, seed); + world.regenerate(region, editSession); +// editSession.regenerate(region, biome, seed); session.setMask(mask); session.setSourceMask(mask); actor.printInfo(TranslatableComponent.of("worldedit.regen.regenerated"));