Makes the Blood Altar behave predictably when items are moved in and out by hoppers, pipes, or any other automation.
The problem
The Blood Altar has a single slot. It continuously pumps LP into whatever sits there until the item finishes infusing and turns into its product.
That design works fine when a player is operating the altar by hand. It falls apart the moment automation gets involved:
| What happens | What goes wrong |
|---|---|
| A pipe or hopper pulls an item out before infusion has started | The insertion was wasted, and the item just gets shoved back in again |
| An item that is already finished — or was already infused once — is still in the slot, or gets reinserted | The altar keeps doing work on it |
There is a deeper issue underneath. The altar stores infusion progress on itself, not on the item (BloodAltar.progress). So when an item is pulled out, the progress stays behind in the altar — and if a different item is then inserted, the altar carries on from that leftover progress. The semantics are simply in the wrong place.
This mod gives each item a mark of its own, tying the semantics back to the item.
The three rules
| # | Rule |
|---|---|
| 1 | Once an item has been fully infused, the altar leaves it alone |
| 2 | An item that leaves the altar has its mark cleared — inserting it again counts as a new visit |
| 3 | An item that has an altar recipe and has not been infused yet cannot be pulled out by hoppers or pipes |
A worked example
- A pipe inserts a diamond → infusion starts, and the pipe cannot pull it back out
- Infusion completes → the item becomes its product and is marked
- The product sits in the slot → the altar ignores it completely (no LP consumed)
- The pipe extracts the product → the mark is cleared
- The pipe inserts it again → no mark → back to step 1, usable again
Two deliberate safety lines
These are intentional. If you are reading the source, do not delete them thinking they are redundant checks.
① It blocks automation, not players. The only path that gets filtered is Forge's item handler (IItemHandler) — the one hoppers and pipes use. A player right-clicking an item out goes through the block's own interaction code and can always take it. Locking players out as well would be a worse trap than the original problem.
② It only locks items the altar can actually process. The condition requires both:
- the item has an altar recipe, and
- that recipe's tier requirement does not exceed the altar's current tier
The second half cannot be dropped. If the altar's tier is too low, the item simply cannot be processed — locking it would make it permanently unextractable and jam the pipe. There is an easy mistake here worth spelling out: AltarTier.toInt() returns ordinal() + 1, while the altar's own check uses ordinal() — they are off by one, and getting it wrong locks items the altar cannot even work on.
By the same token, an item with no altar recipe at all (dirt, cobblestone, and so on) can be extracted as normal and is never locked.
What it does not change
- No new content. No blocks, no items, no recipes.
- Blood Orb filling is untouched. Charging a Blood Orb by leaving it in the altar is a legitimate part of Blood Magic, and this mod does not interfere with it. Only the normal recipe-crafting path is affected.
- It does not touch Blood Magic's own config. It has a separate config file of its own.
Configuration
File: config/bloodmagicaltarautomationoptimization-common.toml
| Option | Default | Meaning |
|---|---|---|
enabled |
true |
Master switch. Set to false to restore Blood Magic's original behaviour — identical to not having the mod installed |
Compatibility
- Every injection point lands inside
wayoftime.bloodmagic.*. It does not inject into vanilla Minecraft classes, Forge classes, or any other mod's classes. - Two mixin classes, three injection points.
- No conflict with automation mods — hopper, pipe, AE2, Refined Storage and the like. This mod changes exactly the path those mods use.
- Requires Minecraft 1.20.1 / Forge and Blood Magic 3 (declared as a mandatory dependency, any 3.x).
Tested against Blood Magic 3.3.8-50 on 1.20.1.
If Blood Magic ever renames or moves the two methods this hooks into, the mod simply does nothing rather than crashing — the mixin config is declared as not required.
Known limitations
- The mark is stored in the item's NBT and is cleared when the item leaves the altar, so under normal operation it never reaches your storage system.
- If an item is removed by an unusual route — breaking the altar block, for example — the mark can linger for a while. The visible symptom is that the item gets ignored while it is in an altar. Taking it out by hand and putting it back restores it.
Licence and attribution
Released under Apache-2.0 (SPDX-License-Identifier: Apache-2.0). Full text in [LICENSE], third-party attribution in [NOTICE].
This mod modifies Blood Magic's classes at runtime through Mixin. It does not copy or redistribute any of Blood Magic's source code or assets — the jar contains none of it. Blood Magic is published under Creative Commons Attribution 4.0 International (CC BY 4.0), which permits modification and redistribution and carries no ShareAlike clause — which is why this mod is able to ship under Apache-2.0. See NOTICE for the full reasoning.
This is an unofficial third-party add-on. It is not affiliated with, and not endorsed by, WayofTime or the Blood Magic team. Thanks to WayofTime and every Blood Magic contributor.
要我把这份也存成桌面上的 .md 吗?另外你另外两个带 "Blood Magic" 名字的 mod 我还没动 —— 需要的话一起处理。
只讲对我们有益的
Blood Magic Altar Automation Optimization
Stop your hoppers and pipes from fighting the Blood Altar.
The problem, in one line
The altar keeps infusion progress on itself rather than on the item, so automation has no way to tell "already done" from "not started yet". The result is wasted LP, items pulled out mid-infusion, and finished products being worked on again.
What this mod does
| # | Rule |
|---|---|
| 1 | Once an item has been fully infused, the altar leaves it alone — no more LP burned on a finished product |
| 2 | An item that leaves the altar has its mark cleared, so inserting it again counts as a new visit and it can be infused again |
| 3 | An item that has an altar recipe and has not been infused yet cannot be pulled out — automation can no longer yank it away mid-infusion |
A worked example
- A pipe inserts a diamond → infusion starts, and the pipe cannot pull it back out
- Infusion completes → the item becomes its product and is marked
- The product sits in the slot → the altar ignores it completely, consuming nothing
- The pipe extracts the product → the mark is cleared
- The pipe inserts it again → no mark → back to step 1, usable again
What you get
- Your automation stops breaking the altar. No more items pulled out before infusion begins, no more items shoved back in and reworked.
- No more wasted LP. A finished product sitting in the slot costs you nothing.
- Players can always take items out by hand. Only hoppers and pipes are filtered — the Forge item-handler path. Right-clicking an item out goes through the block's own interaction code and is never blocked. You will not lock yourself out of your own altar.
- Your pipes cannot jam. The lock only applies to items the altar can actually process — ones with a recipe the altar's tier meets. Dirt, cobblestone, and anything the altar cannot work on stays freely extractable, so nothing gets stuck.
- Nothing new is added. No blocks, no items, no recipes, no changes to Blood Magic's own config.
- Blood Orb filling is untouched. Leaving a Blood Orb in the altar to charge is normal Blood Magic, and this mod stays out of it. Only the normal recipe-crafting path is affected.
- No conflicts with your automation mods. Hoppers, pipes, AE2, Refined Storage, and anything else using the item-handler path are exactly what this mod is designed around. Every injection point sits inside
wayoftime.bloodmagic.*— nothing in vanilla, nothing in Forge, nothing in anyone else's mod. - It will not crash your game. If Blood Magic ever moves the methods this hooks into, the mod quietly does nothing instead of taking your instance down with it*
- One switch to turn it all off — and turning it off restores Blood Magic's original behaviour exactly, as if the mod were never installed.
Requirements
- Minecraft 1.20.1 / Forge
- Blood Magic 3 (mandatory dependency, any 3.x)
Tested against Blood Magic 3.3.8-50 on 1.20.1.
Configuration
config/bloodmagicaltarautomationoptimization-common.toml
| Option | Default | Meaning |
|---|---|---|
enabled |
true |
Master switch. Set to false to restore Blood Magic's original behaviour |