thank You guys. I figured out and create my material. Bascially what i did was created a new class for my new material and implemented IItemTier and then did like the vanilla code.
here is my code ===>
public enum ToolMaterial implements IItemTier{
RUBY(3, 1000, 5.0f, 9.0f, 10, () -> {
return Ingredient.fromItems(ModItems.RUBY.get());
});
private final int A;
private final int B;
private final float C;
private final float D;
private final int E;
private final LazyValue<Ingredient> f;
private ToolMaterial(int i, int j, float f, float g, int k, Supplier<Ingredient> object) {
this.A = i;
this.B = j;
this.C = f;
this.D = g;
this.E = k;
this.f = new LazyValue<>(object);
}
@Override
public int getMaxUses() {
return this.B;
}
@Override
public float getEfficiency() {
return this.C;
}
@Override
public float getAttackDamage() {
return this.D;
}
@Override
public int getHarvestLevel() {
return this.A;
}
@Override
public int getEnchantability() {
return this.E;
}
@Override
public Ingredient getRepairMaterial() {
return this.f.getValue();
}
}