ServerCore

ServerCore

384k Downloads

"Write access detected to @Final field" Crash on startup

Ethernalll opened this issue ยท 2 comments

commented

Server crashes on startup, error:
mclo.gs in case formatting messes up and it's unreadable: https://mclo.gs/UvLOPNQ

[19:32:02] [main/ERROR] (FabricLoader/Mixin) Write access detected to @Final field field_6297:I in servercore.mixins.json:features.dynamic.MobCategoryMixin from mod servercore::handler$zca000$servercore$onInit
[19:32:02] [main/ERROR] (FabricLoader/Mixin) Write access detected to @Final field field_6297:I in servercore.mixins.json:features.dynamic.MobCategoryMixin from mod servercore::modifyCapacity
[19:32:02] [main/ERROR] (FabricLoader) Minecraft has crashed!
 net.fabricmc.loader.impl.FormattedException: java.lang.IllegalAccessError: Update to non-static final field net.minecraft.entity.SpawnGroup.capacity attempted from a different method (handler$zca000$servercore$onInit) than the initializer method <init> 
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:463) ~[fabric-loader-0.14.10.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.10.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.14.10.jar:?]
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: java.lang.IllegalAccessError: Update to non-static final field net.minecraft.entity.SpawnGroup.capacity attempted from a different method (handler$zca000$servercore$onInit) than the initializer method <init> 
	at net.minecraft.entity.SpawnGroup.handler$zca000$servercore$onInit(SpawnGroup.java:524) ~[[email protected]:?]
	at net.minecraft.entity.SpawnGroup.<init>(SpawnGroup.java:33) ~[[email protected]:?]
	at net.minecraft.entity.SpawnGroup.<clinit>(SpawnGroup.java:7) ~[[email protected]:?]
	at net.minecraft.entity.EntityType.<clinit>(EntityType.java:168) ~[[email protected]:?]
	at net.minecraft.world.gen.feature.DungeonFeature.<clinit>(DungeonFeature.java:28) ~[[email protected]:?]
	at net.minecraft.world.gen.feature.Feature.<clinit>(Feature.java:84) ~[[email protected]:?]
	at net.minecraft.world.gen.feature.OceanConfiguredFeatures.<clinit>(OceanConfiguredFeatures.java:20) ~[[email protected]:?]
	at net.minecraft.world.gen.feature.ConfiguredFeatures.getDefaultConfiguredFeature(ConfiguredFeatures.java:24) ~[[email protected]:?]
	at net.minecraft.util.registry.BuiltinRegistries.method_44104(BuiltinRegistries.java:98) ~[[email protected]:?]
	at net.minecraft.util.registry.BuiltinRegistries.method_30566(BuiltinRegistries.java:105) ~[[email protected]:?]
	at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[?:?]
	at net.minecraft.util.registry.BuiltinRegistries.<clinit>(BuiltinRegistries.java:104) ~[[email protected]:?]
	at net.minecraft.util.registry.Registry.<clinit>(Registry.java:326) ~[[email protected]:?]
	at net.minecraft.Bootstrap.initialize(Bootstrap.java:50) ~[[email protected]:?]
	at net.minecraft.server.Main.main(Main.java:98) ~[[email protected]:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) ~[fabric-loader-0.14.10.jar:?]
	... 3 more
Disconnected from the target VM, address: '127.0.0.1:63219', transport: 'socket'

Process finished with exit code 1

Reproduce
Put servercore on a fabric server (in my case on the latest build, 0.14.10 run in intellij)

Versions -Latest is not a version!
ServerCore: lates- er, 1.3.3
Minecraft: 1.19.2

Mod incompatibilities
N/A

commented

ServerCore does add a field named capacity in the SpawnGroup class, to store modified values.

In the specific case of Yarn mappings, I think that might overlap with SpawnGroup's own mobcap field, since dev environment doesn't remap them.

For the same reason this shouldn't be an issue in production environment, since it would be something like field_xxxxx

commented

Ah ok, switching to a production environment fixed the issue, thank you!