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

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
{