aurilisdev / Electrodynamics

Electrodynamics is a mod that brings realistic, world-based science and technology into Minecraft along with some other additions.
https://aurilis.dev/electrodynamics/
Other
72 stars 19 forks source link

Corrosive gas in a gas network leads to a crash as it tries to overload the network's steel pipes, which are apparently null #270

Closed 9thCore closed 1 month ago

9thCore commented 3 months ago

Repro:

  1. Tag any gas as corrosive under forge/tags/electrodynamics/gases/iscorrosive.json
  2. Increase its pressure so it can explode any pipe type
  3. Produce the now-corrosive gas
  4. Add a pipe rated for less pressure than the network currently hosts
  5. Crash

Test JSON: { "replace": false, "values": [ "electrodynamics:oxygen", "electrodynamics:hydrogen" ] }

Video: https://github.com/user-attachments/assets/527885d5-fa23-42c4-9ec5-a677914be37b

Log: https://mclo.gs/KekULpK

Technical data: (present in the logs as well, but for ease of verification) Minecraft 1.20.1 Forge 47.3.1 Electrodynamics 1.20.1-0.9.1-0 KubeJS 2001.6.5-build.14 (Used to load tag changes) Rhino 2001.2.2-build.18 (KJS dep) Architectury 9.2.14 (KJS dep)

9thCore commented 3 months ago

admittedly i should have verified before opening the issue, but it does happen with just Electrodynamics as well, so its not a KJS incompatibility

9thCore commented 3 months ago

Been playing around with this for a bit, and it seems like the cause is not related to corrosive gasses: it errors if a steel pipe type should explode as a result of the gas transfer, which just so happens to occur only when the gas is corrosive as the 100 pressure required to destroy a steel pipe cannot be reached(?). The NullPointerException is caused by conductorTypeMap.get(SubtypeGasPipe.UNINSULATEDSTEEL) being null. Still unsure why, however, as debugging seems to indicate it should be set up properly and exist no issue... EDIT: I forgot to mention how gas pressure should exceed the minimum pressure in the network, such that line 326 passes

skiprocks999 commented 1 month ago

Good catch.