NaturesAura/src/main/java/de/ellpeck/naturesaura/reg/ModItemTier.java

63 lines
1.7 KiB
Java
Raw Normal View History

2019-11-04 19:08:49 +01:00
package de.ellpeck.naturesaura.reg;
import de.ellpeck.naturesaura.items.ModItems;
2021-12-04 19:17:21 +01:00
import net.minecraft.world.item.Tier;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.common.util.Lazy;
2019-11-04 19:08:49 +01:00
import java.util.function.Supplier;
2021-12-04 19:17:21 +01:00
public enum ModItemTier implements Tier {
2023-02-17 14:21:39 +01:00
2021-12-04 19:17:21 +01:00
INFUSED(2, 250, 6, 2, 16, () -> Ingredient.of(ModItems.INFUSED_IRON)),
2023-02-17 14:21:39 +01:00
SKY(3, 1500, 8, 3, 12, () -> Ingredient.of(ModItems.SKY_INGOT)),
DEPTH(4, 2500, 10, 5, 18, () -> Ingredient.of(ModItems.DEPTH_INGOT));
2019-11-04 19:08:49 +01:00
private final int harvestLevel;
private final int maxUses;
private final float efficiency;
private final float attackDamage;
private final int enchantability;
2021-12-04 19:17:21 +01:00
private final Lazy<Ingredient> repairMaterial;
2019-11-04 19:08:49 +01:00
2020-01-26 01:41:49 +01:00
ModItemTier(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn, int enchantabilityIn, Supplier<Ingredient> repairMaterialIn) {
2019-11-04 19:08:49 +01:00
this.harvestLevel = harvestLevelIn;
this.maxUses = maxUsesIn;
this.efficiency = efficiencyIn;
this.attackDamage = attackDamageIn;
this.enchantability = enchantabilityIn;
2021-12-04 19:17:21 +01:00
this.repairMaterial = Lazy.of(repairMaterialIn);
2019-11-04 19:08:49 +01:00
}
2020-01-24 17:05:41 +01:00
@Override
2021-12-04 19:17:21 +01:00
public int getUses() {
2019-11-04 19:08:49 +01:00
return this.maxUses;
}
2020-01-24 17:05:41 +01:00
@Override
2021-12-04 19:17:21 +01:00
public float getSpeed() {
2019-11-04 19:08:49 +01:00
return this.efficiency;
}
2020-01-24 17:05:41 +01:00
@Override
2021-12-04 19:17:21 +01:00
public float getAttackDamageBonus() {
2019-11-04 19:08:49 +01:00
return this.attackDamage;
}
2020-01-24 17:05:41 +01:00
@Override
2023-02-15 23:45:50 +01:00
@SuppressWarnings({"deprecation", "RedundantSuppression"})
2021-12-04 19:17:21 +01:00
public int getLevel() {
2019-11-04 19:08:49 +01:00
return this.harvestLevel;
}
2020-01-24 17:05:41 +01:00
@Override
2021-12-04 19:17:21 +01:00
public int getEnchantmentValue() {
2019-11-04 19:08:49 +01:00
return this.enchantability;
}
2020-01-24 17:05:41 +01:00
@Override
2021-12-04 19:17:21 +01:00
public Ingredient getRepairIngredient() {
return this.repairMaterial.get();
2019-11-04 19:08:49 +01:00
}
}