Skip to content

Skip zero-amount mana transfers between sparks#4965

Closed
cjlarose wants to merge 2 commits intoVazkiiMods:1.20.xfrom
cjlarose:fix-zero-mana-transfers
Closed

Skip zero-amount mana transfers between sparks#4965
cjlarose wants to merge 2 commits intoVazkiiMods:1.20.xfrom
cjlarose:fix-zero-mana-transfers

Conversation

@cjlarose
Copy link
Contributor

When a dominant spark needs a small amount of mana (e.g., 2 mana) but has many inbound sparks available (e.g., 12), integer division in the fair share calculation causes most sparks to compute gained=0. This resulted in unnecessary receiveMana() calls and particle effects for transfers that moved no actual mana.

The proposed change performs transfers and spawns particles when gained > 0, reducing visual clutter and eliminating redundant operations.

Related

When a dominant spark needs a small amount of mana (e.g., 2 mana) but
has many inbound sparks available (e.g., 12), integer division in the
fair share calculation causes most sparks to compute gained=0. This
resulted in unnecessary receiveMana() calls and particle effects for
transfers that moved no actual mana.

Now only performs transfers and spawns particles when gained > 0,
reducing visual clutter and eliminating redundant operations.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@cjlarose
Copy link
Contributor Author

FWIW, the same issue doesn't appear to apply to outgoing transfers. In other words, spend here is never 0 in my testing

int spend = Math.min(attached.getAvailableSpaceForMana(), (manaTotal - manaSpent) / (count + 1));

@TheRealWormbo
Copy link
Collaborator

Presumably that's because it's going to stop sending when it's out of mana, and if multiple source spawns are pushing towards the same target spark, they will be acting in tick order, one after another.
I'll have to try this one before I merge, just to make sure. Unfortunately I don't know when exactly that will be, but likely some time during the week.

@NEstoll
Copy link
Contributor

NEstoll commented Feb 16, 2026

FWIW, the same issue doesn't appear to apply to outgoing transfers. In other words, spend here is never 0 in my testing

int spend = Math.min(attached.getAvailableSpaceForMana(), (manaTotal - manaSpent) / (count + 1));

It does happen, you just need a source that generates a small amount of mana rapidly, of which there aren't many in base Botania. Letting a mana mirror accept mana from items and using an aura band shows it pretty well

@cjlarose
Copy link
Contributor Author

FWIW, the same issue doesn't appear to apply to outgoing transfers. In other words, spend here is never 0 in my testing

int spend = Math.min(attached.getAvailableSpaceForMana(), (manaTotal - manaSpent) / (count + 1));

It does happen, you just need a source that generates a small amount of mana rapidly, of which there aren't many in base Botania. Letting a mana mirror accept mana from items and using an aura band shows it pretty well

Oh perfect. I'll see if I can reproduce this and if so, I'll make the change to the outgoing transfers as well

@cjlarose cjlarose changed the title Skip zero-amount transfers in dominant spark inbound transfers Skip zero-amount mana transfers between sparks Feb 17, 2026
When a recessive spark has a small amount of mana (e.g., 5 mana) but
many outbound transfers (e.g., 12), the calculated `spend` is 0 for some
transfers. This resulted in unnecessary receiveMana() calls and particle
effects for transfers that moved no actual mana.

This change performs transfers and spawns particles when spend > 0,
reducing visual clutter and eliminating redundant operations.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@cjlarose
Copy link
Contributor Author

I was able to successfully reproduce the same 0-mana transfer behavior by letting a Band of Aura add a little bit of mana to a Band of Mana and then dropping that Band of Mana into a recessive-sparked pool in range of some unaugmented-sparked pools (I wasn't able to figure out how to get the Band of Aura to push into a pool via a Mana Mirror).

I confirmed that 0-mana transfer happening with some debug log messages, made the change to skip those 0-mana transfers, and then verified from my logs that the change successfully removed the 0-mana transfers.

@TheRealWormbo
Copy link
Collaborator

I have to ask, because I only just noticed: Why are you committing changes this simple with the help of an LLM?

@Vazkii
Copy link
Member

Vazkii commented Feb 18, 2026

Hello.

After some chatter, we've reached the conclusion we are not interested in accepting LLM backed pull requests. There are several reasons behind this - chief among which being the additional load generated upon the current team (which is already operating on fumes) to review an increasing amount of PRs that may be prone to hallucinations or potential long-term complications from lack of understanding of project structure.

We appreciate the interest in providing us help, we absolutely do, but ultimately, we have determined that the downsides aren't worth it. Thank you for the initiative nontheless. With that in mind, we'll be closing this and any other open PRs authored by LLMs.

@Vazkii Vazkii closed this Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants