Bigger Reactors

Bigger Reactors

17M Downloads

[BUG] ReactorPowerTapTile.java does not invalidate capabilities

TeamDman opened this issue ยท 3 comments

commented

ReactorPowerTapTile.java and its ancestors ReactorBaseTile and PhosphophylliteTile do not override invalidateCaps

PhosphophylliteTile.java::onRemove(boolean chunkUnload) (a Phos mod method) is overridden by PowerBlackHoleTile.java to invalidate the capability apparently

    @Override
    public void onRemoved(boolean chunkUnload) {
        energyHandler.invalidate();
    }

but for ReactorPowerTapTile.java I don't see it doing anything similar.

I put a breakpoint on private void invalidate(LazyOptional<IPhosphophylliteEnergyHandler> ignored) { inside IEnergyTile.java and it doesn't get hit when the chunk is being unloaded.

My mod's invalidation listener isn't getting fired which is how I found this :(

commented
    runtimeOnly fg.deobf("curse.maven:bigger-reactors-407780:4883087") //biggerreactors-1.20.1-0.6.0-beta.10.4.jar
    runtimeOnly fg.deobf("curse.maven:phosphophyllite-412551:5122727") //phosphophyllite-1.20.1-0.7.0-alpha.0.1.jar
    runtimeOnly fg.deobf("curse.maven:quartz-552262:5122746") //quartz-1.20.1-0.2.0-alpha.0.1.jar

Demonstration of my mod's cache not getting invalidated because the reactor capability isn't invalidated

java_capVjFDemZ.mp4
commented

generally its expected that mods that can take power accept a push from a producer, in which case this should still function despite behaving incorrectly. I will correct this, however for the sake of general compatibility you should also be listening form your side for block changes and re-check for capabilities rather than relying solely on the capability to be invalidated, I am probably not the only one failing to invalidate caps on block removal.

commented

Yeah I only noticed this because I forgot to bust my cache when chunks were unloading lol.

In my case, SFM only can pull power from capabilities and its cables have no buffer for RF producers to push into which has also caused problems with flux plugs.

SFM for now is not listening to block update events for invalidation, if it becomes a bigger problem that's a good area for me to look into.

Thanks!