Fixed uncommon error in the Seer and Divination sigils.

This commit is contained in:
WayofTime 2016-02-11 15:44:32 -05:00
parent 69eb621fc8
commit c6b446faf9
2 changed files with 12 additions and 11 deletions

View file

@ -1,6 +1,8 @@
package WayofTime.bloodmagic.item.sigil; 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.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -11,15 +13,12 @@ import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.altar.IBloodAltar; import WayofTime.bloodmagic.api.altar.IBloodAltar;
import WayofTime.bloodmagic.api.iface.IAltarReader; 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.NetworkHelper;
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
import WayofTime.bloodmagic.tile.TileIncenseAltar; import WayofTime.bloodmagic.tile.TileIncenseAltar;
import WayofTime.bloodmagic.util.ChatUtil; import WayofTime.bloodmagic.util.ChatUtil;
import WayofTime.bloodmagic.util.helper.TextHelper; import WayofTime.bloodmagic.util.helper.TextHelper;
import java.util.ArrayList;
import java.util.List;
public class ItemSigilDivination extends ItemSigilBase implements IAltarReader public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
{ {
public ItemSigilDivination() public ItemSigilDivination()
@ -36,10 +35,11 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
if (!world.isRemote) if (!world.isRemote)
{ {
MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false); MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false);
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
if (position == null) if (position == null)
{ {
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
List<IChatComponent> toSend = new ArrayList<IChatComponent>(); List<IChatComponent> toSend = new ArrayList<IChatComponent>();
if (!getOwnerName(stack).equals(PlayerHelper.getUsernameFromPlayer(player))) if (!getOwnerName(stack).equals(PlayerHelper.getUsernameFromPlayer(player)))
toSend.add(new ChatComponentText(TextHelper.localize(tooltipBase + "otherNetwork", getOwnerName(stack)))); 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; IBloodAltar altar = (IBloodAltar) tile;
int tier = altar.getTier().ordinal() + 1; int tier = altar.getTier().ordinal() + 1;
currentEssence = altar.getCurrentBlood(); int currentEssence = altar.getCurrentBlood();
int capacity = altar.getCapacity(); int capacity = altar.getCapacity();
altar.checkTier(); altar.checkTier();
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentAltarTier", tier), TextHelper.localize(tooltipBase + "currentEssence", currentEssence), TextHelper.localize(tooltipBase + "currentAltarCapacity", capacity)); 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))); ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentTranquility", (int) ((100D * (int) (100 * tranquility)) / 100d)), TextHelper.localize(tooltipBase + "currentBonus", (int) (100 * altar.incenseAddition)));
} else } else
{ {
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence)); ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence));
} }

View file

@ -1,6 +1,5 @@
package WayofTime.bloodmagic.item.sigil; package WayofTime.bloodmagic.item.sigil;
import WayofTime.bloodmagic.api.Constants;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -8,9 +7,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.altar.IBloodAltar; import WayofTime.bloodmagic.api.altar.IBloodAltar;
import WayofTime.bloodmagic.api.iface.IAltarReader; 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.NetworkHelper;
import WayofTime.bloodmagic.tile.TileIncenseAltar; import WayofTime.bloodmagic.tile.TileIncenseAltar;
import WayofTime.bloodmagic.util.ChatUtil; import WayofTime.bloodmagic.util.ChatUtil;
@ -32,10 +31,10 @@ public class ItemSigilSeer extends ItemSigilBase implements IAltarReader
if (!world.isRemote) if (!world.isRemote)
{ {
MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false); MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false);
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
if (position == null) if (position == null)
{ {
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence))); ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
return stack; return stack;
} else } else
@ -49,7 +48,7 @@ public class ItemSigilSeer extends ItemSigilBase implements IAltarReader
{ {
IBloodAltar altar = (IBloodAltar) tile; IBloodAltar altar = (IBloodAltar) tile;
int tier = altar.getTier().ordinal() + 1; int tier = altar.getTier().ordinal() + 1;
currentEssence = altar.getCurrentBlood(); int currentEssence = altar.getCurrentBlood();
int capacity = altar.getCapacity(); int capacity = altar.getCapacity();
int charge = altar.getTotalCharge(); int charge = altar.getTotalCharge();
altar.checkTier(); 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))); ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentTranquility", ((int) (100 * tranquility)) / 100d), TextHelper.localize(tooltipBase + "currentBonus", (int) (100 * altar.incenseAddition)));
} else } else
{ {
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence)); ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence));
} }