Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ReactorPowerTapTile.java does not invalidate capabilities #98

Open
TeamDman opened this issue Jul 5, 2024 · 3 comments
Open

[BUG] ReactorPowerTapTile.java does not invalidate capabilities #98

TeamDman opened this issue Jul 5, 2024 · 3 comments
Assignees
Labels
1.16 1.18 1.19 1.20 bug Something isn't working Priority: High This needs to be done as soon as possible.

Comments

@TeamDman
Copy link

TeamDman commented Jul 5, 2024

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 :(

@TeamDman
Copy link
Author

TeamDman commented Jul 5, 2024

    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

@RogueLogix
Copy link
Member

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.

@RogueLogix RogueLogix added bug Something isn't working 1.16 1.18 1.19 Priority: High This needs to be done as soon as possible. 1.20 labels Oct 6, 2024
@TeamDman
Copy link
Author

TeamDman commented Oct 6, 2024

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!

@RogueLogix RogueLogix self-assigned this Oct 7, 2024
RogueLogix added a commit that referenced this issue Nov 9, 2024
related #98
issue still present with fluid ports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.16 1.18 1.19 1.20 bug Something isn't working Priority: High This needs to be done as soon as possible.
Projects
None yet
Development

No branches or pull requests

2 participants