package com.latenighters.runicarcana.common.items.tools;

import net.minecraft.nbt.CompoundNBT;

public class ArcanaToolStats {
    private float attackDamage;
    private float attackSpeed;
    private int harvestLevel;
    private float destroySpeed;

    public ArcanaToolStats(float attackDamage, float attackSpeed, int harvestLevel, float destroySpeed) {
        this.attackDamage = attackDamage;
        this.attackSpeed = attackSpeed;
        this.harvestLevel = harvestLevel;
        this.destroySpeed = destroySpeed;
    }

    public ArcanaToolStats(CompoundNBT statsNBT){
        float atkDamage = statsNBT.getFloat("atkDamage");
        float atkSpeed = statsNBT.getFloat("atkSpeed");
        int harvestLvl = statsNBT.getInt("harvestLvl");
        float destroySpd = statsNBT.getFloat("destroySpd");

        this.attackDamage = atkDamage;
        this.attackSpeed = atkSpeed;
        this.harvestLevel = harvestLvl;
        this.destroySpeed = destroySpd;
    }

    public CompoundNBT makeNBT(){
        CompoundNBT tag = new CompoundNBT();
        // Could be changed to float array to save packet bytes.
        tag.putFloat("atkDamage", this.attackDamage);
        tag.putFloat("atkSpeed", this.attackSpeed);
        tag.putInt("harvestLvl", this.harvestLevel);
        tag.putFloat("destroySpd", this.destroySpeed);
        return tag;
    }

    public float getAttackDamage() {
        return attackDamage;
    }

    public void setAttackDamage(float attackDamage) {
        this.attackDamage = attackDamage;
    }

    public float getAttackSpeed() {
        return attackSpeed;
    }

    public void setAttackSpeed(float attackSpeed) {
        this.attackSpeed = attackSpeed;
    }

    public int getHarvestLevel() {
        return harvestLevel;
    }

    public void setHarvestLevel(int harvestLevel) {
        this.harvestLevel = harvestLevel;
    }

    public float getDestroySpeed() {
        return destroySpeed;
    }

    public void setDestroySpeed(float destroySpeed) {
        this.destroySpeed = destroySpeed;
    }
}

@@ -180,24 +180,26 @@
 ttackSpeed;%0A
+//
     private 
@@ -211,24 +211,127 @@
 arvestLevel;
+ // canHarvestBlock only provides a block state, so you can't check the NBT to determine harvest level.
 %0A    private
@@ -544,50 +544,8 @@
 ed;%0A
-        this.harvestLevel = harvestLevel;%0A
     
@@ -950,48 +950,8 @@
 ed;%0A
-        this.harvestLevel = harvestLvl;%0A
     
@@ -1247,61 +1247,8 @@
 d);%0A
-        tag.putInt(%22harvestLvl%22, this.harvestLevel);%0A
     
@@ -1616,32 +1616,32 @@
  attackSpeed) %7B%0A
+
         this.att
@@ -1675,180 +1675,8 @@
  %7D%0A%0A
-    public int getHarvestLevel() %7B%0A        return harvestLevel;%0A    %7D%0A%0A    public void setHarvestLevel(int harvestLevel) %7B%0A        this.harvestLevel = harvestLevel;%0A    %7D%0A%0A
     

Remove ArcanaToolStats harvest level stat.