package com.voxelwind.api.game.item.data;

import com.voxelwind.api.game.Metadata;

import java.util.Objects;

/**
 * This {@link Metadata} represents coal. In Minecraft, coal can either be regular or be charcoal. They are the same,
 * regardless.
 */
public final class Coal implements Metadata {
    /**
     * Represents a regular coal item.
     */
    public static final Coal REGULAR = new Coal(false);
    /**
     * Represents a charcoal item.
     */
    public static final Coal CHARCOAL = new Coal(true);

    private final boolean isCharcoal;

    private Coal(boolean isCharcoal) {
        this.isCharcoal = isCharcoal;
    }

    /**
     * Returns whether or not this item is charcoal.
     * @return whether or not this item is charcoal
     */
    public final boolean isCharcoal() {
        return isCharcoal;
    }

    @Override
    public final boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Coal coal = (Coal) o;
        return isCharcoal == coal.isCharcoal;
    }

    @Override
    public final int hashCode() {
        return Objects.hash(isCharcoal);
    }

    @Override
    public final String toString() {
        return "Coal{" +
                "isCharcoal=" + isCharcoal +
                '}';
    }
}

@@ -256,19 +256,12 @@
 lic 
-final class
+enum
  Coa
@@ -347,59 +347,16 @@
     
-public static final Coal REGULAR = new Coal(false);
+REGULAR,
 %0A   
@@ -411,710 +411,211 @@
     
-public static final Coal CHARCOAL = new Coal(true);%0A%0A    private final boolean isCharcoal;%0A%0A    private Coal(boolean isCharcoal) %7B%0A        this.isCharcoal = isCharcoal;%0A    %7D%0A%0A    /**%0A     * Returns whether or not this item is charcoal.%0A     * @return whether or not this item is charcoal%0A     */%0A    public final boolean isCharcoal() %7B%0A        return isCharcoal;%0A    %7D%0A%0A    @Override%0A    public final boolean equals(Object o) %7B%0A        if (this == o) return true;%0A        if (o == null %7C%7C getClass() != o.getClass()) return false;%0A        Coal coal = (Coal) o;%0A        return isCharcoal == coal.isCharcoal;%0A    %7D%0A%0A    @Override%0A    public final int hashCode() %7B%0A        return Objects.hash(isCharcoal)
+CHARCOAL;%0A%0A    /**%0A     * Returns whether or not this item is charcoal.%0A     * @return whether or not this item is charcoal%0A     */%0A    public final boolean isCharcoal() %7B%0A        return this == CHARCOAL
 ;%0A  
@@ -698,69 +698,17 @@
 %7B%22 +
-%0A                %22isCharcoal=%22 + isCharcoal +%0A               
+ name() +
  '%7D'

Convert Coal class into an enum