mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
Compare commits
4
Commits
master
...
1.7.42-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7be69979d0 | ||
|
|
8dae648a0c | ||
|
|
e6c7496141 | ||
|
|
09a104314b |
No files matched your search
+2
-2
@@ -24,9 +24,9 @@
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api("com.github.GTNewHorizons:waila:1.8.8:dev")
|
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:Botania:1.12.12-GTNH:api") {transitive = false }
|
||||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.13: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.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModItems;
|
import WayofTime.alchemicalWizardry.ModItems;
|
||||||
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
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.items.sigil.holding.SigilOfHolding;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
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) {
|
public int getComparatorInputOverride(World world, int x, int y, int z, int meta) {
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
if (tile instanceof TEAltar) {
|
if (!(tile instanceof TEAltar altar)) {
|
||||||
ItemStack stack = ((TEAltar) tile).getStackInSlot(0);
|
return 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user