From f0f6af3eac5c2a1e9c43e0487c9f718bc8d61e8e Mon Sep 17 00:00:00 2001 From: WayofTime Date: Tue, 7 Jun 2016 10:15:40 -0400 Subject: [PATCH] Fixed #782 --- changelog.txt | 1 + src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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);