Files
Mekanism-Community-Edition/src/main/java/mekanism/tools/item/ItemMekanismHoe.java
T
Richard Freimer 034340eed1 Cleanup Tools Module code (#5578)
* Make most mekanism tools extend the vanilla tool class

* Move things around slightly

* ATs and work on making the paxel's behaviour be identical to the axe, pickaxe, or shovel it represents

* Keep track of normal tools via the Paxel

* Set the Material's Repair Stack

* Cleanup material repair stack registry

* Small spacing changes

* Replace ToolsItems with ToolsItem

* Cleanup adding smelting recipes

* Move the various materials into an enum

* Ensure the Materials doesn't read the config values before the config is loaded if somewhere it is referenced ends up being called

* Minor cleanup/add some comments

* Show repair recipes in JEI, and fix it so that you can smelt any damage into a nugget like vanilla

* Minor code cleanup to entity equipment spawning

* Make sure the paxel canHarvestBlock uses the correct mining level

* Switch back to if statements for setting entity equipment

* Remove unneeded code that gets handled by ForgeHooks anyways

* Make sure to refresh the Item references
2019-08-04 20:01:42 -04:00

30 lines
978 B
Java

package mekanism.tools.item;
import java.util.List;
import mekanism.common.util.LangUtils;
import mekanism.tools.common.IHasRepairType;
import mekanism.tools.common.Materials;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemMekanismHoe extends ItemHoe implements IHasRepairType {
public ItemMekanismHoe(Materials material) {
super(material.getMaterial());
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemstack, World world, List<String> list, ITooltipFlag flag) {
list.add(LangUtils.localize("tooltip.hp") + ": " + (itemstack.getMaxDamage() - itemstack.getItemDamage()));
}
@Override
public ItemStack getRepairStack() {
return toolMaterial.getRepairItemStack();
}
}