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 double spawn_chance;
    private final double growth_chance;
    private final boolean aggressive;
    private final boolean lethal;

    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.spawn_chance = 0.25;
        this.growth_chance = 0.9;
        this.aggressive = true;
        this.lethal = true;
        this.texture = new AgriTexture();
    }

    public AgriWeed(String id, String path, AgriString weed_name, AgriString description, int stages, double spawn_chance,
                    double growth_chance, boolean aggressive, boolean lethal, 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.spawn_chance =spawn_chance;
        this.growth_chance = growth_chance;
        this.aggressive = aggressive;
        this.lethal = lethal;
        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 double getSpawnChance() {
        return this.spawn_chance;
    }

    public double getGrowthChance() {
        return this.growth_chance;
    }

    public boolean isAggressive() {
        return this.aggressive;
    }

    public boolean isLethal() {
        return this.lethal;
    }

    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());
    }
}

@@ -706,16 +706,63 @@
 ethal;%0A%0A
+    private final AgriProductList rake_drops;%0A%0A
     priv
@@ -792,16 +792,16 @@
 exture;%0A
-
 %0A    pub
@@ -1212,32 +1212,81 @@
 .lethal = true;%0A
+        this.rake_drops = new AgriProductList();%0A
         this.tex
@@ -1518,16 +1518,64 @@
  lethal,
+ AgriProductList rake_drops,%0A                   
  AgriTex
@@ -1942,24 +1942,62 @@
 l = lethal;%0A
+        this.rake_drops = rake_drops;%0A
         this
@@ -2193,32 +2193,108 @@
 tring();%0A    %7D%0A%0A
+    public AgriString getDescription() %7B%0A        return description;%0A    %7D%0A%0A
     public int g
@@ -2662,37 +2662,40 @@
 lic Agri
-String getDescription
+ProductList getRakeDrops
 () %7B%0A   
@@ -2702,35 +2702,39 @@
      return 
-description
+this.rake_drops
 ;%0A    %7D%0A%0A   
@@ -2852,32 +2852,32 @@
 this.enabled) %7B%0A
-
             Agri
@@ -2949,32 +2949,198 @@
   return false;%0A
+        %7D else if (!this.rake_drops.validate()) %7B%0A            AgriCore.getCoreLogger().debug(%22Invalid Weed: %7B0%7D! Invalid Rake Drops!%22, id);%0A            return false;%0A
         %7D else i

Add weed raking drops