diff --git a/changelog.txt b/changelog.txt index 07610793..e24e7f97 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Version 2.0.1-43 ------------------------------------------------------ - Added an initial method to divine where a blood rune is missing for the next tier of altar. +- Fixed an NPE with the Gathering of the Forsaken Souls ------------------------------------------------------ Version 2.0.1-42 diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java index d987aac4..ce7af24d 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java @@ -111,7 +111,9 @@ public class TileDemonCrystal extends TileEntity implements ITickable return 0; } - EnumDemonWillType type = EnumDemonWillType.values()[this.getBlockMetadata()]; + IBlockState state = worldObj.getBlockState(pos); + int meta = this.getBlockType().getMetaFromState(state); + EnumDemonWillType type = EnumDemonWillType.values()[meta]; double value = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); double percentDrain = willDrain <= 0 ? 1 : Math.min(1, value / willDrain);