Fix Item leveling

This commit is contained in:
Gokalp Sen 2025-06-22 15:10:52 +03:00
parent 9bc57fdcb4
commit fb3dce512a
34 changed files with 219 additions and 96 deletions

View file

@ -4,17 +4,18 @@ import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.gsdistance.grimmsServer.Constructable.WorldConstructor;
import org.gsdistance.grimmsServer.GrimmsServer;
public class DynamicDimensionGen {
public static World newDimension(WorldConstructor worldConstructor) {
if(Bukkit.getWorld(worldConstructor.name) != null) {
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){
} catch (EnumConstantNotPresentException e) {
// If the environment type is not recognized, default to NORMAL
worldCreator.environment(World.Environment.NORMAL);
}
@ -22,4 +23,18 @@ public class DynamicDimensionGen {
return worldCreator.createWorld();
}
}
public static void loadWorlds() {
GrimmsServer.logger.info("Loading worlds from worldConstructors...");
WorldConstructor[] worldConstructors = WorldConstructor.getAllWorldConstructors();
if (worldConstructors == null || worldConstructors.length == 0) {
GrimmsServer.logger.warning("No world constructors found to load.");
return;
}
for (WorldConstructor worldConstructor : worldConstructors) {
if (Bukkit.getWorld(worldConstructor.name) == null) {
newDimension(worldConstructor);
}
}
}
}

View file

@ -1,5 +0,0 @@
package org.gsdistance.grimmsServer.Indexers;
public class RecipeIndexer {
}