LandOfSignals crash with Java >= 12 due to "Caused by: java.lang.NoSuchFieldException: modifiers"
Danielxs01 opened this issue ยท 2 comments
LandOfSignals crash with Java >= 12 due to "Caused by: java.lang.NoSuchFieldException: modifiers"
Static fields cause this crash as Java 12 and higher no longer support overwriting final variables.
Example problematic code:
@TagField("id")
private final String id;
Example crashlog:
java.lang.RuntimeException: cam72cam.mod.serialization.SerializationException: Unable to access field id in class class net.landofrails.landofsignals.tile.TileComplexSignal
at cam72cam.mod.block.tile.TileEntity.func_189515_b(TileEntity.java:231) ~[universalmodcore:1.2.1] {re:classloading}
at cam72cam.mod.block.tile.TileEntity.getUpdateTag(TileEntity.java:258) ~[universalmodcore:1.2.1] {re:classloading}
at cam72cam.mod.block.tile.TileEntity.func_189518_D_(TileEntity.java:241) ~[universalmodcore:1.2.1] {re:classloading}
at net.minecraft.world.server.ChunkHolder.func_219305_a(ChunkHolder.java:217) ~[?:?] {re:classloading}
at net.minecraft.world.server.ChunkHolder.func_244385_a(ChunkHolder.java:209) ~[?:?] {re:classloading}
at net.minecraft.world.server.ChunkHolder.func_219274_a(ChunkHolder.java:189) ~[?:?] {re:classloading}
at net.minecraft.world.server.ServerChunkProvider.func_241099_a_(ServerChunkProvider.java:355) ~[?:?] {re:classloading,pl:accesstransformer:B}
at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {}
at net.minecraft.world.server.ServerChunkProvider.func_217220_m(ServerChunkProvider.java:351) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.server.ServerChunkProvider.func_217207_a(ServerChunkProvider.java:326) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.server.ServerWorld.func_72835_b(ServerWorld.java:334) ~[?:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:851) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixin.terraforged.json:common.MixinMinecraftServer,pl:mixin:A}
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixin.terraforged.json:common.MixinMinecraftServer,pl:mixin:A}
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:78) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixin.terraforged.json:common.MixinMinecraftServer,pl:mixin:A}
at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixin.terraforged.json:common.MixinMinecraftServer,pl:mixin:A}
at java.lang.Thread.run(Thread.java:831) [?:?] {}
Caused by: cam72cam.mod.serialization.SerializationException: Unable to access field id in class class net.landofrails.landofsignals.tile.TileComplexSignal
at cam72cam.mod.serialization.TagSerializer.init(TagSerializer.java:70) ~[universalmodcore:1.2.1] {re:classloading}
at cam72cam.mod.serialization.TagSerializer.serialize(TagSerializer.java:157) ~[universalmodcore:1.2.1] {re:classloading}
at cam72cam.mod.block.tile.TileEntity.func_189515_b(TileEntity.java:227) ~[universalmodcore:1.2.1] {re:classloading}
... 16 more
Caused by: java.lang.NoSuchFieldException: modifiers
at java.lang.Class.getDeclaredField(Class.java:2549) ~[?:?] {}
at cam72cam.mod.serialization.TagSerializer.init(TagSerializer.java:66) ~[universalmodcore:1.2.1] {re:classloading}
at cam72cam.mod.serialization.TagSerializer.serialize(TagSerializer.java:157) ~[universalmodcore:1.2.1] {re:classloading}
at cam72cam.mod.block.tile.TileEntity.func_189515_b(TileEntity.java:227) ~[universalmodcore:1.2.1] {re:classloading}
... 16 more