TCheckpoint

This commit is contained in:
Gokalp Sen 2025-06-21 23:52:38 +03:00
parent 26daa1e830
commit 9bc57fdcb4
52 changed files with 563 additions and 111 deletions

View file

@ -0,0 +1,25 @@
package org.gsdistance.grimmsServer.Indexers;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.gsdistance.grimmsServer.Constructable.WorldConstructor;
public class DynamicDimensionGen {
public static World newDimension(WorldConstructor worldConstructor) {
if(Bukkit.getWorld(worldConstructor.name) != null) {
return Bukkit.getWorld(worldConstructor.name);
} else {
// Create a new world with the specified name and type
WorldCreator worldCreator = new WorldCreator(worldConstructor.name);
try {
worldCreator.environment(World.Environment.valueOf(worldConstructor.type));
}catch (EnumConstantNotPresentException e){
// If the environment type is not recognized, default to NORMAL
worldCreator.environment(World.Environment.NORMAL);
}
worldCreator.generateStructures(worldConstructor.generateStructures);
return worldCreator.createWorld();
}
}
}