stfwi / engineers-decor

Engineer's Decor
MIT License
35 stars 16 forks source link

Failed to load latest version on server, @sided issue #91

Closed tyon2006 closed 4 years ago

tyon2006 commented 4 years ago

Hey, I just tried to load the recent update on my server and I get a crash. Error message below. Looks like theres a problem with the @side of an event for the .

I tried disabling the crate in the config by adding crate,labeled,labeled_crate to the opt out list and enabled true for removing opt out items from the registry (amazing feature btw) but this did not work.

(To be clear, it did drop the registered blocks from 80 to 79, but it had no effect on the error message.)

[11:53:09] [Server thread/INFO] [engineersdecor]: Registered 80 blocks. [11:53:09] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@4889a8d6: java.lang.NoClassDefFoundError: wile/engineersdecor/blocks/BlockDecorLabeledCrate$BGui at java.lang.Class.getDeclaringClass0(Native Method) ~[?:1.8.0_241] at java.lang.Class.getDeclaringClass(Unknown Source) ~[?:1.8.0_241] at java.lang.Class.getEnclosingClass(Unknown Source) ~[?:1.8.0_241] at java.lang.Class.getSimpleBinaryName(Unknown Source) ~[?:1.8.0_241] at java.lang.Class.getSimpleName(Unknown Source) ~[?:1.8.0_241] at org.spongepowered.mod.util.StaticMixinForgeHelper.getModIdFromClass(StaticMixinForgeHelper.java:323) ~[StaticMixinForgeHelper.class:1.12.2-2838-7.2.1-RC4010] at org.spongepowered.common.SpongeImplHooks.getModIdFromClass(SpongeImplHooks.java:2494) ~[SpongeImplHooks.class:1.12.2-2838-7.2.1-RC4010] at org.spongepowered.common.registry.type.block.TileEntityTypeRegistryModule.doTileEntityRegistration(TileEntityTypeRegistryModule.java:156) ~[TileEntityTypeRegistryModule.class:1.12.2-2838-7.2.1-RC4010] at net.minecraft.tileentity.TileEntity.handler$zkl000$impl$registerTileEntityClassWithSpongeRegistry(TileEntity.java:3695) ~[avj.class:?] at net.minecraft.tileentity.TileEntity.func_190560_a(TileEntity.java:37) ~[avj.class:?] at net.minecraftforge.fml.common.registry.GameRegistry.registerTileEntity(GameRegistry.java:234) ~[GameRegistry.class:?] at net.minecraftforge.fml.common.registry.GameRegistry.registerTileEntity(GameRegistry.java:239) ~[GameRegistry.class:?] at wile.engineersdecor.ModContent.registerBlocks(ModContent.java:700) ~[ModContent.class:?] at wile.engineersdecor.ModEngineersDecor$RegistrationSubscriptions.registerBlocks(ModEngineersDecor.java:128) ~[ModEngineersDecor$RegistrationSubscriptions.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_362_RegistrationSubscriptions_registerBlocks_Register.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) ~[EventBus$1.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.forgeBridge$post(EventBus.java:1256) [EventBus.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:1203) [EventBus.class:?] at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:845) [GameData.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:628) [Loader.class:?] at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) [FMLServerHandler.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333) [FMLCommonHandler.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125) [nz.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_241] Caused by: java.lang.ClassNotFoundException: wile.engineersdecor.blocks.BlockDecorLabeledCrate$BGui at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241] ... 26 more Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@4bbb49b0 from coremod FMLCorePlugin at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:260) ~[forge-1.12.2-14.23.5.2838-universal.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241] ... 26 more Caused by: java.lang.RuntimeException: Attempted to load class wile/engineersdecor/blocks/BlockDecorLabeledCrate$BGui for invalid side SERVER at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forge-1.12.2-14.23.5.2838-universal.jar:?] at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:256) ~[forge-1.12.2-14.23.5.2838-universal.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241] ... 26 more

tyon2006 commented 4 years ago

For reference:

image

stfwi commented 4 years ago

