2021-02-27 21:24:26 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.material;
|
|
|
|
|
2021-03-01 21:23:52 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
2021-02-27 21:24:26 +01:00
|
|
|
import net.minecraft.item.IItemTier;
|
|
|
|
import net.minecraft.item.crafting.Ingredient;
|
|
|
|
import net.minecraft.util.LazyValue;
|
|
|
|
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Complete copy paste from {@link net.minecraft.item.ItemTier}
|
|
|
|
* <p>
|
|
|
|
* todo: review to ensure all values act as intended
|
|
|
|
*/
|
|
|
|
public enum ToolMaterials implements IItemTier {
|
2021-08-22 17:09:06 +02:00
|
|
|
QUARTZ(2, 280, 6.5f, 2.0f, 10, () -> Ingredient.of(ActuallyItems.BLACK_QUARTZ.get())),
|
|
|
|
RESTONIA(2, 300, 7.0f, 2.25f, 12, () -> Ingredient.of(ActuallyItems.RESTONIA_CRYSTAL.get())),
|
|
|
|
PALIS(2, 300, 7.0f, 2.25f, 12, () -> Ingredient.of(ActuallyItems.PALIS_CRYSTAL.get())),
|
|
|
|
DIAMATINE(3, 1600, 9.0f, 4.0f, 14, () -> Ingredient.of(ActuallyItems.DIAMATINE_CRYSTAL.get())),
|
|
|
|
VOID(2, 280, 6.0f, 2.0f, 8, () -> Ingredient.of(ActuallyItems.VOID_CRYSTAL.get())),
|
|
|
|
EMERADIC(4, 2200, 9.5f, 5.55f, 18, () -> Ingredient.of(ActuallyItems.EMERADIC_CRYSTAL.get())),
|
|
|
|
ENORI(2, 280, 6.25f, 6.25f, 15, () -> Ingredient.of(ActuallyItems.ENORI_CRYSTAL.get()));
|
2021-02-27 21:24:26 +01:00
|
|
|
|
|
|
|
private final int harvestLevel;
|
|
|
|
private final int maxUses;
|
|
|
|
private final float efficiency;
|
|
|
|
private final float attackDamage;
|
|
|
|
private final int enchantability;
|
|
|
|
private final LazyValue<Ingredient> repairMaterial;
|
|
|
|
|
|
|
|
ToolMaterials(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn, int enchantabilityIn, Supplier<Ingredient> repairMaterialIn) {
|
|
|
|
this.harvestLevel = harvestLevelIn;
|
|
|
|
this.maxUses = maxUsesIn;
|
|
|
|
this.efficiency = efficiencyIn;
|
|
|
|
this.attackDamage = attackDamageIn;
|
|
|
|
this.enchantability = enchantabilityIn;
|
|
|
|
this.repairMaterial = new LazyValue<>(repairMaterialIn);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public int getUses() {
|
2021-02-27 21:24:26 +01:00
|
|
|
return this.maxUses;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public float getSpeed() {
|
2021-02-27 21:24:26 +01:00
|
|
|
return this.efficiency;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public float getAttackDamageBonus() {
|
2021-02-27 21:24:26 +01:00
|
|
|
return this.attackDamage;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public int getLevel() {
|
2021-02-27 21:24:26 +01:00
|
|
|
return this.harvestLevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public int getEnchantmentValue() {
|
2021-02-27 21:24:26 +01:00
|
|
|
return this.enchantability;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public Ingredient getRepairIngredient() {
|
|
|
|
return this.repairMaterial.get();
|
2021-02-27 21:24:26 +01:00
|
|
|
}
|
|
|
|
}
|