QbDesu / ConvenientAdditions

A mod that aims to improve your everyday Minecraft experience: https://minecraft.curseforge.com/projects/convenient-additions
MIT License
0 stars 0 forks source link

Crash in SMP #1

Closed dshadowwolf closed 8 years ago

dshadowwolf commented 8 years ago

Server cannot start with Convenient Additions released 11/15 in its mod-list. This appears to be because of a client-only access - a reference to 'net.minecraft.client.renderer.ItemMeshDefinition'

crash-2016-11-25_15.27.41-server.txt crash-2016-11-25_15.18.09-server.txt

Those are two reports of the crash that were generated before I realized the cause. I think you need to keep any client-specific references out of the common code and in classes only used from the Client Proxy, but I could be wrong.

QbDesu commented 8 years ago

Thanks for reporting it. I'll try to look into it as soon as I can. I'm currently in the middle of updating to 1.11 which unfortunately does take some time. Unfortunately, since this bug is based on reflection I can not easily see where exactly it is located but I'll figure it out as soon as I can build again.

QbDesu commented 8 years ago

It may take a little longer than anticipated because I have to wait for baubles to get updated. Sorry D:

Edit: Good news, I rewrote parts of the code so Baubles is now a soft dependency. Bad news, the mod currently looks like this:

dshadowwolf commented 8 years ago

hrm... Let me go through the pre-init path, as it looks like that might be where this was triggering, from the dump. (None of the mods are listed as having hit pre-init, just 'load', so...)

Might be as simple as having missed a 'SideOnly' notation.

Okay... Looks like it's in ModItems.java -- you have direct imported reference in there to the class in question. This is in common code and does not have a 'SideOnly' annotation.

I haven't looked through the whole code-base to see if there are other instances where client-only code is intruding into common-code without annotation, but this might not be the only instance.

Given a couple days I might be able to figure out a good fix, but I'm trying to learn 1.10 and later modding myself right now and have at least 2 mods I'm forking and trying to port because I think they are needed.

QbDesu commented 8 years ago

By the looks of it i accidentally added a call to ModItems#initModelLoader from ModItems#init despite already calling it from the proxy as actually intended to be called since init is called on both sides. I added some SideOnly-annotations as well and the server starts no problem in 1.11 now. Thank you a lot for reporting the bug it should be fixed in the next version which I'm probably going to release this evening(UTC+1).

dshadowwolf commented 8 years ago

Not a problem. Java is not my first language and finding causes of bugs, if not the proper fixes, is a cross-language skill.