Skip to content

Commit 486363e

Browse files
Merge pull request #524 from ItzKatze/master
fix: serverTypes being used wrong
2 parents b4bdf84 + d8f409d commit 486363e

14 files changed

Lines changed: 39 additions & 24 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ build/
4141

4242
### Mac OS ###
4343
.DS_Store
44+
45+
### Islands ###
4446
/configuration/hypixel_island_template/
4547
/configuration/hypixel_hub/
48+
/configuration/hypixel_prototype_lobby/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ A video of me going through the guide [can be found here](https://www.youtube.co
4949
3. Download `resources.json` from [here](https://github.com/Swofty-Developments/HypixelSkyBlock/tree/master/configuration)
5050
4. Move this file into the `configuration` folder you just made.
5151
5. Download the [world files for the SkyBlock Hub, Prototype Lobby, and Island worlds.](https://www.mediafire.com/file/xxnxgkqejlh17fn/HypixelRecreationWorlds.zip/file)
52-
6. Get the Hypixel SkyBlock hub from the above download and put it in the configuration folder you made under the name `hypixel_hub`, and the Prototype Lobby under `hypixel_prototype_lobby`.
52+
6. Get the Hypixel SkyBlock hub from the above download and put it in the configuration folder you made under the name `hypixel_skyblock_hub`, and the Prototype Lobby under `hypixel_prototype_lobby`.
5353
7. Get the Hypixel Island default template from the above download and put it in the configuration folder you made under the name `hypixel_island_template`.
5454
8. Get the item and collection folders from [here](https://github.com/Swofty-Developments/HypixelSkyBlock/tree/master/configuration) and put them into your configuration folder.
5555
9. There should be a `forwarding.secret` file where your Velocity JAR is, take this and put it into your `resources.json` under `velocity-secret`.

commons/src/main/java/net/swofty/commons/ServerType.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
public enum ServerType {
77
SKYBLOCK_ISLAND(true),
88
SKYBLOCK_HUB(true),
9-
DUNGEON_HUB(true),
10-
THE_FARMING_ISLANDS(true),
9+
SKYBLOCK_DUNGEON_HUB(true),
10+
SKYBLOCK_THE_FARMING_ISLANDS(true),
1111
PROTOTYPE_LOBBY(false),
1212
BEDWARS_LOBBY(false),
1313
BEDWARS_GAME(false),
@@ -29,4 +29,16 @@ public static boolean isServerType(String type) {
2929
public String formatName() {
3030
return StringUtility.toNormalCase(name());
3131
}
32+
33+
public static ServerType getSkyblockServer(String name) {
34+
if (!name.startsWith("SKYBLOCK_")) {
35+
return valueOf("SKYBLOCK_" + name.toUpperCase());
36+
} else {
37+
return valueOf(name);
38+
}
39+
}
40+
41+
public String skyblockName() {
42+
return name().replace("SKYBLOCK_", "");
43+
}
3244
}

type.dungeonhub/src/main/java/net/swofty/type/dungeonhub/TypeDungeonHubLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class TypeDungeonHubLoader implements SkyBlockTypeLoader {
3030

3131
@Override
3232
public ServerType getType() {
33-
return ServerType.DUNGEON_HUB;
33+
return ServerType.SKYBLOCK_DUNGEON_HUB;
3434
}
3535

3636
@Override

type.hub/src/main/java/net/swofty/type/hub/TypeHubLoader.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public void onInitialize(MinecraftServer server) {
4848

4949
@Override
5050
public void afterInitialize(MinecraftServer server) {
51-
RuneEntityImpl firstStone = new RuneEntityImpl(new Pos(-37.2, 68.40, -129.15, 0, 0f), false);
52-
RuneEntityImpl secondStone = new RuneEntityImpl(new Pos( -37.82, 68.40, -129.15, 0, 0f), false);
53-
RuneEntityImpl thirdStone = new RuneEntityImpl(new Pos(-37.2, 68.40, -129.775, 0, 0f), false);
54-
RuneEntityImpl fourthStone = new RuneEntityImpl(new Pos(-37.82, 68.40, -129.775, 0, 0f), false);
55-
RuneEntityImpl head = new RuneEntityImpl(new Pos(-37.5, 69.20, -129.4, -70, 0f), true);
56-
Pos runePos = new Pos(-37.5, 70, -129.5, 0, 0f);
51+
RuneEntityImpl firstStone = new RuneEntityImpl(new Pos(-37.84375, 68.3125, -129.8125, 0, 0f), false);
52+
RuneEntityImpl secondStone = new RuneEntityImpl(new Pos( -37.21875, 68.3125, -129.8125, 0, 0f), false);
53+
RuneEntityImpl thirdStone = new RuneEntityImpl(new Pos(-37.21875, 68.3125, -129.1875, 0, 0f), false);
54+
RuneEntityImpl fourthStone = new RuneEntityImpl(new Pos(-37.84375, 68.3125, -129.1875, 0, 0f), false);
55+
RuneEntityImpl head = new RuneEntityImpl(new Pos(-37.65625, 69.09375, -129.34375, 45, 0f), true);
56+
Pos runePos = new Pos(-37.84375, 68.3125, -129.8125, 0, 0f);
5757

5858
AtomicReference<Double> i = new AtomicReference<>(0D);
5959
MinecraftServer.getSchedulerManager().scheduleTask(() -> {
@@ -102,8 +102,8 @@ public void afterInitialize(MinecraftServer server) {
102102
public LoaderValues getLoaderValues() {
103103
return new LoaderValues(
104104
(type) -> switch (type) {
105-
case THE_FARMING_ISLANDS -> new Pos(74, 72, -180, 35, 0);
106-
case DUNGEON_HUB -> new Pos(-44, 88, 11.5, 0, 0);
105+
case SKYBLOCK_THE_FARMING_ISLANDS -> new Pos(74, 72, -180, 35, 0);
106+
case SKYBLOCK_DUNGEON_HUB -> new Pos(-44, 88, 11.5, 0, 0);
107107
default -> new Pos(-2.5, 72.5, -69.5, 180, 0);
108108
}, // Spawn position
109109
true // Announce death messages

type.hub/src/main/java/net/swofty/type/hub/runes/RuneEntityImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public RuneEntityImpl(Pos position, boolean isHead) {
2929
((ArmorStandMeta) this.entityMeta).setHeadRotation(new Vec( -90, 0.4, 0));
3030
setHelmet(ItemStackCreator.getStackHead("5c540298a017b25f9cfae9281fe5b585d770db1852b73804d1bb7c7ee53733a4").build());
3131
} else {
32-
setHelmet(ItemStack.builder(Material.STONE_SLAB).build());
32+
setHelmet(ItemStack.builder(Material.SMOOTH_STONE_SLAB).build());
3333
}
3434

3535
setInstance(HypixelConst.getInstanceContainer(), position);

type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCSkyBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public String[] holograms(HypixelPlayer player) {
3333
return server.players().size();
3434
}).reduce(0, Integer::sum);
3535

36-
String commmaified = StringUtility.commaify(amountOnline);
36+
String commaified = StringUtility.commaify(amountOnline);
3737
return new String[]{
38-
"§e" + commmaified + " Playing",
38+
"§e" + commaified + " Playing",
3939
"§bSkyBlock §7[v0.23.3]",
4040
"§e§lCLICK"
4141
};

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/SkyBlockGenericLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public void initialize(MinecraftServer server) {
329329
*/
330330
if (mainInstance != null) {
331331
ServerHolograms.spawnAll(HypixelConst.getInstanceContainer());
332-
String zone = typeLoader.getType().toString();
332+
String zone = typeLoader.getType().skyblockName();
333333
FairySoul.spawnEntities(HypixelConst.getInstanceContainer(), FairySoulZone.valueOf(zone.toUpperCase()));
334334
}
335335

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/data/monogdb/CrystalDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static List<CrystalData> getAllCrystals() {
103103
crystal.url = url;
104104
crystal.position = new Pos(x + 0.5, y, z + 0.5);
105105
crystal.itemType = itemTypeLinker;
106-
crystal.serverType = ServerType.valueOf(doc.getString("serverType"));
106+
crystal.serverType = ServerType.getSkyblockServer(doc.getString("serverType"));
107107

108108
crystals.add(crystal);
109109
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/data/monogdb/RegionDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static List<SkyBlockRegion> getAllRegions() {
9797
int x2 = doc.getInteger("x2");
9898
int y2 = doc.getInteger("y2");
9999
int z2 = doc.getInteger("z2");
100-
ServerType serverType = ServerType.valueOf(doc.getOrDefault("serverType", ServerType.SKYBLOCK_HUB.name()).toString());
100+
ServerType serverType = ServerType.getSkyblockServer(doc.getOrDefault("serverType", ServerType.SKYBLOCK_HUB.name()).toString());
101101
SkyBlockRegion region = new SkyBlockRegion(
102102
name,
103103
new Pos(x1, y1, z1),

0 commit comments

Comments
 (0)