Add tooltip information to Seismic Reader

Added some information about usage to the Seismic Reader, almost the same as the Seismic Vibrator.
Adds feature #4743
This commit is contained in:
Tom E authored and GitHub committed 2017-10-08 16:11:52 +02:00
1 parent 9c7164c0db
commit bec37bfbe2
2 files changed
+26 -1

No files matched your search

@@ -2,9 +2,13 @@ package mekanism.common.item;
import mekanism.api.Chunk3D;
import mekanism.api.EnumColor;
import mekanism.client.MekKeyHandler;
import mekanism.client.MekanismKeyHandler;
import mekanism.common.Mekanism;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
@@ -13,6 +17,8 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import java.util.List;
public class ItemSeismicReader extends ItemEnergized
{
public static final double ENERGY_USAGE = 250;
@@ -27,7 +33,25 @@ public class ItemSeismicReader extends ItemEnergized
{
return false;
}
@Override
public void addInformation(ItemStack itemstack, World world, List<String> list, ITooltipFlag flag)
{
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
{
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails") + ".");
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.and") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.modeSwitchKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDesc") + ".");
}
else if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.modeSwitchKey))
{
super.addInformation(itemstack, world, list, flag);
}
else
{
list.addAll(MekanismUtils.splitTooltip(LangUtils.localize("tooltip.mekanism.SeismicReader"), itemstack));
}
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer entityplayer, EnumHand hand)
{
@@ -805,6 +805,7 @@ tooltip.flamethrower.modeBump=Flamethrower mode bumped to
tooltip.seismicReader.needsEnergy=Not enough energy to interpret vibration
tooltip.seismicReader.noVibrations=Unable to discover any vibrations
tooltip.mekanism.SeismicReader=A portable machine that uses seismic vibrations to provide information on differing layers of the world.
tooltip.Bin=A block used to store large quantities of a single type of item.
tooltip.TeleporterFrame=The frame used to construct the Teleporter multiblock, allowing a portal to be generated within the structure.