diff --git a/.gitignore b/.gitignore index 4f384a057..80b89d99f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ build/ ### Worlds / Maps ### +/configuration/world/ /configuration/skyblock/islands/ /configuration/hypixel_prototype_lobby/ /configuration/hypixel_bedwars_lobby/ @@ -60,5 +61,3 @@ build/ /server/forwarding.secret /configuration/config.yml /server/proxy/configuration/config.yml - -### Resource pack build output ### \ No newline at end of file diff --git a/DockerFiles/Dockerfile.game_server b/DockerFiles/Dockerfile.game_server index 331bdf94b..25cc89395 100644 --- a/DockerFiles/Dockerfile.game_server +++ b/DockerFiles/Dockerfile.game_server @@ -22,10 +22,6 @@ COPY ./configuration /app/configuration_files RUN mkdir -p configuration && \ cp configuration_files/config.yml ./configuration/config.yml -RUN curl -fSL -o /tmp/worlds.tar.gz "https://files.catbox.moe/9uas8z.gz" && \ - tar -xzf /tmp/worlds.tar.gz -C ./configuration && \ - rm /tmp/worlds.tar.gz - EXPOSE 25565 65535 8080 20000 RUN cp configuration_files/server.toml ./server.toml && \ diff --git a/commons/src/main/java/net/swofty/commons/CustomWorlds.java b/commons/src/main/java/net/swofty/commons/CustomWorlds.java index 4b65de832..9bc2afd8d 100644 --- a/commons/src/main/java/net/swofty/commons/CustomWorlds.java +++ b/commons/src/main/java/net/swofty/commons/CustomWorlds.java @@ -1,5 +1,7 @@ package net.swofty.commons; +import java.nio.file.Path; + public enum CustomWorlds { SKYBLOCK_ISLAND_TEMPLATE("hypixel_skyblock_island_template"), SKYBLOCK_HUB("hypixel_skyblock_hub"), @@ -26,11 +28,7 @@ public enum CustomWorlds { this.folderName = folderName; } - public String getFolderName() { - if (name().startsWith("SKYBLOCK_")) { - return "./configuration/skyblock/islands/" + folderName; - } else { - return "./configuration/" + folderName; - } + public Path getPath() { + return Path.of("./configuration/world/" + folderName + ".polar"); } } diff --git a/setup/lib/setup.sh b/setup/lib/setup.sh index 6b590fa41..ee7c116c3 100644 --- a/setup/lib/setup.sh +++ b/setup/lib/setup.sh @@ -156,9 +156,6 @@ ${jar_downloads} COPY ./configuration /app/configuration_files RUN mkdir -p configuration && \\ cp configuration_files/config.yml ./configuration/config.yml -RUN curl -fSL -o /tmp/worlds.tar.gz "${worlds_url}" && \\ - tar -xzf /tmp/worlds.tar.gz -C ./configuration && \\ - rm /tmp/worlds.tar.gz EXPOSE 25565 65535 8080 20000 RUN cp configuration_files/server.toml ./server.toml && \\ cp -a configuration_files/skyblock/. configuration/skyblock/ && \\ diff --git a/type.generic/src/main/java/net/swofty/type/generic/HypixelGenericLoader.java b/type.generic/src/main/java/net/swofty/type/generic/HypixelGenericLoader.java index 459f89d79..31a7ee6b3 100644 --- a/type.generic/src/main/java/net/swofty/type/generic/HypixelGenericLoader.java +++ b/type.generic/src/main/java/net/swofty/type/generic/HypixelGenericLoader.java @@ -6,13 +6,13 @@ import com.mongodb.client.MongoClients; import lombok.Getter; import lombok.SneakyThrows; +import net.hollowcube.polar.PolarLoader; import net.kyori.adventure.text.Component; import net.minestom.server.MinecraftServer; import net.minestom.server.adventure.audience.Audiences; import net.minestom.server.event.server.ServerTickMonitorEvent; import net.minestom.server.instance.InstanceContainer; import net.minestom.server.instance.InstanceManager; -import net.minestom.server.instance.anvil.AnvilLoader; import net.minestom.server.instance.block.Block; import net.minestom.server.monitoring.BenchmarkManager; import net.minestom.server.monitoring.TickMonitor; @@ -85,7 +85,7 @@ public void initialize(MinecraftServer server) { } else { temporaryInstance = instanceManager.createInstanceContainer(); } - temporaryInstance.setChunkLoader(new AnvilLoader(loader.getMainInstance().getFolderName())); + temporaryInstance.setChunkLoader(new PolarLoader(loader.getMainInstance().getPath())); HypixelConst.setInstanceContainer(instanceManager.createSharedInstance(temporaryInstance)); } diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockIsland.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockIsland.java index b952fbf5b..4ae326c89 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockIsland.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockIsland.java @@ -2,7 +2,10 @@ import lombok.Getter; import lombok.Setter; -import net.hollowcube.polar.*; +import net.hollowcube.polar.PolarLoader; +import net.hollowcube.polar.PolarReader; +import net.hollowcube.polar.PolarWorld; +import net.hollowcube.polar.PolarWriter; import net.kyori.adventure.key.Key; import net.minestom.server.MinecraftServer; import net.minestom.server.instance.InstanceContainer; @@ -15,17 +18,17 @@ import net.minestom.server.world.DimensionType; import net.swofty.commons.CustomWorlds; import net.swofty.type.generic.HypixelConst; +import net.swofty.type.generic.event.HypixelEventHandler; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.utility.MathUtility; import net.swofty.type.skyblockgeneric.SkyBlockGenericLoader; import net.swofty.type.skyblockgeneric.data.monogdb.CoopDatabase; import net.swofty.type.skyblockgeneric.data.monogdb.IslandDatabase; -import net.swofty.type.generic.event.HypixelEventHandler; import net.swofty.type.skyblockgeneric.event.custom.IslandFetchedFromDatabaseEvent; import net.swofty.type.skyblockgeneric.event.custom.IslandFirstCreatedEvent; import net.swofty.type.skyblockgeneric.event.custom.IslandSavedIntoDatabaseEvent; import net.swofty.type.skyblockgeneric.minion.IslandMinionData; import net.swofty.type.skyblockgeneric.utility.JerryInformation; -import net.swofty.type.generic.utility.MathUtility; import org.bson.types.Binary; import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; @@ -40,7 +43,7 @@ @Getter public class SkyBlockIsland { - private static final String ISLAND_TEMPLATE_NAME = CustomWorlds.SKYBLOCK_ISLAND_TEMPLATE.getFolderName(); + private static final Path ISLAND_TEMPLATE_PATH = CustomWorlds.SKYBLOCK_ISLAND_TEMPLATE.getPath(); private static final Map loadedIslands = new HashMap<>(); // Internal Island Data @@ -100,7 +103,7 @@ public CompletableFuture getSharedInstance() { if (!database.exists()) { islandVersion = HypixelConst.getCurrentIslandVersion(); try { - world = AnvilPolar.anvilToPolar(Path.of(ISLAND_TEMPLATE_NAME), ChunkSelector.radius(3)); + world = new PolarLoader(ISLAND_TEMPLATE_PATH).world(); } catch (IOException e) { Logger.error("Failed to create island world", e); throw new RuntimeException("Failed to create island world", e); @@ -118,7 +121,7 @@ public CompletableFuture getSharedInstance() { case 0: lastSaved = System.currentTimeMillis(); try { - world = AnvilPolar.anvilToPolar(Path.of(ISLAND_TEMPLATE_NAME), ChunkSelector.radius(3)); + world = new PolarLoader(ISLAND_TEMPLATE_PATH).world(); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/website/docs/reference/server-types.md b/website/docs/reference/server-types.md index 46e35e389..d029e6ea2 100644 --- a/website/docs/reference/server-types.md +++ b/website/docs/reference/server-types.md @@ -6,22 +6,22 @@ ServerTypes define the different game modes and locations that can be run as sep These server types are part of the SkyBlock gamemode and share SkyBlock-specific functionality. -| ServerType | Description | World Required | -|--------------------------------|------------------|------------------------------------| -| `SKYBLOCK_ISLAND` | Personal Island | `hypixel_skyblock_island_template` | -| `SKYBLOCK_HUB` | Hub | `hypixel_skyblock_hub` | -| `SKYBLOCK_SPIDERS_DEN` | Spider's Den | `hypixel_skyblock_spiders_den` | -| `SKYBLOCK_THE_END` | The End | `hypixel_skyblock_the_end` | -| `SKYBLOCK_CRIMSON_ISLE` | Crimson isle | `hypixel_skyblock_crimson_isle` | -| `SKYBLOCK_DUNGEON_HUB` | Dungeon hub | `hypixel_skyblock_dungeon_hub` | -| `SKYBLOCK_THE_FARMING_ISLANDS` | Farming Islands | `hypixel_skyblock_hub` | -| `SKYBLOCK_GOLD_MINE` | Gold Mine | `hypixel_skyblock_gold_mine` | -| `SKYBLOCK_DEEP_CAVERNS` | Deep Caverns | `hypixel_skyblock_deep_caverns` | -| `SKYBLOCK_DWARVEN_MINES` | Dwarven Mines | `hypixel_skyblock_dwarven_mines` | -| `SKYBLOCK_THE_PARK` | The Park | `hypixel_skyblock_the_park` | -| `SKYBLOCK_GALATEA` | Galatea | `hypixel_skyblock_galatea` | -| `SKYBLOCK_BACKWATER_BAYOU` | Backwater Bayou | `hypixel_skyblock_galatea` | -| `SKYBLOCK_JERRYS_WORKSHOP` | Jerry's Workshop | `hypixel_skyblock_jerrys_workshop` | +| ServerType | Description | World Required | +|--------------------------------|------------------|------------------------------------------| +| `SKYBLOCK_ISLAND` | Personal Island | `hypixel_skyblock_island_template.polar` | +| `SKYBLOCK_HUB` | Hub | `hypixel_skyblock_hub.polar` | +| `SKYBLOCK_SPIDERS_DEN` | Spider's Den | `hypixel_skyblock_spiders_den.polar` | +| `SKYBLOCK_THE_END` | The End | `hypixel_skyblock_the_end.polar` | +| `SKYBLOCK_CRIMSON_ISLE` | Crimson isle | `hypixel_skyblock_crimson_isle.polar` | +| `SKYBLOCK_DUNGEON_HUB` | Dungeon hub | `hypixel_skyblock_dungeon_hub.polar` | +| `SKYBLOCK_THE_FARMING_ISLANDS` | Farming Islands | `hypixel_skyblock_hub.polar` | +| `SKYBLOCK_GOLD_MINE` | Gold Mine | `hypixel_skyblock_gold_mine.polar` | +| `SKYBLOCK_DEEP_CAVERNS` | Deep Caverns | `hypixel_skyblock_deep_caverns.polar` | +| `SKYBLOCK_DWARVEN_MINES` | Dwarven Mines | `hypixel_skyblock_dwarven_mines.polar` | +| `SKYBLOCK_THE_PARK` | The Park | `hypixel_skyblock_the_park.polar` | +| `SKYBLOCK_GALATEA` | Galatea | `hypixel_skyblock_galatea.polar` | +| `SKYBLOCK_BACKWATER_BAYOU` | Backwater Bayou | `hypixel_skyblock_backwater_bayou.polar` | +| `SKYBLOCK_JERRYS_WORKSHOP` | Jerry's Workshop | `hypixel_skyblock_jerrys_workshop.polar` | ### Starting a SkyBlock Server ```bash @@ -110,11 +110,11 @@ The proxy will distribute players across all available instances. ### Required Worlds -| World | Location | Used By | -|------------------------------------|-----------------------------------|-----------------| -| `hypixel_skyblock_hub` | `configuration/skyblock/islands/` | SKYBLOCK_HUB | -| `hypixel_skyblock_island_template` | `configuration/skyblock/islands/` | SKYBLOCK_ISLAND | -| `hypixel_prototype_lobby` | `configuration/` | PROTOTYPE_LOBBY | +| World | Location | Used By | +|------------------------------------------|------------------------|-----------------| +| `hypixel_skyblock_hub.polar` | `configuration/world/` | SKYBLOCK_HUB | +| `hypixel_skyblock_island_template.polar` | `configuration/world/` | SKYBLOCK_ISLAND | +| `hypixel_prototype_lobby.polar` | `configuration/world/` | PROTOTYPE_LOBBY | ### Custom Worlds diff --git a/website/docs/setup/game-servers.md b/website/docs/setup/game-servers.md index ab811721e..fd316a077 100644 --- a/website/docs/setup/game-servers.md +++ b/website/docs/setup/game-servers.md @@ -17,10 +17,6 @@ gameserver/ ├── configuration/ │ ├── config.yml │ ├── skyblock/ -│ │ ├── islands/ -│ │ │ ├── hypixel_skyblock_hub/ -│ │ │ ├── hypixel_skyblock_island_template/ -│ │ │ └── ... (other islands) │ │ ├── collections/ │ │ ├── items/ │ │ ├── levels/ @@ -30,9 +26,10 @@ gameserver/ │ │ └── songs/ # Optional │ ├── bedwars/ # BedWars maps (.polar) │ ├── murdermystery/ # Murder Mystery maps (.polar) -│ ├── hypixel_prototype_lobby/ -│ ├── hypixel_bedwars_lobby/ -│ └── hypixel_murder_mystery_lobby/ +│ ├── world/ +│ │ ├── hypixel_bedwars_lobby.polar +│ │ ├── hypixel_murder_mystery_lobby.polar +│ │ └── ... (other worlds) ``` ## Setup Steps @@ -40,7 +37,7 @@ gameserver/ ### 1. Create Directory Structure ```bash -mkdir -p gameserver/configuration/skyblock/islands +mkdir -p gameserver/configuration/world ``` ### 2. Configure config.yml