Luligabi1 / CoxinhaUtilities

A standalone utility mod adding random and ̶m̶o̶s̶t̶l̶y̶ always unoriginal things
https://www.curseforge.com/minecraft/mc-mods/coxinha-utilities
Other
4 stars 4 forks source link

Energy Trashcan NPE #26

Closed hlanuel closed 1 year ago

hlanuel commented 1 year ago

Hello, We've got an issue on our server using the modpack All of Fabrics 6. I accidentally used an Energy Trashcan instead of a basic trashcan. I used pipes to send items to the energy trashcan. After the pipes received items the server was constantly crashing when loading the chunk where the trashcan is placed. We had no other choice than reload a backup.

Here is the error from the logs :

Caused by: java.lang.NullPointerException: Cannot invoke "team.reborn.energy.api.EnergyStorage.supportsExtraction()" because "stackEnergy" is null
at me.luligabi.coxinhautilities.common.block.trashcan.energy.EnergyTrashCanBlockEntity.tick(EnergyTrashCanBlockEntity.java:53) ~[coxinhautilities-1.4.5+1.19.jar:?]
hlanuel commented 1 year ago
        if(stackEnergy != null & stackEnergy.supportsExtraction()) {
            EnergyStorageUtil.move(stackEnergy, blockEntity.energyStorage, Long.MAX_VALUE, null);
        }

We should have a && operator here

Luligabi1 commented 1 year ago

I'm releasing a fix on 1.19, 1.19.4 and 1.20 for this asap. Thank you for your report and sorry about your world, I'll be contacting the AOF crew to let them know about this