Mekanism Tools

Mekanism Tools

77M Downloads

[1.15.2] NPE when non-Mekanism items are charged in a Creative Energy Cube while fully charged

MongoTheElder opened this issue ยท 3 comments

commented

Issue description:

When items are charged in a creative energy cube and are fully charged, the mod throws an NPE. Mekanism items don't show this behavior nor does charging the same items in any of the other Energy Cubes. One thing I noticed, the Creative Energy Cube still allowed fully charged non-Mekanism items to be inserted into the charge slot. The Creative Energy Cube didn't allow fully charged Mekanism items in the charge slot and none of the other Energy Cubes allowed fully charged items from any mod to be inserted into the charge slot so it appears that this is isolated to the Creative Energy Cube.

Steps to reproduce:

  1. Obtain a non-Mekanism chargeable item (I tested with a Mining Gadget and a Refined Storage Wireless Crafting Monitor)
  2. Place non-Mekanism item in the charge slot of a Creative Energy Cube
  3. When the item is fully charged, check the logs

Version (make sure you are on the latest version before reporting):

Tested both on a Dedicated Server and Single Player game
Forge version: 1.15.2-31.1.71
Mekanism version: 1.15.2-9.10.2.415
Mining Gadgets version: 1.3.5
Refined Storage version: 1.8.3

Other mods loaded:
Building Gadgets version: 3.3.5
Cucumber version: 1.15.2-3.0.5
Harvest Sprites version: 1.15.2-0.0.1
JEI version: 1.15.2-6.0.0.3
Journey Map version: 1.15.2-5.7.0beta1
McProfilerView version 1.0
Mystical Agriculture version: 1.15.2-3.0.3
Pam's Harvestcraft 2 Crops version: 1.15.2-1.0.3
Pane In The Glass version 1.15.2-1.2.1
Simple Farming version 1.15.2-1.2.7

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

Log from the dedicated server:
latest.log

commented

I will look into this more when I get a chance sometime before 9.10.3. But one slight clarification is its not a NPE, the "null" is the fact I didn't pass a message to the exception that I use for making it easier to track down. My guess given it doesn't happen with Mekanism items, is either there is a bug in how the other mods are implementing their simulation or there may be a bug in our energy wrapper/conversion.

commented

Sorry about that, I have been so engulfed with debugging my other mod that everything looks like an NPE now so didn't look that closely ;p

I tested items from two different mods to see if it was an anomaly of the item implementation. It might just be a misunderstanding of the charging API if it isn't an issue with the Creative Energy Cube

commented

I looked at the code briefly and I believe it is an issue on our end. Basically I have our wrapper around forge energy returning the wrong value for large numbers, and am clamping something more aggressively than I should be.