1.7.0 beta 7

This commit is contained in:
Tyler Murphy 2022-11-21 15:04:10 -05:00
parent 1815b63bc9
commit efb2cf40e8

View file

@ -1,6 +1,7 @@
package net.tylermurphy.hideAndSeek.util; package net.tylermurphy.hideAndSeek.util;
import net.tylermurphy.hideAndSeek.Main; import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.world.VoidGenerator;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.WorldCreator; import org.bukkit.WorldCreator;
@ -51,13 +52,17 @@ public class Location {
} }
public World load(WorldType type) { public World load(WorldType type) {
boolean mapSave = world.startsWith("hs_");
World bukkitWorld = Bukkit.getWorld(world); World bukkitWorld = Bukkit.getWorld(world);
if(bukkitWorld != null) return bukkitWorld; if(bukkitWorld != null) return bukkitWorld;
if (type == null) { WorldCreator creator = new WorldCreator(world);
Bukkit.getServer().createWorld(new WorldCreator(world)); if(type != null) {
} else { creator.type(type);
Bukkit.getServer().createWorld(new WorldCreator(world).type(type));
} }
if(mapSave) {
creator.generator(new VoidGenerator());
}
Bukkit.getServer().createWorld(creator).setAutoSave(!mapSave);
return Bukkit.getWorld(world); return Bukkit.getWorld(world);
} }