ConstructionWand/src/main/java/thetadev/constructionwand/items/wand/ItemWandBasic.java
Theta-Dev 39e02d8fe6 Added crafting recipes for wand cores
Wand core list in tooltip
Tooltips for wand cores
2021-03-08 01:33:19 +01:00

32 lines
908 B
Java

package thetadev.constructionwand.items.wand;
import net.minecraft.item.IItemTier;
import net.minecraft.item.ItemStack;
import thetadev.constructionwand.basics.ConfigServer;
import javax.annotation.Nonnull;
public class ItemWandBasic extends ItemWand
{
private final IItemTier tier;
public ItemWandBasic(String name, Properties properties, IItemTier tier) {
super(name, properties.maxDamage(tier.getMaxUses()));
this.tier = tier;
}
@Override
public int getMaxDamage(ItemStack stack) {
return ConfigServer.getWandProperties(this).getDurability();
}
@Override
public int remainingDurability(ItemStack stack) {
return stack.getMaxDamage() - stack.getDamage();
}
@Override
public boolean getIsRepairable(@Nonnull ItemStack toRepair, @Nonnull ItemStack repair) {
return this.tier.getRepairMaterial().test(repair);
}
}