Compare commits

...
2 Commits
Author SHA1 Message Date
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 16 additions and 7 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 }
@@ -71,12 +71,21 @@ public class BlockAltar extends BlockContainer {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TEAltar) {
ItemStack stack = ((TEAltar) tile).getStackInSlot(0);
TEAltar altar = (TEAltar) tile;
if (stack != null && stack.getItem() instanceof EnergyBattery) {
EnergyBattery bloodOrb = (EnergyBattery) stack.getItem();
int maxEssence = bloodOrb.getMaxEssence();
int currentEssence = bloodOrb.getCurrentEssence(stack);
if (world.getBlock(x, y - 1, z) instanceof LargeBloodStoneBrick) {
ItemStack stack = altar.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;
}
} else {
int maxEssence = altar.getCapacity();
int currentEssence = altar.getCurrentBlood();
int level = currentEssence * 15 / maxEssence;
return Math.min(15, level) % 16;
}