Add data pack dimension support for Forge 1.16.5 and 1.17.1

This commit is contained in:
Mike Primm 2021-11-15 20:51:35 -06:00
parent 0d85d2efb5
commit ca76a59761
2 changed files with 18 additions and 13 deletions

View file

@ -38,15 +38,19 @@ public class ForgeWorld extends DynmapWorld
public static String getWorldName(ServerLevelAccessor w) {
ResourceKey<Level> rk = w.getLevel().dimension();
if (rk == Level.OVERWORLD) { // Overworld?
String id = rk.location().getNamespace() + "_" + rk.location().getPath();
if (id.equals("minecraft_overworld")) { // Overworld?
return w.getLevel().serverLevelData.getLevelName();
} else if (rk == Level.END) {
return "DIM1";
} else if (rk == Level.NETHER) {
return "DIM-1";
} else {
return rk.getRegistryName() + "_" + rk.location();
}
}
else if (id.equals("minecraft_the_end")) {
return "DIM1";
}
else if (id.equals("minecraft_the_nether")) {
return "DIM-1";
}
else {
return id;
}
}
public void updateWorld(ServerLevelAccessor w) {