package net.glowstone.block.flattening.generated;

import com.google.common.collect.ImmutableBiMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;

public class FlatteningUtil extends Object {
    private static final ImmutableBiMap<Material, Integer> MAT_TO_ID = GeneratedFlatteningData.MATERIAL_ID_MAP.inverse();

    public static List<BlockFace> getPossibleBlockFaces(Material material) {
        return new ArrayList<>(GeneratedFlatteningData.DIRECTIONAL_POSSIBLE_FACES.get(material));
    }

    public static int getStateBaseId(int stateId) {
        return GeneratedFlatteningData.STATE_BASE_IDS[stateId];
    }

    public static Map<String, Object> deserialize(Material material, int stateSubId) {
        return GeneratedFlatteningData.MATERIAL_PROPERTIES.get(material).deserialize(stateSubId);
    }

    public static int getMaterialBaseId(Material material) {
        return MAT_TO_ID.get(material);
    }

    public static Material getMaterialFromBaseId(int baseId) {
        return GeneratedFlatteningData.MATERIAL_ID_MAP.get(baseId);
    }

    public static Material getMaterialFromStateId(int stateId) {
        int baseId = getStateBaseId(stateId);
        return getMaterialFromBaseId(baseId);
    }

    public static int getStateSerialFromStateId(int stateId) {
        int baseId = getStateBaseId(stateId);
        return stateId - baseId;
    }

    public static int getStateCount() {
        return GeneratedFlatteningData.STATE_BASE_IDS.length;
    }

    public static int getMaterialProperties(Material material) {
        return GeneratedFlatteningData.MATERIAL_PROPERTIES.get(material).deserialize()
    }
}

@@ -170,43 +170,8 @@
 ap;%0A
-import javax.annotation.Generated;%0A
 impo
@@ -262,23 +262,8 @@
 til 
-extends Object 
 %7B%0A  
@@ -680,32 +680,295 @@
 tateId%5D;%0A    %7D%0A%0A
+    public static int getStateDefaultId(int stateId) %7B%0A        return GeneratedFlatteningData.STATE_DEFAULT_IDS%5BstateId%5D;%0A    %7D%0A%0A    public static int getMaterialDefaultId(Material material) %7B%0A        return getStateDefaultId(getMaterialBaseId(material));%0A    %7D%0A%0A
     public stati
@@ -1704,275 +1704,7 @@
    %7D
-%0A%0A    public static int getStateCount() %7B%0A        return GeneratedFlatteningData.STATE_BASE_IDS.length;%0A    %7D%0A%0A    public static int getMaterialProperties(Material material) %7B%0A        return GeneratedFlatteningData.MATERIAL_PROPERTIES.get(material).deserialize()%0A    %7D
 %0A%7D%0A

add default utilities