Inform players if they are not using their Divination sigil

Should lower the amount of "why isn't my network filling?" questions.
This commit is contained in:
Nick 2016-02-05 18:05:44 -08:00
parent 10b58ee7ad
commit ca64ecfc66
2 changed files with 11 additions and 1 deletions
src/main
java/WayofTime/bloodmagic/item/sigil
resources/assets/bloodmagic/lang

View file

@ -1,9 +1,11 @@
package WayofTime.bloodmagic.item.sigil;
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
@ -15,6 +17,9 @@ 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()
@ -35,7 +40,11 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
if (position == null)
{
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
List<IChatComponent> toSend = new ArrayList<IChatComponent>();
if (!getOwnerName(stack).equals(PlayerHelper.getUsernameFromPlayer(player)))
toSend.add(new ChatComponentText(TextHelper.localize(tooltipBase + "otherNetwork", getOwnerName(stack))));
toSend.add(new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
ChatUtil.sendNoSpam(player, toSend.toArray(new IChatComponent[toSend.size()]));
return stack;
} else
{

View file

@ -199,6 +199,7 @@ tooltip.BloodMagic.sigil.air.desc=&oI feel lighter already...
tooltip.BloodMagic.sigil.bloodLight.desc=&oI see a light!
tooltip.BloodMagic.sigil.compression.desc=&oHands of diamonds
tooltip.BloodMagic.sigil.divination.desc=&oPeer into the soul
tooltip.BloodMagic.sigil.divination.otherNetwork=Peering into the soul of %s
tooltip.BloodMagic.sigil.divination.currentAltarTier=Current Tier: %d
tooltip.BloodMagic.sigil.divination.currentEssence=Current Essence: %,d LP
tooltip.BloodMagic.sigil.divination.currentAltarCapacity=Current Capacity: %,d LP