PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Crash while importing code from pastebing

MuteTiefling opened this issue · 9 comments

commented

Describe the bug

Attempting to import this: https://pastebin.com/3g6dBxui

How to reproduce the bug

  1. Open Programmer
  2. Copy JSON code from https://pastebin.com/3g6dBxui
  3. Go to Import
  4. Import from Clipboard
  5. Crash

Expected behavior

No crash :D

Additional details

No response

Which Minecraft version are you using?

1.21

Which version of PneumaticCraft: Repressurized are you using?

pneumaticcraft-repressurized-8.0.2+mc1.21

Crash log

https://gist.github.com/MuteTiefling/1020165101a78270c34bf7416c0fc9e6

commented

Hrm alright. I guess I'll see if that persists after we get everything updated to 1.21.1 first. Thanks for looking into it, I appreciate the insight.

commented

Also crashes when importing from the link directly. Not surprising as it appears to have some issue with a widget specifically.

commented

java.lang.NoSuchMethodError: 'boolean com.google.gson.JsonObject.isEmpty()'

That is one of those impossible situations, because that method is definitely a Real Thing (tm): https://www.javadoc.io/doc/com.google.code.gson/gson/latest/com.google.gson/com/google/gson/JsonObject.html#isEmpty()

So why your instance isn't finding it is a bit of a puzzle...

commented

For testing purposes, I loaded that URL in my dev server and it went fine. So something in your instance is definitely messing up your GSON library. I noticed that isEmpty is only added in GSON 2.10.1, which is present in my dev instance (as part of NeoForge). So something in your instance is probably loading an older version which is getting picked up by PNC here.

As a workaround, I could change the .isEmpty() calls to .size() == 0, but I would strongly recommend trying to track down why you've apparently got a old version of GSON in there, since it's likely to cause other problems down the line...

commented

Also, I thought I recognised that program 😛

Here's a version converted to V3 progwidget json: https://pastebin.com/zQm5DKSi

commented

So, I've gone digging a bit myself, because PNC isn't the only one affected by this issue, and Long Story Short - It's the vanilla Launcher Issue.

NeoForge does indeed ship with GSON 2.10.1, and launchers like MultiMC correctly include 2.10.1 in the classpath - everything works just fine on there. However Vanilla Launcher (which CF uses), includes 2.10 GSON in the classpath, causing the entire issue...

Update: The cause of Vanilla launcher including old version of the GSON library is Neo, the installer has old version specified in the version.json file >.>

commented

Seems they have an issue opened for it too: neoforged/NeoForge#1380

commented

Yeah, that would explain it. In the short term, I'll use that workaround I mentioned above (.size() is definitely in 2.10).

commented

Worked around in 8.1.1