RandomMcSomethin / fallingleaves

MIT License
43 stars 20 forks source link

Server Start Error #2

Closed NekoKera closed 3 years ago

NekoKera commented 3 years ago

Falling Leaves results in an error when starting on a Fabric server. From what I can see, the effects of Falling Leaves does not work when only installed on the client side, but it doesn't stop a server without it from running normally (just without the falling leaves effect). I've posted the server start error log below.

[17:25:24] [main/INFO]: Loading for game Minecraft 1.16.4
[17:25:25] [main/INFO]: [FabricLoader] Loading 45 mods: minecraft@1.16.4, fabric-screen-handler-api-v1@1.1.0+872498413a, fabric-renderer-api-v1@0.3.3+a4467d2a3a, fabric-networking-blockentity-v0@0.2.5+b50ffc7b3a, fabric-keybindings-v0@0.2.0+3fa9f7c53a, cloth-basic-math@0.5.1, fabric-command-api-v1@1.0.9+a4467d2a3a, fabricloader@0.10.6+build.214, fabric-tool-attribute-api-v1@1.2.4+2b4623793a, fabric-structure-api-v1@1.1.0+f8ac1db23a, fabric-renderer-indigo@0.4.3+a4467d2a3a, fabric-containers-v0@0.1.8+045df74f3a, fabric-object-builder-api-v1@1.9.2+a89534ab3a, fabric-item-api-v1@1.2.0+f8ac1db23a, fabric-crash-report-info-v1@0.1.2+b7f9825d3a, fabric-events-interaction-v0@0.4.1+f8ac1db23a, fabric-game-rule-api-v1@1.0.3+a4467d2a3a, fabric-api-base@0.2.0+9f0fb4b83a, fallingleaves@1.1, fabric-rendering-v0@1.1.1+f8ac1db23a, fabric-rendering-v1@1.3.1+f8ac1db23a, fabric-key-binding-api-v1@1.0.1+730711c63a, cloth-config2@4.8.2, fabric-rendering-data-attachment-v1@0.1.4+f8ac1db23a, autoconfig1u@3.3.1, fabric-resource-loader-v0@0.3.1+facf3bbf3a, fabric-textures-v0@1.0.5+a4467d2a3a, fabric-content-registries-v0@0.1.9+059ea8663a, fabric-tag-extensions-v0@1.0.3+ac8e8c593a, fabric-rendering-fluids-v1@0.1.12+f8ac1db23a, fabric-biome-api-v1@3.0.0+8367596d3a, fabric-registry-sync-v0@0.6.1+a4467d2a3a, fabric-commands-v0@0.2.0+52d308363a, fabric-blockrenderlayer-v1@1.1.4+c6a8ea893a, fabric-lifecycle-events-v1@1.2.0+74cc3b203a, fabric-mining-levels-v0@0.1.2+b764ce993a, fabric-renderer-registries-v1@2.2.0+f8ac1db23a, fabric-events-lifecycle-v0@0.2.0+16acbe5b3a, fabric-loot-tables-v1@1.0.1+432ea1883a, fabric@0.25.1+build.416-1.16, fabric-models-v0@0.1.1+f8ac1db23a, fabric-item-groups-v0@0.2.1+a4467d2a3a, fabric-particles-v1@0.2.2+fb0d9b0e3a, fabric-object-builders-v0@0.7.1+a4467d2a3a, fabric-networking-v0@0.1.10+e00ecb5f3a
[17:25:25] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.2 
Service=Knot/Fabric Env=SERVER
[17:25:28] [main/WARN]: Error loading class: net/minecraft/class_310 (java.lang.ClassNotFoundException: net/minecraft/class_310)
Exception in thread "main" java.lang.RuntimeException: Failed to setup Fabric server environment!
        at net.fabricmc.loader.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:52)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: An exception occurred when launching the server!
        at net.fabricmc.loader.launch.server.FabricServerLauncher.setup(FabricServerLauncher.java:108)
        at net.fabricmc.loader.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:50)
