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 {
|
|
|
|
INFUSED(2, 250, 6, 2, 16, () -> Ingredient.of(ModItems.INFUSED_IRON)),
|
|
|
|
SKY(3, 1500, 8, 3, 12, () -> Ingredient.of(ModItems.SKY_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
|
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
|
|
|
}
|
|
|
|
}
|