Allow the Orb of Armok to work from within a Blood Altar. (#89)

Adds a new method isFilledForFree to IBloodOrb which is false by default, but may be used by orbs like the Orb of Armok to be filled instantly by the Blood Altar.
This commit is contained in:
Abdiel Kavash authored and GitHub committed 2025-05-27 15:53:44 -04:00
1 parent 47f5e1e594
commit 485e462a83
3 files changed
+31 -3

No files matched your search

@@ -5,4 +5,8 @@ public interface IBloodOrb {
int getMaxEssence();
int getOrbLevel();
default boolean isFilledForFree() {
return false;
}
}
@@ -629,6 +629,30 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
return;
}
if (item.isFilledForFree()) {
// Fill owner's network to the maximum, affected by altar runes.
SoulNetworkHandler.addCurrentEssenceToMaximum(
ownerName,
Integer.MAX_VALUE,
(int) Math.min(Integer.MAX_VALUE, (long) item.getMaxEssence() * this.orbCapacityMultiplier));
if (totalWorldTime % 4 == 0) {
SpellHelper.sendIndexedParticleToAllAround(
worldObj,
xCoord,
yCoord,
zCoord,
20,
worldObj.provider.dimensionId,
3,
xCoord,
yCoord,
zCoord);
}
return;
}
if (fluid != null && fluid.amount >= 1) {
int liquidDrained = Math.min(
(int) (upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate),