MrJake222 / AUNIS

Stargate-inspired Minecraft Mod
GNU General Public License v3.0
44 stars 20 forks source link

Bugfixes, independency, debug logger, localization update, my first merge conflict #252

Closed slava110 closed 3 years ago

slava110 commented 3 years ago
slava110 commented 3 years ago

Btw, don't release it yet, I'm planning to add more stuff before next release

slava110 commented 3 years ago

You sure about that? Have you tested it? (Probably with compiled .jar file) It may crash as the ThermalIntegration is still being referenced and this file contains CoFHCore references.

Reference to ThermalIntegration is fine until you actually execute method/access field from this class. If you'll try to access it - class will load => import statements will load => game will crash. But we'll only access it when TE is loaded PS: tested in SP outside of dev environment. I can test it on dedicated server too if you want

I was thinking about rewriting the logging system for quite a while, but my eclipse won't show the DEBUG messages generated with Aunis.logger.debug or WARNs. Maybe I've found a solution.

Did you tested it? If it's working then we can remove debug method and use logger.debug instead. However, not sure about that cause I've added it to the config for players to turn it on in different situations (you can ask player to turn on this option and we'll see more information in logs). Maybe it's possible to toggle debug mode for Apache logger somehow? 🤔

MrJake222 commented 3 years ago

Reference to ThermalIntegration is fine until you actually execute method/access field from this class.

My experience would tell otherwise. It's the reason why OCWrapper exists. See here. But if you say it's working, then why not ;)

Did you tested it?

No, but I plan to. My idea is to log as much as possible to debug output because if the crash is hard to reproduce, then we'd have all valuable info in debug logs. And info logs will have, well, info. Then explicit enable switch for debug would be obsolete.

slava110 commented 3 years ago

My experience would tell otherwise

https://github.com/MightyPirates/OpenComputers/tree/master-MC1.12/src/main/scala/li/cil/oc/integration https://github.com/jaredlll08/ModTweaker/tree/1.12/src/main/java/com/blamejared/compat https://github.com/AlmuraDev/SGCraft/blob/master/src/mod/gcewing/sg/features/ic2/IC2PowerTE.java Three examples with references to other mods in separate classes. Plus my personal experience + it's working, ye. So I think it's okay to use other mods classes (if you're referencing these mods in a separate class file which isn't used when mod X isn't loaded)

Then explicit enable switch for debug would be obsolete.

Not sure about that one. The problem is that... Debug output should not be visible while player's just playing. And it should be visible when player will actually need it (or when we'll ask player to turn it on). For this purpose config line is perfect imo. But ye, we'll need to add more debug statements probably. Also... Imagine amount of log output and how you're trying to find certain line you actually need. Maybe it's possible to categorize them. And toggle certain groups of debug statements. But idk. Might be okay even without that

MrJake222 commented 3 years ago

Three examples with references to other mods in separate classes. Plus my personal experience + it's working, ye. So I think it's okay to use other mods classes (if you're referencing these mods in a separate class file which isn't used when mod X isn't loaded)

Maybe It's different. In my link I was using Minecraft classes which are phisically stripped from the server .jar. So it seemed natural to do it the way I did it. We'll see.

Not sure about that one. The problem is that... Debug output should not be visible while player's just playing.

Minecraft launcher has a logging window. You can set loglevel there. And even now tons of mods are writing to debug.log and it gets huge fast (but then it's compressed). And having that detailed info about rare bugs would be nice.

Imagine amount of log output and how you're trying to find certain line you actually need.

I mean in debug environment you can write whatever you want to the INFO channel and get this specific lines. Just remove it or move it to DEBUG(the useful ones) once finished. Even with built-in option to enable debug there would be tons of lines spamming the latest.log and Eclipse console.