com.magistuarmory.item.ModItemTier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of 1.20.2-epic-knights-common Show documentation
Show all versions of 1.20.2-epic-knights-common Show documentation
mod that adds medieval stuff to the game
package com.magistuarmory.item;
import dev.architectury.platform.Platform;
import java.util.function.Supplier;
import net.minecraft.class_1832;
import net.minecraft.class_1834;
import net.minecraft.class_1856;
import net.minecraft.class_2960;
import net.minecraft.class_6862;
import net.minecraft.class_7924;
public class ModItemTier implements class_1832
{
private final String name;
private final float attackDamageBonus;
private final int enchantmentValue;
private final int level;
private final Supplier repairIngredient;
private final float speed;
private final int uses;
private final float density;
public static ModItemTier WOOD = new ModItemTier("wood", class_1834.field_8922, 0);
public static ModItemTier STONE = new ModItemTier("stone", class_1834.field_8927, 1);
public static ModItemTier IRON = new ModItemTier("iron", class_1834.field_8923, 2);
public static ModItemTier DIAMOND = new ModItemTier("diamond", class_1834.field_8930, 3);
public static ModItemTier GOLD = new ModItemTier("gold", class_1834.field_8929, 4);
public static ModItemTier NETHERITE = new ModItemTier("netherite", class_1834.field_22033, 5);
public static ModItemTier COPPER = new ModItemTier("copper", 1, 150, 0.7F, 0.0F, 10, Platform.isForge() ? "forge:ingots/copper" : "c:copper_ingots", 1);
public static ModItemTier SILVER = new ModItemTier("silver", 2, 230, 5.5F, 1.0F, 18, Platform.isForge() ? "forge:ingots/silver" : "c:silver_ingots", 2);
public static ModItemTier STEEL = new ModItemTier("steel", 2, 400, 6.0F, 2.5F, 14, Platform.isForge() ? "forge:ingots/steel" : "c:steel_ingots", 2);
public static ModItemTier TIN = new ModItemTier("tin", 2, 130, 6.0F, 0.0F, 20, Platform.isForge() ? "forge:ingots/tin" : "c:tin_ingots", 2);
public static ModItemTier BRONZE = new ModItemTier("bronze", 2, 200, 6.0F, 2.0F, 15, Platform.isForge() ? "forge:ingots/bronze" : "c:bronze_ingots", 2);
public ModItemTier(String name, class_1832 tier, float density)
{
this.name = name;
this.level = tier.method_8024();
this.uses = tier.method_8025();
this.speed = tier.method_8027();
this.attackDamageBonus = tier.method_8028();
this.enchantmentValue = tier.method_8026();
this.repairIngredient = tier::method_8023;
this.density = density;
}
public ModItemTier(String name, int level, int uses, float speed, float attack, int enchantment, String repairitemtag, float density)
{
this.name = name;
this.level = level;
this.uses = uses;
this.speed = speed;
this.attackDamageBonus = attack;
this.enchantmentValue = enchantment;
this.repairIngredient = () -> class_1856.method_8106(class_6862.method_40092(class_7924.field_41197, new class_2960(repairitemtag)));
this.density = density;
}
@Override
public float method_8028()
{
return attackDamageBonus;
}
@Override
public int method_8026()
{
return enchantmentValue;
}
@Override
public int method_8024()
{
return level;
}
@Override
public class_1856 method_8023()
{
return repairIngredient.get();
}
@Override
public float method_8027()
{
return speed;
}
@Override
public int method_8025()
{
return uses;
}
public String getMaterialName()
{
return name;
}
public float getDensity()
{
return density;
}
}