// Path: src/main/java/ru/endlesscode/rpginventory/utils/SafeEnums.java
// public class SafeEnums {
// 
//     private SafeEnums() {
//         // Shouldn't be instantiated
//     }
// 
//     @Nullable
//     public static DyeColor getDyeColor(String name) {
//         return valueOf(DyeColor.class, name, "color");
//     }
// 
//     @Nullable
//     public static Horse.Color getHorseColor(String name) {
//         return valueOf(Horse.Color.class, name, "horse color");
//     }
// 
//     @Nullable
//     public static Horse.Style getHorseStyle(String name) {
//         return valueOf(Horse.Style.class, name, "horse style");
//     }
// 
//     @Nullable
//     public static Cat.Type getCatType(String name) {
//         return valueOf(Cat.Type.class, name, "cat type");
//     }
// 
//     @NotNull
//     public static <T extends Enum<T>> T valueOfOrDefault(Class<T> enumClass, String name, T defaultValue) {
//         return valueOfOrDefault(enumClass, name, defaultValue, enumClass.getSimpleName());
//     }
// 
//     @NotNull
//     public static <T extends Enum<T>> T valueOfOrDefault(Class<T> enumClass, String name, T defaultValue, String alias) {
//         T value = valueOf(enumClass, name, alias);
//         if (value != null) {
//             return value;
//         } else {
//             Log.w("Used {0} {1} by default.", defaultValue.name(), alias);
//             return defaultValue;
//         }
//     }
// 
//     @Nullable
//     public static <T extends Enum<T>> T valueOf(Class<T> enumClass, String name, String alias) {
//         if (name == null) {
//             return null;
//         }
// 
//         try {
//             return Enum.valueOf(enumClass, name.toUpperCase());
//         } catch (IllegalArgumentException e) {
//             Log.w("Unknown {0}: {1}. Available values: {2}", alias, name, Arrays.toString(enumClass.getEnumConstants()));
//             return null;
//         }
//     }
// }


import ru.endlesscode.rpginventory.utils.SafeEnums;
/*
 * This file is part of RPGInventory.
 * Copyright (C) 2020 EndlessCode Group and contributors
 *
 * RPGInventory is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * RPGInventory is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with RPGInventory.  If not, see <http://www.gnu.org/licenses/>.
 */

package ru.endlesscode.rpginventory.misc.config;


@SuppressWarnings("unused")
public enum TexturesType {
    DAMAGE,
    CUSTOM_MODEL_DATA;

    static TexturesType parseString(String stringValue) {
// Path: src/main/java/ru/endlesscode/rpginventory/utils/SafeEnums.java
// public class SafeEnums {
// 
//     private SafeEnums() {
//         // Shouldn't be instantiated
//     }
// 
//     @Nullable
//     public static DyeColor getDyeColor(String name) {
//         return valueOf(DyeColor.class, name, "color");
//     }
// 
//     @Nullable
//     public static Horse.Color getHorseColor(String name) {
//         return valueOf(Horse.Color.class, name, "horse color");
//     }
// 
//     @Nullable
//     public static Horse.Style getHorseStyle(String name) {
//         return valueOf(Horse.Style.class, name, "horse style");
//     }
// 
//     @Nullable
//     public static Cat.Type getCatType(String name) {
//         return valueOf(Cat.Type.class, name, "cat type");
//     }
// 
//     @NotNull
//     public static <T extends Enum<T>> T valueOfOrDefault(Class<T> enumClass, String name, T defaultValue) {
//         return valueOfOrDefault(enumClass, name, defaultValue, enumClass.getSimpleName());
//     }
// 
//     @NotNull
//     public static <T extends Enum<T>> T valueOfOrDefault(Class<T> enumClass, String name, T defaultValue, String alias) {
//         T value = valueOf(enumClass, name, alias);
//         if (value != null) {
//             return value;
//         } else {
//             Log.w("Used {0} {1} by default.", defaultValue.name(), alias);
//             return defaultValue;
//         }
//     }
// 
//     @Nullable
//     public static <T extends Enum<T>> T valueOf(Class<T> enumClass, String name, String alias) {
//         if (name == null) {
//             return null;
//         }
// 
//         try {
//             return Enum.valueOf(enumClass, name.toUpperCase());
//         } catch (IllegalArgumentException e) {
//             Log.w("Unknown {0}: {1}. Available values: {2}", alias, name, Arrays.toString(enumClass.getEnumConstants()));
//             return null;
//         }
//     }
// }


// Path: src/main/java/ru/endlesscode/rpginventory/misc/config/TexturesType.java
import ru.endlesscode.rpginventory.utils.SafeEnums;

/*
 * This file is part of RPGInventory.
 * Copyright (C) 2020 EndlessCode Group and contributors
 *
 * RPGInventory is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * RPGInventory is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with RPGInventory.  If not, see <http://www.gnu.org/licenses/>.
 */

package ru.endlesscode.rpginventory.misc.config;


@SuppressWarnings("unused")
public enum TexturesType {
    DAMAGE,
    CUSTOM_MODEL_DATA;

    static TexturesType parseString(String stringValue) {
        return SafeEnums.valueOfOrDefault(TexturesType.class, stringValue, DAMAGE, "textures type");