FabricMC / fabric

Essential hooks for modding with Fabric.
Apache License 2.0
2.32k stars 408 forks source link

Crash on world load (Fabric / Tech Reborn) #1941

Closed thethrax closed 2 years ago

thethrax commented 2 years ago

Cross-posting this here incase it may be Fabric-api related.. https://github.com/TechReborn/TechReborn/issues/2697

Describe the bug Server crashes on startup: World load (Energy). Suspected Mods: Energy (team_reborn_energy), Minecraft (minecraft), Fabric Transfer API (v1) (fabric-transfer-api-v1), Tech Reborn (techreborn), Reborn Core (reborncore)

Steps to Reproduce Steps to reproduce the behavior:

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information with the version):

Logs https://pastebin.com/hLhiyuJD

Additional context Broken region file: https://drive.google.com/file/d/1hbJNXr-PnGtUQfaxGrL5S-kuxyEIdUVn/view?usp=sharing If I try to manually remove some of the powered devices via nbt explorer (eg. fluid replicator, matter fabricator, etc), the crash appears again but references a different ticking device hooked up to that power (lots of devices are in use)

An update: I removed all recyclers and a matter fabricator from that region, and the region works now... Hope that helps.

warjort commented 2 years ago

java.lang.IllegalArgumentException: Amount may not be negative, but it is: -224618 at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notNegative(StoragePreconditions.java:50) at team.reborn.energy.api.base.SimpleSidedEnergyContainer$SideStorage.extract(SimpleSidedEnergyContainer.java:92) at team.reborn.energy.api.EnergyStorageUtil.move(EnergyStorageUtil.java:42) at reborncore.common.powerSystem.PowerAcceptorBlockEntity.tick(PowerAcceptorBlockEntity.java:332) at techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity.tick(MatterFabricatorBlockEntity.java:116)

Your matter fabricator was trying to receive power but it was given a negative amount, which is obviously not allowed.

The only mention of the fabric api in the error is this sanity check itself, but the sanity check is really done by a team reborn energy class. It reuses the fabric api check.

If I try to manually remove some of the powered devices via nbt explorer ... the crash appears again but references a different ticking device hooked up to that power

This also points to a bug in whatever your power source is (all your machines are interacting with the same broken power source). The error message doesn't say what the power source is. It just mentions a helper class that it uses: team.reborn.energy.api.base.SimpleSidedEnergyContainer$SideStorage

I assume your power source is a Techborn generator of some variety?

The fabric api doesn't implement any generators. So this is unlikely to be a fabric issue.

The team reborn energy mod does use the fabric transfer api to transfer its energy, but that is responsible for doing the transfer, not determining the amount to be transferred.

Technici4n commented 2 years ago

Yes, this is a TR issue. Most likely a machine that contains more energy than its capacity, or a negative amount of energy.