Caused by: java.lang.RuntimeException: An exception occurred when launching the server!
        at net.fabricmc.loader.launch.server.FabricServerLauncher.launch(FabricServerLauncher.java:64)
        at net.fabricmc.loader.launch.server.FabricServerLauncher.setup(FabricServerLauncher.java:106)
        ... 1 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at net.fabricmc.loader.launch.server.FabricServerLauncher.launch(FabricServerLauncher.java:62)
        ... 2 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:226)
        at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:141)
        at net.fabricmc.loader.launch.knot.KnotServer.main(KnotServer.java:27)
        ... 7 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:224)
        ... 9 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
        at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
        at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:208)
        at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:178)
        at org.spongepowered.asm.mixin.transformer.FabricMixinTransformerProxy.transformClassBytes(FabricMixinTransformerProxy.java:23)
        at net.fabricmc.loader.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:157)
        at net.fabricmc.loader.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:150)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at net.minecraft.class_3523.<clinit>(class_3523.java:13)
        at net.minecraft.class_5471.<clinit>(class_5471.java:11)
        at net.minecraft.class_5458.method_30573(class_5458.java:44)
        at net.minecraft.class_5458.method_30566(class_5458.java:75)
        at java.util.LinkedHashMap.forEach(Unknown Source)
        at net.minecraft.class_5458.<clinit>(class_5458.java:74)
        at net.minecraft.class_2378.<clinit>(class_2378.java:237)
        at net.minecraft.class_2966.method_12851(class_2966.java:42)
        at net.minecraft.server.Main.main(Main.java:87)
        ... 14 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinPreProcessorException: Attach error for fallingleaves.mixins.json:LeafTickMixin during activity: [Transform -> Method randomDisplayTick(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Ljava/util/Random;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> INVOKESTATIC -> net/minecraft/class_310::method_1551()Lnet/minecraft/class_310;]
        at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:300)
        at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.createContextFor(MixinPreProcessorStandard.java:264)
        at org.spongepowered.asm.mixin.transformer.MixinInfo.createContextFor(MixinInfo.java:1272)
        at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:287)
        at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:345)
        at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:569)
        at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:351)
        ... 29 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: net.minecraft.class_310
        at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transformMemberReference(MixinPreProcessorStandard.java:768)
        at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transformMethod(MixinPreProcessorStandard.java:754)
        at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transform(MixinPreProcessorStandard.java:720)
        at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:294)
        ... 35 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.class_310
        ... 39 more
Fourmisain commented 3 years ago

I was wondering too why the mod wasn't marked client only in Mod Menu, because I don't see a reason why a mod that adds particles needs to run on the server, that said,

From what I can see, the effects of Falling Leaves does not work when only installed on the client side

I did try running it client only on my server and the particles are there, so I don't know what happened on your end, maybe particles are turned off/down? It takes a few seconds for a leaf to spawn under a tree and only if you're close enough, they are also pretty small.

In any case, here are some solutions: The easiest fix is to simply not install the mod on servers. The second easiest fix is to set "environment": "client" in the fabric.mod.json:

https://github.com/RandomMcSomethin/fallingleaves/blob/900db0b851ec63c102377471d85398dcdf942b8b/src/main/resources/fabric.mod.json#L13

This will also mark it [Client] in Mod Menu and this will ensure no code is run on the server at all, this is probably what should be done for now.

If the mod needs to run on the server in the future, "LeafTickMixin" needs to be moved from mixins to client in the mixins.json:

https://github.com/RandomMcSomethin/fallingleaves/blob/900db0b851ec63c102377471d85398dcdf942b8b/src/main/resources/fallingleaves.mixins.json#L6-L10

because randomDisplayTick doesn't exist in server code (but randomTick does).

I guess I'll just put up a pull request.

NekoKera commented 3 years ago

I've done some more testing and I can confirm that FallingLeaves does work on servers when only present on the client-side; however, I had issues running in combination with my server mod list, so I started going down testing it with each mod. What I discovered is that Falling Leaves does not work when BetterEnd is present on the server and client. BetterEnd (using the current most version) does work with FallingLeaves on Single Player, but this is not the case for Multiplayer, as the leaves do not fall from the trees (even in the overworld).

Fourmisain commented 3 years ago

I can confirm and it's really odd. Did some debugging and found that randomDisplayTick and world.addParticle is called like normal with reasonable positions and colors and that doesn't change when BetterEnd is installed on both server and client, but what does change is that FallingLeafParticle.DefaultFactory.createParticle is for some reason never called. Singleplayer is fine however, Vanilla particles like lava sparks, redstone glow are also not affected.

So it adds the particles but they are never created? I see that BetterEnd uses some BiomeParticleConfigs, but nothing that immediately screams mod conflict. I'll report the issue to BetterEnd, maybe they know what's going on.

Fourmisain commented 3 years ago

The issue of particles not appearing in multiplayer with BetterEnd should now be fixed with https://github.com/FabricMC/fabric/pull/1179 in the fabric API 0.26.3 release. The original issue is still open.

Fourmisain commented 3 years ago

https://github.com/RandomMcSomethin/fallingleaves/pull/3 is now merged and released in mod version 1.3!