Hi tyon, cool that you added already the right log section and the screenshot. I would like to quickly go over the basics, so that we are sure that I am looking at the right place. You are on Minecraft 1.12 (because that's the only version where registration opt-out is available), mod version engineersdecor-1.12.2-1.0.20-b2, and Forge 14.23.5.2768 (release)?

stfwi commented 4 years ago

Actually, I simply dare to make a shot. Could you check this one (it's signed by and marked as testing), would not mean sidenes, but a tile entity registration optout issue. Just a guess. If it works I'll compile a beta3 and push it.

engineersdecor-1.12.2-1.0.20-b3-testing-te-registration-fix.zip

tyon2006 commented 4 years ago

You, are awesome! I just tried your updated version on my server, and no beans. Provided full latest log.

latest.log

I am using forge 2838 because I am also the current version of sponge, so I'm locked there. Provided full latest log.

stfwi commented 4 years ago

Perfect that, I'll mark it as fix then and push it with the next version. Cheers for double checking, -

tyon2006 commented 4 years ago

So, I apologize, but I don't think I communicated clearly. The issue is definitely still there. Sorry!

stfwi commented 4 years ago

Oh, ok, so let's reopen this issue. I'll install your setup on my local test server at the weekend and take a closer look what's happening.

stfwi commented 4 years ago

Checked your log (and double checked that it really works my local test server before answering - I don't like to easily say "it's a problem of another mod" ;-]).

The thing is that the sponge mod hooks into the registration of the tile entities, and scans the class without checking the sides. As the GUI is a nested class marked client only, this leads to the printed exception.

[...]
    at org.spongepowered.mod.util.StaticMixinForgeHelper.getModIdFromClass(StaticMixinForgeHelper.java:323) ~[StaticMixinForgeHelper.class:1.12.2-2838-7.2.1-RC4010]
    at org.spongepowered.common.SpongeImplHooks.getModIdFromClass(SpongeImplHooks.java:2494) ~[SpongeImplHooks.class:1.12.2-2838-7.2.1-RC4010]
    at org.spongepowered.common.registry.type.block.TileEntityTypeRegistryModule.doTileEntityRegistration(TileEntityTypeRegistryModule.java:156) ~[TileEntityTypeRegistryModule.class:1.12.2-2838-7.2.1-RC4010]
    at net.minecraft.tileentity.TileEntity.handler$zkl000$impl$registerTileEntityClassWithSpongeRegistry(TileEntity.java:3695) ~[avj.class:?]

[...]

What I am wondering about, did you in the second test (with the new jar file) also opt out the labeled crate (because I do not understand why the tile entity is still registered in your log)? Could you take a look at the config again? My config was:

engineersdecor.cfg.txt

Well anyway. The workaround here will not fix the scan issue in sponge per se. We should give the "bobs" a hint to add an exception handling for that scan.

stfwi commented 4 years ago

Added related issue in the sponge (https://github.com/SpongePowered/SpongeForge/issues/3122).

stfwi commented 4 years ago

So, the TE registration bug we found while diving into this issue is pushed on curse now (beta 4), I set the status here to approval-pending. We can leave it open in case something to do here pops up (input from the sponge devs).

tyon2006 commented 4 years ago

You're a pro, thank you for the help!

For your info, i did disable the registration of that decorative block when it was still happening with sponge.

stfwi commented 4 years ago

Ok, there was no reaction for a week from the Sponge devs, so I'll close this issue here.

NLBlacky commented 4 years ago

What I am wondering about, did you in the second test (with the new jar file) also opt out the labeled crate (because I do not understand why the tile entity is still registered in your log)? Could you take a look at the config again? My config was:

engineersdecor.cfg.txt

I would like to inform both of you that I was having the same issue, but with the config you mentioned earlier I got it working. The exact lines were:

This was on a server with forge-1.12.2-14.23.5.2847-universal.jar and spongeforge-1.12.2-2838-7.2.0.jar.

stfwi commented 4 years ago

Hi, perfect that, thanks for the info! Aye, the pattern exclude is a bit strict, so the wildcards are needed to make matching not ambiguous. It's basically a regex that I escape and replace wildcard * to the corresponding regex .*?. In your case, it must be an exact match for label (e.g. a block named engineersdecor:label). With *label you would opt-out white_label, black_label, etc. And finally *label* matches everything that contains label.

NLBlacky commented 4 years ago

Ah I see that something went wrong pasting it here. I indeed have *label*. I've updated my post to make sure no-one makes the mistake.

stfwi commented 4 years ago

Nw, thanks again for letting us know.

stfwi commented 4 years ago

(Reopened according to feedback). There there are references in the TE container that may be the cause.

stfwi commented 4 years ago

Potential static constant refs moved.