File tree Expand file tree Collapse file tree 16 files changed +105
-0
lines changed
fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric
fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric
fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric
fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric
fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric
fabric-1.19/src/main/java/de/bluecolored/bluemap/fabric
forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge
forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge
forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge
forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge
forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge
forge-1.19.1/src/main/java/de/bluecolored/bluemap/forge
forge-1.19/src/main/java/de/bluecolored/bluemap/forge
spigot/src/main/java/de/bluecolored/bluemap/bukkit
sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge
sponge-9.0.0/src/main/java/de/bluecolored/bluemap/sponge Expand file tree Collapse file tree 16 files changed +105
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,11 @@ public Optional<ServerWorld> getWorld(Object world) {
149149 if (world instanceof Path )
150150 return getWorld ((Path ) world );
151151
152+ if (world instanceof String ) {
153+ Identifier identifier = Identifier .tryParse ((String ) world );
154+ if (identifier != null ) world = identifier ;
155+ }
156+
152157 if (world instanceof Identifier ) {
153158 DimensionType dimensionType = DimensionType .byId ((Identifier ) world );
154159 if (dimensionType != null ) world = dimensionType ;
Original file line number Diff line number Diff line change 4343import net .fabricmc .fabric .api .event .lifecycle .v1 .ServerTickEvents ;
4444import net .minecraft .server .MinecraftServer ;
4545import net .minecraft .server .network .ServerPlayerEntity ;
46+ import net .minecraft .util .Identifier ;
47+ import net .minecraft .util .registry .Registry ;
4648import net .minecraft .util .registry .RegistryKey ;
4749import net .minecraft .world .World ;
4850import org .apache .logging .log4j .LogManager ;
@@ -150,6 +152,11 @@ public Optional<ServerWorld> getWorld(Object world) {
150152 if (world instanceof Path )
151153 return getWorld ((Path ) world );
152154
155+ if (world instanceof String ) {
156+ Identifier identifier = Identifier .tryParse ((String ) world );
157+ if (identifier != null ) world = serverInstance .getWorld (RegistryKey .of (Registry .DIMENSION , identifier ));
158+ }
159+
153160 if (world instanceof RegistryKey ) {
154161 try {
155162 world = serverInstance .getWorld ((RegistryKey <World >) world );
Original file line number Diff line number Diff line change 4343import net .fabricmc .fabric .api .event .lifecycle .v1 .ServerTickEvents ;
4444import net .minecraft .server .MinecraftServer ;
4545import net .minecraft .server .network .ServerPlayerEntity ;
46+ import net .minecraft .util .Identifier ;
47+ import net .minecraft .util .registry .Registry ;
4648import net .minecraft .util .registry .RegistryKey ;
4749import net .minecraft .world .World ;
4850import org .apache .logging .log4j .LogManager ;
@@ -150,6 +152,11 @@ public Optional<ServerWorld> getWorld(Object world) {
150152 if (world instanceof Path )
151153 return getWorld ((Path ) world );
152154
155+ if (world instanceof String ) {
156+ Identifier identifier = Identifier .tryParse ((String ) world );
157+ if (identifier != null ) world = serverInstance .getWorld (RegistryKey .of (Registry .DIMENSION , identifier ));
158+ }
159+
153160 if (world instanceof RegistryKey ) {
154161 try {
155162 world = serverInstance .getWorld ((RegistryKey <World >) world );
Original file line number Diff line number Diff line change 4343import net .fabricmc .fabric .api .event .lifecycle .v1 .ServerTickEvents ;
4444import net .minecraft .server .MinecraftServer ;
4545import net .minecraft .server .network .ServerPlayerEntity ;
46+ import net .minecraft .util .Identifier ;
47+ import net .minecraft .util .registry .Registry ;
4648import net .minecraft .util .registry .RegistryKey ;
4749import net .minecraft .world .World ;
4850import org .apache .logging .log4j .LogManager ;
@@ -150,6 +152,11 @@ public Optional<ServerWorld> getWorld(Object world) {
150152 if (world instanceof Path )
151153 return getWorld ((Path ) world );
152154
155+ if (world instanceof String ) {
156+ Identifier identifier = Identifier .tryParse ((String ) world );
157+ if (identifier != null ) world = serverInstance .getWorld (RegistryKey .of (Registry .WORLD_KEY , identifier ));
158+ }
159+
153160 if (world instanceof RegistryKey ) {
154161 try {
155162 world = serverInstance .getWorld ((RegistryKey <World >) world );
Original file line number Diff line number Diff line change 4343import net .fabricmc .fabric .api .event .lifecycle .v1 .ServerTickEvents ;
4444import net .minecraft .server .MinecraftServer ;
4545import net .minecraft .server .network .ServerPlayerEntity ;
46+ import net .minecraft .util .Identifier ;
47+ import net .minecraft .util .registry .Registry ;
4648import net .minecraft .util .registry .RegistryKey ;
4749import net .minecraft .world .World ;
4850import org .apache .logging .log4j .LogManager ;
@@ -150,6 +152,11 @@ public Optional<ServerWorld> getWorld(Object world) {
150152 if (world instanceof Path )
151153 return getWorld ((Path ) world );
152154
155+ if (world instanceof String ) {
156+ Identifier identifier = Identifier .tryParse ((String ) world );
157+ if (identifier != null ) world = serverInstance .getWorld (RegistryKey .of (Registry .WORLD_KEY , identifier ));
158+ }
159+
153160 if (world instanceof RegistryKey ) {
154161 try {
155162 world = serverInstance .getWorld ((RegistryKey <World >) world );
Original file line number Diff line number Diff line change 4343import net .fabricmc .fabric .api .event .lifecycle .v1 .ServerTickEvents ;
4444import net .minecraft .server .MinecraftServer ;
4545import net .minecraft .server .network .ServerPlayerEntity ;
46+ import net .minecraft .util .Identifier ;
47+ import net .minecraft .util .registry .Registry ;
4648import net .minecraft .util .registry .RegistryKey ;
4749import net .minecraft .world .World ;
4850import org .apache .logging .log4j .LogManager ;
@@ -150,6 +152,11 @@ public Optional<ServerWorld> getWorld(Object world) {
150152 if (world instanceof Path )
151153 return getWorld ((Path ) world );
152154
155+ if (world instanceof String ) {
156+ Identifier identifier = Identifier .tryParse ((String ) world );
157+ if (identifier != null ) world = serverInstance .getWorld (RegistryKey .of (Registry .WORLD_KEY , identifier ));
158+ }
159+
153160 if (world instanceof RegistryKey ) {
154161 try {
155162 world = serverInstance .getWorld ((RegistryKey <World >) world );
Original file line number Diff line number Diff line change @@ -162,6 +162,13 @@ public Optional<ServerWorld> getWorld(Object world) {
162162 if (world instanceof Path )
163163 return getWorld ((Path ) world );
164164
165+ if (world instanceof String ) {
166+ ResourceLocation resourceLocation = ResourceLocation .tryCreate ((String ) world );
167+ DimensionType dimensionType = null ;
168+ if (resourceLocation != null ) dimensionType = DimensionType .byName (resourceLocation );
169+ if (dimensionType != null ) world = serverInstance .getWorld (dimensionType );
170+ }
171+
165172 if (world instanceof ResourceLocation ) {
166173 DimensionType dimensionType = DimensionType .byName ((ResourceLocation ) world );
167174 if (dimensionType != null ) world = dimensionType ;
Original file line number Diff line number Diff line change @@ -162,6 +162,13 @@ public Optional<ServerWorld> getWorld(Object world) {
162162 if (world instanceof Path )
163163 return getWorld ((Path ) world );
164164
165+ if (world instanceof String ) {
166+ ResourceLocation resourceLocation = ResourceLocation .tryCreate ((String ) world );
167+ DimensionType dimensionType = null ;
168+ if (resourceLocation != null ) dimensionType = DimensionType .byName (resourceLocation );
169+ if (dimensionType != null ) world = serverInstance .getWorld (dimensionType );
170+ }
171+
165172 if (world instanceof ResourceLocation ) {
166173 DimensionType dimensionType = DimensionType .byName ((ResourceLocation ) world );
167174 if (dimensionType != null ) world = dimensionType ;
Original file line number Diff line number Diff line change 3939import net .minecraft .entity .player .ServerPlayerEntity ;
4040import net .minecraft .server .MinecraftServer ;
4141import net .minecraft .util .RegistryKey ;
42+ import net .minecraft .util .ResourceLocation ;
43+ import net .minecraft .util .registry .Registry ;
4244import net .minecraft .world .World ;
4345import net .minecraftforge .common .MinecraftForge ;
4446import net .minecraftforge .event .TickEvent .ServerTickEvent ;
@@ -163,6 +165,11 @@ public Optional<ServerWorld> getWorld(Object world) {
163165 if (world instanceof Path )
164166 return getWorld ((Path ) world );
165167
168+ if (world instanceof String ) {
169+ ResourceLocation resourceLocation = ResourceLocation .tryCreate ((String ) world );
170+ if (resourceLocation != null ) world = serverInstance .getWorld (RegistryKey .func_240903_a_ (Registry .field_239699_ae_ , resourceLocation ));
171+ }
172+
166173 if (world instanceof RegistryKey ) {
167174 try {
168175 world = serverInstance .getWorld ((RegistryKey <World >) world );
Original file line number Diff line number Diff line change 3535import de .bluecolored .bluemap .core .BlueMap ;
3636import de .bluecolored .bluemap .core .MinecraftVersion ;
3737import de .bluecolored .bluemap .core .logger .Logger ;
38+ import net .minecraft .core .Registry ;
3839import net .minecraft .resources .ResourceKey ;
40+ import net .minecraft .resources .ResourceLocation ;
3941import net .minecraft .server .MinecraftServer ;
4042import net .minecraft .server .level .ServerLevel ;
4143import net .minecraft .server .level .ServerPlayer ;
@@ -162,6 +164,11 @@ public Optional<ServerWorld> getWorld(Object world) {
162164 if (world instanceof Path )
163165 return getWorld ((Path ) world );
164166
167+ if (world instanceof String ) {
168+ ResourceLocation resourceLocation = ResourceLocation .tryParse ((String ) world );
169+ if (resourceLocation != null ) world = serverInstance .getLevel (ResourceKey .create (Registry .DIMENSION_REGISTRY , resourceLocation ));
170+ }
171+
165172 if (world instanceof ResourceKey ) {
166173 try {
167174 world = serverInstance .getLevel ((ResourceKey <Level >) world );
You can’t perform that action at this time.
0 commit comments