From efb2cf40e82e1b00d3d97e6986d8aed83d8a26dc Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 21 Nov 2022 15:04:10 -0500 Subject: [PATCH] 1.7.0 beta 7 --- .../net/tylermurphy/hideAndSeek/util/Location.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java b/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java index efc4329..b75eb95 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java @@ -1,6 +1,7 @@ package net.tylermurphy.hideAndSeek.util; import net.tylermurphy.hideAndSeek.Main; +import net.tylermurphy.hideAndSeek.world.VoidGenerator; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.WorldCreator; @@ -51,13 +52,17 @@ public class Location { } public World load(WorldType type) { + boolean mapSave = world.startsWith("hs_"); World bukkitWorld = Bukkit.getWorld(world); if(bukkitWorld != null) return bukkitWorld; - if (type == null) { - Bukkit.getServer().createWorld(new WorldCreator(world)); - } else { - Bukkit.getServer().createWorld(new WorldCreator(world).type(type)); + WorldCreator creator = new WorldCreator(world); + if(type != null) { + creator.type(type); } + if(mapSave) { + creator.generator(new VoidGenerator()); + } + Bukkit.getServer().createWorld(creator).setAutoSave(!mapSave); return Bukkit.getWorld(world); }