From c6b446faf92ec961eee1551afc473a33a33737d9 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Thu, 11 Feb 2016 15:44:32 -0500 Subject: [PATCH] Fixed uncommon error in the Seer and Divination sigils. --- .../item/sigil/ItemSigilDivination.java | 15 ++++++++------- .../bloodmagic/item/sigil/ItemSigilSeer.java | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilDivination.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilDivination.java index d2150db9..2cc95474 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilDivination.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilDivination.java @@ -1,6 +1,8 @@ package WayofTime.bloodmagic.item.sigil; -import WayofTime.bloodmagic.api.util.helper.PlayerHelper; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -11,15 +13,12 @@ import net.minecraft.world.World; import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.altar.IBloodAltar; import WayofTime.bloodmagic.api.iface.IAltarReader; -import WayofTime.bloodmagic.api.util.helper.BindableHelper; import WayofTime.bloodmagic.api.util.helper.NetworkHelper; +import WayofTime.bloodmagic.api.util.helper.PlayerHelper; import WayofTime.bloodmagic.tile.TileIncenseAltar; import WayofTime.bloodmagic.util.ChatUtil; import WayofTime.bloodmagic.util.helper.TextHelper; -import java.util.ArrayList; -import java.util.List; - public class ItemSigilDivination extends ItemSigilBase implements IAltarReader { public ItemSigilDivination() @@ -36,10 +35,11 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader if (!world.isRemote) { MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false); - int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence(); if (position == null) { + int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence(); + List toSend = new ArrayList(); if (!getOwnerName(stack).equals(PlayerHelper.getUsernameFromPlayer(player))) toSend.add(new ChatComponentText(TextHelper.localize(tooltipBase + "otherNetwork", getOwnerName(stack)))); @@ -56,7 +56,7 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader { IBloodAltar altar = (IBloodAltar) tile; int tier = altar.getTier().ordinal() + 1; - currentEssence = altar.getCurrentBlood(); + int currentEssence = altar.getCurrentBlood(); int capacity = altar.getCapacity(); altar.checkTier(); ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentAltarTier", tier), TextHelper.localize(tooltipBase + "currentEssence", currentEssence), TextHelper.localize(tooltipBase + "currentAltarCapacity", capacity)); @@ -68,6 +68,7 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentTranquility", (int) ((100D * (int) (100 * tranquility)) / 100d)), TextHelper.localize(tooltipBase + "currentBonus", (int) (100 * altar.incenseAddition))); } else { + int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence(); ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence)); } diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilSeer.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilSeer.java index a9c488e5..6be0242f 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilSeer.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilSeer.java @@ -1,6 +1,5 @@ package WayofTime.bloodmagic.item.sigil; -import WayofTime.bloodmagic.api.Constants; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -8,9 +7,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.altar.IBloodAltar; import WayofTime.bloodmagic.api.iface.IAltarReader; -import WayofTime.bloodmagic.api.util.helper.BindableHelper; import WayofTime.bloodmagic.api.util.helper.NetworkHelper; import WayofTime.bloodmagic.tile.TileIncenseAltar; import WayofTime.bloodmagic.util.ChatUtil; @@ -32,10 +31,10 @@ public class ItemSigilSeer extends ItemSigilBase implements IAltarReader if (!world.isRemote) { MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false); - int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence(); if (position == null) { + int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence(); ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence))); return stack; } else @@ -49,7 +48,7 @@ public class ItemSigilSeer extends ItemSigilBase implements IAltarReader { IBloodAltar altar = (IBloodAltar) tile; int tier = altar.getTier().ordinal() + 1; - currentEssence = altar.getCurrentBlood(); + int currentEssence = altar.getCurrentBlood(); int capacity = altar.getCapacity(); int charge = altar.getTotalCharge(); altar.checkTier(); @@ -73,6 +72,7 @@ public class ItemSigilSeer extends ItemSigilBase implements IAltarReader ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentTranquility", ((int) (100 * tranquility)) / 100d), TextHelper.localize(tooltipBase + "currentBonus", (int) (100 * altar.incenseAddition))); } else { + int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence(); ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence)); }