Skip zero-amount mana transfers between sparks#4965
Skip zero-amount mana transfers between sparks#4965cjlarose wants to merge 2 commits intoVazkiiMods:1.20.xfrom
Conversation
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>
|
FWIW, the same issue doesn't appear to apply to outgoing transfers. In other words, |
|
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. |
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 |
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>
|
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. |
|
I have to ask, because I only just noticed: Why are you committing changes this simple with the help of an LLM? |
|
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. |
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