// Path: src/main/java/de/epiceric/shopchest/nms/CustomBookMeta.java
// public class CustomBookMeta {
//     private static final OBCClassResolver obcClassResolver = new OBCClassResolver();
// 	
//     public enum Generation {	
//         ORIGINAL,	
//         COPY_OF_ORIGINAL,	
//         COPY_OF_COPY,	
//         TATTERED	
//     }	
// 	
//     public static Generation getGeneration(ItemStack book) {	
//         try {	
//             Class<?> craftItemStackClass = obcClassResolver.resolveSilent("inventory.CraftItemStack");	
// 	
//             if (craftItemStackClass == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: Could not find CraftItemStack class");	
//                 return null;	
//             }	
// 	
//             Object nmsStack = craftItemStackClass.getMethod("asNMSCopy", ItemStack.class).invoke(null, book);	
// 	
//             Object nbtTagCompound = nmsStack.getClass().getMethod("getTag").invoke(nmsStack);	
//             if (nbtTagCompound == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: getTag returned null");	
//                 return null;	
//             }	
// 	
//             Object generationObject = nbtTagCompound.getClass().getMethod("getInt", String.class).invoke(nbtTagCompound, "generation");	
//             if (generationObject == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: getInt returned null");	
//                 return null;	
//             }	
// 	
//             if (generationObject instanceof Integer) {	
//                 int generation = (Integer) generationObject;	
// 	
//                 if (generation > 3) generation = 3;	
// 	
//                 return Generation.values()[generation];	
//             }	
// 	
//         } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {	
//             ShopChest.getInstance().getLogger().severe("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug(e);	
//         }	
// 	
//         return null;	
//     }	
// 	
//     public static void setGeneration(ItemStack book, Generation generation) {	
//         try {	
//             Class<?> craftItemStackClass = obcClassResolver.resolveSilent("inventory.CraftItemStack");	
// 	
//             if (craftItemStackClass == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: Could not find CraftItemStack class");	
//                 return;	
//             }	
// 	
//             Object nmsStack = craftItemStackClass.getMethod("asNMSCopy", ItemStack.class).invoke(null, book);	
// 	
//             Object nbtTagCompound = nmsStack.getClass().getMethod("getTag").invoke(nmsStack);	
//             if (nbtTagCompound == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: getTag returned null");	
//                 return;	
//             }	
// 	
//             nbtTagCompound.getClass().getMethod("setInt", String.class, int.class)	
//                     .invoke(nbtTagCompound, "generation", generation.ordinal());	
// 	
//             nmsStack.getClass().getMethod("setTag", nbtTagCompound.getClass()).invoke(nmsStack, nbtTagCompound);	
// 	
//         } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {	
//             ShopChest.getInstance().getLogger().severe("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug(e);	
//         }	
//     }	
// 	
// }


import de.epiceric.shopchest.nms.CustomBookMeta;
package de.epiceric.shopchest.language;


public class BookGenerationName {

    private String localizedName;
// Path: src/main/java/de/epiceric/shopchest/nms/CustomBookMeta.java
// public class CustomBookMeta {
//     private static final OBCClassResolver obcClassResolver = new OBCClassResolver();
// 	
//     public enum Generation {	
//         ORIGINAL,	
//         COPY_OF_ORIGINAL,	
//         COPY_OF_COPY,	
//         TATTERED	
//     }	
// 	
//     public static Generation getGeneration(ItemStack book) {	
//         try {	
//             Class<?> craftItemStackClass = obcClassResolver.resolveSilent("inventory.CraftItemStack");	
// 	
//             if (craftItemStackClass == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: Could not find CraftItemStack class");	
//                 return null;	
//             }	
// 	
//             Object nmsStack = craftItemStackClass.getMethod("asNMSCopy", ItemStack.class).invoke(null, book);	
// 	
//             Object nbtTagCompound = nmsStack.getClass().getMethod("getTag").invoke(nmsStack);	
//             if (nbtTagCompound == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: getTag returned null");	
//                 return null;	
//             }	
// 	
//             Object generationObject = nbtTagCompound.getClass().getMethod("getInt", String.class).invoke(nbtTagCompound, "generation");	
//             if (generationObject == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: getInt returned null");	
//                 return null;	
//             }	
// 	
//             if (generationObject instanceof Integer) {	
//                 int generation = (Integer) generationObject;	
// 	
//                 if (generation > 3) generation = 3;	
// 	
//                 return Generation.values()[generation];	
//             }	
// 	
//         } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {	
//             ShopChest.getInstance().getLogger().severe("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug(e);	
//         }	
// 	
//         return null;	
//     }	
// 	
//     public static void setGeneration(ItemStack book, Generation generation) {	
//         try {	
//             Class<?> craftItemStackClass = obcClassResolver.resolveSilent("inventory.CraftItemStack");	
// 	
//             if (craftItemStackClass == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: Could not find CraftItemStack class");	
//                 return;	
//             }	
// 	
//             Object nmsStack = craftItemStackClass.getMethod("asNMSCopy", ItemStack.class).invoke(null, book);	
// 	
//             Object nbtTagCompound = nmsStack.getClass().getMethod("getTag").invoke(nmsStack);	
//             if (nbtTagCompound == null) {	
//                 ShopChest.getInstance().debug("Failed to get NBTGeneration: getTag returned null");	
//                 return;	
//             }	
// 	
//             nbtTagCompound.getClass().getMethod("setInt", String.class, int.class)	
//                     .invoke(nbtTagCompound, "generation", generation.ordinal());	
// 	
//             nmsStack.getClass().getMethod("setTag", nbtTagCompound.getClass()).invoke(nmsStack, nbtTagCompound);	
// 	
//         } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {	
//             ShopChest.getInstance().getLogger().severe("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug("Failed to get NBTEntityID with reflection");	
//             ShopChest.getInstance().debug(e);	
//         }	
//     }	
// 	
// }


// Path: src/main/java/de/epiceric/shopchest/language/BookGenerationName.java
import de.epiceric.shopchest.nms.CustomBookMeta;

package de.epiceric.shopchest.language;


public class BookGenerationName {

    private String localizedName;
    private CustomBookMeta.Generation generation;