package com.agricraft.agricore.plant;

import com.agricraft.agricore.core.AgriCore;
import com.agricraft.agricore.json.AgriSerializable;
import com.agricraft.agricore.lang.AgriString;
import com.agricraft.agricore.plant.versions.v2.Versions_1_16;

public class AgriWeed implements AgriSerializable, Comparable<AgriWeed> {

    private String path;
    private final String version;
    private final boolean enabled;

    private final String id;

    private final AgriString weed_name;
    private final AgriString description;

    private final int stages;

    private final AgriTexture texture;

    public AgriWeed() {
        this.path = "default/weed_weed.json";
        this.version = Versions_1_16.VERSION;
        this.enabled = false;
        this.id = "weed_weed";
        this.weed_name = new AgriString("weeds");
        this.description = new AgriString("");
        this.stages = 8;
        this.texture = new AgriTexture();
    }

    public AgriWeed(String id, String path, AgriString weed_name, AgriString description, int stages, AgriTexture texture, boolean enabled) {
        this.id = id;
        this.path = path;
        this.enabled = enabled;
        this.weed_name = weed_name;
        this.description = description;
        this.stages = stages;
        this.texture = texture;
        this.version = Versions_1_16.VERSION;
    }

    public String getId() {
        return id;
    }

    public String getWeedName() {
        return weed_name.toString();
    }

    public int getGrowthStages() {
        return this.stages;
    }

    public AgriString getDescription() {
        return description;
    }

    public AgriTexture getTexture() {
        return texture;
    }

    public boolean validate() {
        if (!this.enabled) {
            AgriCore.getCoreLogger().debug("Disabled Weed: {0}!", id);
            return false;
        } else if (!this.texture.validate()) {
            AgriCore.getCoreLogger().debug("Invalid Weed: {0}! Invalid Texture!", id);
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("\n").append(id).append(":\n");
        return sb.toString();
    }

    @Override
    public boolean isEnabled() {
        return this.enabled;
    }

    @Override
    public String getPath() {
        return this.path;
    }

    @Override
    public void setPath(String path) {
        this.path = path;
    }

    @Override
    public String getVersion() {
        return this.version;
    }

    @Override
    public int compareTo(AgriWeed o) {
        return this.getId().compareTo(o.getId());
    }
}

@@ -553,16 +553,167 @@
  stages;
+%0A    private final double spawn_chance;%0A    private final double growth_chance;%0A    private final boolean aggressive;%0A    private final boolean lethal;
 %0A%0A    pr
@@ -1045,16 +1045,144 @@
 es = 8;%0A
+        this.spawn_chance = 0.25;%0A        this.growth_chance = 0.9;%0A        this.aggressive = true;%0A        this.lethal = true;%0A
         
@@ -1323,16 +1323,115 @@
  stages,
+ double spawn_chance,%0A                    double growth_chance, boolean aggressive, boolean lethal,
  AgriTex
@@ -1645,24 +1645,177 @@
 s = stages;%0A
+        this.spawn_chance =spawn_chance;%0A        this.growth_chance = growth_chance;%0A        this.aggressive = aggressive;%0A        this.lethal = lethal;%0A
         this
@@ -2081,32 +2081,332 @@
 .stages;%0A    %7D%0A%0A
+    public double getSpawnChance() %7B%0A        return this.spawn_chance;%0A    %7D%0A%0A    public double getGrowthChance() %7B%0A        return this.growth_chance;%0A    %7D%0A%0A    public boolean isAggressive() %7B%0A        return this.aggressive;%0A    %7D%0A%0A    public boolean isLethal() %7B%0A        return this.lethal;%0A    %7D%0A%0A
     public AgriS

Add json weed properties