From 9830c643f2a67ec4802cae9e4229ece56eb18607 Mon Sep 17 00:00:00 2001 From: danielb Date: Sun, 26 May 2024 22:29:47 +0000 Subject: [PATCH] world creation plan in comments --- .../WorldSystem/data/WorldData.java | 20 ++++++++++++++++ .../WorldSystem/worldgen/WorldTemplate.java | 23 ++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/main/java/de/butzlabben/WorldSystem/data/WorldData.java diff --git a/src/main/java/de/butzlabben/WorldSystem/data/WorldData.java b/src/main/java/de/butzlabben/WorldSystem/data/WorldData.java new file mode 100644 index 0000000..2fb27b9 --- /dev/null +++ b/src/main/java/de/butzlabben/WorldSystem/data/WorldData.java @@ -0,0 +1,20 @@ +package de.butzlabben.WorldSystem.data; + +import lombok.SneakyThrows; + +public class WorldData { + private static WorldData con; + private static SqlLiteDatabase core; + + private WorldData() { + WorldData.core = SqlLiteDatabase.connect(); + } + + @SneakyThrows + public static WorldData connect() { + if (con == null) { + con = new WorldData(); + } + return con; + } +} diff --git a/src/main/java/de/butzlabben/WorldSystem/worldgen/WorldTemplate.java b/src/main/java/de/butzlabben/WorldSystem/worldgen/WorldTemplate.java index 7ac63b1..c0f142c 100644 --- a/src/main/java/de/butzlabben/WorldSystem/worldgen/WorldTemplate.java +++ b/src/main/java/de/butzlabben/WorldSystem/worldgen/WorldTemplate.java @@ -32,7 +32,27 @@ public class WorldTemplate { int id = data.getHighestID() + 1; String worldname = "ID" + id + "-" + uuid; + //create an event to different hooks + //create a new database entry for the world + + + //setup the world folder + + + //create a new database entry for the worlds data + + + //load the world for bukkit + + //lock the world world as createing + + + //establish a async task for world generation. + + + +/* WorldCreateEvent event = new WorldCreateEvent(uniqueID, creator); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) @@ -110,6 +130,7 @@ public class WorldTemplate { }.runTaskLater(WorldSystem.getInstance(), 1); return true; - + */ + return false; } }