12
12
import io .izzel .arclight .common .mod .server .BukkitRegistry ;
13
13
import io .izzel .arclight .common .mod .util .ArclightCaptures ;
14
14
import io .izzel .arclight .common .mod .util .BukkitOptionParser ;
15
+ import io .izzel .arclight .mixin .Decorate ;
16
+ import io .izzel .arclight .mixin .DecorationOps ;
15
17
import it .unimi .dsi .fastutil .longs .LongIterator ;
16
18
import joptsimple .OptionParser ;
17
19
import joptsimple .OptionSet ;
76
78
import org .spongepowered .asm .mixin .Shadow ;
77
79
import org .spongepowered .asm .mixin .injection .At ;
78
80
import org .spongepowered .asm .mixin .injection .Inject ;
79
- import org .spongepowered .asm .mixin .injection .ModifyArg ;
80
81
import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
81
82
import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
82
83
import org .spongepowered .asm .mixin .injection .callback .LocalCapture ;
@@ -360,18 +361,9 @@ private void executeModerately() {
360
361
BukkitRegistry .registerEnvironments (this .registryAccess ().registryOrThrow (Registries .LEVEL_STEM ));
361
362
}
362
363
363
- private transient ServerLevel arclight$capturedLevel ;
364
-
365
- @ ModifyArg (method = "createLevels" , index = 1 , at = @ At (value = "INVOKE" , remap = false , target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" ))
366
- private Object arclight$worldInitCapture (Object value ) {
367
- arclight$capturedLevel = (ServerLevel ) value ;
368
- return value ;
369
- }
370
-
371
- @ Inject (method = "createLevels" , at = @ At (value = "INVOKE" , remap = false , target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" ))
372
- private void arclight$worldInit (ChunkProgressListener chunkProgressListener , CallbackInfo ci ) {
373
- ServerLevel serverWorld = arclight$capturedLevel ;
374
- arclight$capturedLevel = null ;
364
+ @ Decorate (method = "createLevels" , at = @ At (value = "INVOKE" , remap = false , target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" ))
365
+ private Object arclight$worldInit (Map <Object , Object > instance , Object k , Object v , ChunkProgressListener chunkProgressListener ) throws Throwable {
366
+ var serverWorld = (ServerLevel ) v ;
375
367
if (serverWorld != null ) {
376
368
if (((CraftServer ) Bukkit .getServer ()).scoreboardManager == null ) {
377
369
((CraftServer ) Bukkit .getServer ()).scoreboardManager = new CraftScoreboardManager ((MinecraftServer ) (Object ) this , serverWorld .getScoreboard ());
@@ -383,6 +375,7 @@ private void executeModerately() {
383
375
}
384
376
Bukkit .getPluginManager ().callEvent (new WorldInitEvent (serverWorld .bridge$getWorld ()));
385
377
}
378
+ return DecorationOps .callsite ().invoke (instance , k , v );
386
379
}
387
380
388
381
/**
0 commit comments