Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build/


### Worlds / Maps ###
/configuration/world/
/configuration/skyblock/islands/
/configuration/hypixel_prototype_lobby/
/configuration/hypixel_bedwars_lobby/
Expand All @@ -60,5 +61,3 @@ build/
/server/forwarding.secret
/configuration/config.yml
/server/proxy/configuration/config.yml

### Resource pack build output ###
10 changes: 4 additions & 6 deletions commons/src/main/java/net/swofty/commons/CustomWorlds.java
Original file line number Diff line number Diff line change
@@ -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"),
Expand All @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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<UUID, SkyBlockIsland> loadedIslands = new HashMap<>();

// Internal Island Data
Expand Down Expand Up @@ -100,7 +103,7 @@ public CompletableFuture<SharedInstance> 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);
Expand All @@ -118,7 +121,7 @@ public CompletableFuture<SharedInstance> 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);
}
Expand Down
42 changes: 21 additions & 21 deletions website/docs/reference/server-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
13 changes: 5 additions & 8 deletions website/docs/setup/game-servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ gameserver/
├── configuration/
│ ├── config.yml
│ ├── skyblock/
│ │ ├── islands/
│ │ │ ├── hypixel_skyblock_hub/
│ │ │ ├── hypixel_skyblock_island_template/
│ │ │ └── ... (other islands)
│ │ ├── collections/
│ │ ├── items/
│ │ ├── levels/
Expand All @@ -30,17 +26,18 @@ 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

### 1. Create Directory Structure

```bash
mkdir -p gameserver/configuration/skyblock/islands
mkdir -p gameserver/configuration/world
```

### 2. Configure config.yml
Expand Down
Loading