@@ -48,7 +48,7 @@ public MixinMinecraftServer(String name) {
4848 private Map <DimensionType , ServerWorld > worlds ;
4949
5050 /*
51- // This is a varient of the world load hook that is less likely to break mods and more likely to break on updates.
51+ // This is a variant of the world load hook that is less likely to break mods and more likely to break on updates.
5252 // Should get called once per loop, regardless of which if branch it takes.
5353 @Inject(
5454 method = "createWorlds",
@@ -66,8 +66,8 @@ private void hookCreateWorlds(WorldSaveHandler worldSaveHandler, LevelProperties
6666
6767 // This injection gets called at the beginning of each loop, and is used to special case the overworld dimension type.
6868 @ Redirect (method = "createWorlds" , at = @ At (value = "INVOKE" , target = "java/util/Iterator.next ()Ljava/lang/Object;" ))
69- private Object proxyNextWorldToSpecialCaseOverworld (Iterator iterator ) {
70- DimensionType type = ( DimensionType ) iterator .next ();
69+ private Object proxyNextWorldToSpecialCaseOverworld (Iterator < DimensionType > iterator ) {
70+ DimensionType type = iterator .next ();
7171
7272 if (type == DimensionType .OVERWORLD ) {
7373 WorldEvents .onWorldLoad (this .worlds .get (type ));
@@ -78,9 +78,10 @@ private Object proxyNextWorldToSpecialCaseOverworld(Iterator iterator) {
7878
7979 // This injection handles every other dimension type.
8080 @ Redirect (method = "createWorlds" , at = @ At (value = "INVOKE" , target = "java/util/Map.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" , ordinal = 1 ))
81- private Object proxyPutWorld (Map worlds , Object type , Object world ) {
81+ private Object proxyPutWorld (Map < Object , Object > worlds , Object type , Object world ) {
8282 worlds .put (type , world );
8383 WorldEvents .onWorldLoad ((ServerWorld ) world );
84+
8485 return world ;
8586 }
8687
@@ -90,9 +91,8 @@ private void proxyClose(ServerWorld world) throws IOException {
9091 world .close ();
9192 }
9293
93- /*
94- // TODO: DimensionManager, and move this into a seperate module
95- @Inject(method = "createWorlds", at = @At(value = "HEAD"))
94+ // TODO: DimensionManager, and move this into a seperate module/*
95+ /*@Inject(method = "createWorlds", at = @At(value = "HEAD"))
9696 private void hookCreateWorldsForDimensionRegistration(CallbackInfo info) {
9797 DimensionManager.fireRegister();
9898 }
@@ -112,7 +112,5 @@ private void hookTickWorldsForDimensionUnload(DisableableProfiler profiler, Stri
112112 private Object hookGetWorld(Map worlds, Object type) {
113113 MinecraftServer server = (MinecraftServer) (Object) this;
114114 return DimensionManager.getWorld(server, type, true, true);
115- }
116-
117- */
115+ }*/
118116}
0 commit comments