Skip to content

Commit e4ec7f7

Browse files
committed
Fix dimension name formatting
1 parent f8ce9d4 commit e4ec7f7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/in/techpro424/itemblacklist/util/Formatting.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ public static String formatArrayList(ArrayList<String> arrayList) {
1212
}
1313

1414
public static String formatDimension(String dimensionName) {
15-
String[] array = dimensionName.split("minecraft:");
16-
String dimensionName2 = array[1];
17-
if(!dimensionName2.contains("the_")) return dimensionName2;
18-
String[] array2 = dimensionName2.split("the_");
19-
return array2[1];
15+
return switch (dimensionName) {
16+
case "minecraft:overworld" -> "overworld";
17+
case "minecraft:the_nether" -> "nether";
18+
case "minecraft:the_end" -> "end";
19+
default -> "global";
20+
};
2021
}
2122
}

0 commit comments

Comments
 (0)