// Path: src/main/java/amerifrance/guideapi/api/IGuideItem.java
// public interface IGuideItem {
// 
//     Book getBook(ItemStack stack);
// }
// 
// Path: src/main/java/amerifrance/guideapi/api/util/NBTBookTags.java
// public class NBTBookTags {
// 
//     public static String BOOK_TAG = "G-API_Book";
//     public static String CATEGORY_TAG = "G-API_Category";
//     public static String CATEGORY_PAGE_TAG = CATEGORY_TAG + "_Page";
//     public static String ENTRY_TAG = "G-API_Entry";
//     public static String ENTRY_PAGE_TAG = ENTRY_TAG + "_Page";
//     public static String PAGE_TAG = "G-API_Page";
//     public static String KEY_TAG = "G-API_Key";
// }


import amerifrance.guideapi.api.IGuideItem;
import amerifrance.guideapi.api.util.NBTBookTags;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
package amerifrance.guideapi.network;


public class PacketSyncEntry implements IMessage, IMessageHandler<PacketSyncEntry, IMessage> {

    public int category;
    public ResourceLocation entry;
    public int page;

    public PacketSyncEntry() {
        this.category = -1;
        this.entry = new ResourceLocation("guideapi", "none");
        this.page = -1;
    }

    public PacketSyncEntry(int category, ResourceLocation entry, int page) {
        this.category = category;
        this.entry = entry;
        this.page = page;
    }

    @Override
    public void fromBytes(ByteBuf buf) {
        this.category = buf.readInt();
        this.entry = new ResourceLocation(ByteBufUtils.readUTF8String(buf));
        this.page = buf.readInt();
    }

    @Override
    public void toBytes(ByteBuf buf) {
        buf.writeInt(category);
        ByteBufUtils.writeUTF8String(buf, entry.toString());
        buf.writeInt(page);
    }

    @Override
// Path: src/main/java/amerifrance/guideapi/api/IGuideItem.java
// public interface IGuideItem {
// 
//     Book getBook(ItemStack stack);
// }
// 
// Path: src/main/java/amerifrance/guideapi/api/util/NBTBookTags.java
// public class NBTBookTags {
// 
//     public static String BOOK_TAG = "G-API_Book";
//     public static String CATEGORY_TAG = "G-API_Category";
//     public static String CATEGORY_PAGE_TAG = CATEGORY_TAG + "_Page";
//     public static String ENTRY_TAG = "G-API_Entry";
//     public static String ENTRY_PAGE_TAG = ENTRY_TAG + "_Page";
//     public static String PAGE_TAG = "G-API_Page";
//     public static String KEY_TAG = "G-API_Key";
// }


// Path: src/main/java/amerifrance/guideapi/network/PacketSyncEntry.java
import amerifrance.guideapi.api.IGuideItem;
import amerifrance.guideapi.api.util.NBTBookTags;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

package amerifrance.guideapi.network;


public class PacketSyncEntry implements IMessage, IMessageHandler<PacketSyncEntry, IMessage> {

    public int category;
    public ResourceLocation entry;
    public int page;

    public PacketSyncEntry() {
        this.category = -1;
        this.entry = new ResourceLocation("guideapi", "none");
        this.page = -1;
    }

    public PacketSyncEntry(int category, ResourceLocation entry, int page) {
        this.category = category;
        this.entry = entry;
        this.page = page;
    }

    @Override
    public void fromBytes(ByteBuf buf) {
        this.category = buf.readInt();
        this.entry = new ResourceLocation(ByteBufUtils.readUTF8String(buf));
        this.page = buf.readInt();
    }

    @Override
    public void toBytes(ByteBuf buf) {
        buf.writeInt(category);
        ByteBufUtils.writeUTF8String(buf, entry.toString());
        buf.writeInt(page);
    }

    @Override
    public IMessage onMessage(PacketSyncEntry message, MessageContext ctx) {