Compare commits

...
4 Commits
Author SHA1 Message Date
Martin Robertz 7be69979d0 Merge remote-tracking branch 'ctrlaltmilk/comparator-backport' into dev 2025-06-28 14:32:51 +02:00
ctrlaltmilk 8dae648a0c Rework implementation 2025-06-27 23:53:10 -07:00
Martin Robertz e6c7496141 update 2025-06-27 17:27:45 +02:00
ctrlaltmilk 09a104314b Backport WayofTime/BloodMagic@64660d2d28
This makes measuring the amount of blood in an altar much easier - previous
behavior of measuring the amount of LP in a soul network can be restored by
placing a large bloodstone brick below the altar.
2025-06-25 18:17:58 -07:00
2 changed files with 26 additions and 14 deletions

No files matched your search

+2 -2
View File
@@ -24,9 +24,9 @@
dependencies {
api("com.github.GTNewHorizons:waila:1.8.8:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.57-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.59-GTNH:dev")
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.353:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.357:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.12.12-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.13:api") {transitive = false }
@@ -18,7 +18,9 @@ import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import cpw.mods.fml.relauncher.Side;
@@ -70,19 +72,29 @@ public class BlockAltar extends BlockContainer {
public int getComparatorInputOverride(World world, int x, int y, int z, int meta) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TEAltar) {
ItemStack stack = ((TEAltar) tile).getStackInSlot(0);
if (stack != null && stack.getItem() instanceof EnergyBattery) {
EnergyBattery bloodOrb = (EnergyBattery) stack.getItem();
int maxEssence = bloodOrb.getMaxEssence();
int currentEssence = bloodOrb.getCurrentEssence(stack);
int level = currentEssence * 15 / maxEssence;
return Math.min(15, level) % 16;
}
if (!(tile instanceof TEAltar altar)) {
return 0;
}
return 0;
int maxEssence;
int currentEssence;
if (world.getBlock(x, y - 1, z) instanceof LargeBloodStoneBrick) {
ItemStack stack = altar.getStackInSlot(0);
if (stack == null || !(stack.getItem() instanceof IBloodOrb bloodOrb)
|| !(stack.getItem() instanceof IBindable)) {
return 0;
}
maxEssence = (int) (bloodOrb.getMaxEssence() * altar.getOrbMultiplier());
currentEssence = SoulNetworkHandler.getCurrentEssence(IBindable.getOwnerName(stack));
} else {
maxEssence = altar.getCapacity();
currentEssence = altar.getCurrentBlood();
}
return Math.min(15, currentEssence * 15 / maxEssence) % 16;
}
@Override