// Path: src/main/java/gr8pefish/openglider/common/OpenGlider.java
// @Mod(modid = MODID, name = MOD_NAME, version = ModInfo.VERSION, guiFactory = ModInfo.GUI_FACTORY, acceptedMinecraftVersions = "[1.12,1.13)")//, updateJSON = FORGE_UPDATE_JSON_URL) //disabled version update checker for now, as it was giving false positives
// public class OpenGlider {
// 
//     //Proxies
//     @SidedProxy(clientSide = ModInfo.CLIENT_PROXY, serverSide = ModInfo.COMMON_PROXY)
//     public static IProxy proxy;
// 
//     //Creative Tab
//     public static final CreativeTabs creativeTab = new CreativeTabs(MODID) {
// 
//         @Override
//         public ItemStack createIcon() {
//             return new ItemStack(ItemRegistry.GLIDER_BASIC);
//         }
//     };
// 
//     //Mod Instance
//     @Mod.Instance
//     public static OpenGlider instance;
// 
// 
//     @Mod.EventHandler
//     public void preInit(FMLPreInitializationEvent event) {
// 
//         //config
//         ConfigHandler.init(event.getSuggestedConfigurationFile());
// 
//         //wind
//         WindHelper.initNoiseGenerator();
// 
//         //register capabilities
//         CapabilityRegistry.registerAllCapabilities();
// 
//         //packets
//         PacketHandler.init();
// 
//         //init renderers and client event handlers
//         proxy.preInit(event);
//     }
// 
// 
//     @Mod.EventHandler
//     public void init(FMLInitializationEvent event) {
// 
//         //upgrades
//         UpgradeItems.initUpgradesList();
// 
//         //register server events
//         MinecraftForge.EVENT_BUS.register(new ServerEventHandler());
//         //register config changed event
//         MinecraftForge.EVENT_BUS.register(new ConfigHandler());
// 
//         proxy.init(event);
//     }
// 
// 
//     @Mod.EventHandler
//     public void postInit(FMLPostInitializationEvent event) {
// 
//         proxy.postInit(event);
//     }
// }
// 
// Path: src/main/java/gr8pefish/openglider/common/helper/Logger.java
// public class Logger{
// 
//     public static void log(Level logLevel, Object object){
//         FMLLog.log(MOD_NAME, logLevel, String.valueOf(object));
//     }
// 
//     public static void all(Object object){
//         log(Level.ALL, object);
//     }
// 
//     public static void debug(Object object){
//         log(Level.DEBUG, object);
//     }
// 
//     public static void error(Object object){
//         log(Level.ERROR, object);
//     }
// 
//     public static void fatal(Object object){
//         log(Level.FATAL, object);
//     }
// 
//     public static void info(Object object){
//         log(Level.INFO, object);
//     }
// 
//     public static void off(Object object){
//         log(Level.OFF, object);
//     }
// 
//     public static void trace(Object object){
//         log(Level.TRACE, object);
//     }
// 
//     public static void warn(Object object){
//         log(Level.WARN, object);
//     }
// }


import gr8pefish.openglider.common.OpenGlider;
import gr8pefish.openglider.common.helper.Logger;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.nbt.NBTTagCompound;
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 gr8pefish.openglider.common.network;


public class PacketSyncGliderDataToClient implements IMessage {

    private NBTTagCompound nbt;

    public PacketSyncGliderDataToClient() {}

    public PacketSyncGliderDataToClient(NBTTagCompound nbt) {
        this.nbt = nbt;
    }

    @Override
    public void fromBytes(ByteBuf buf) {
        nbt = ByteBufUtils.readTag(buf);
    }

    @Override
    public void toBytes(ByteBuf buf) {
        ByteBufUtils.writeTag(buf, nbt);
    }

    public static class Handler implements IMessageHandler<PacketSyncGliderDataToClient, IMessage> {

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

            Minecraft.getMinecraft().addScheduledTask(() -> {
// Path: src/main/java/gr8pefish/openglider/common/OpenGlider.java
// @Mod(modid = MODID, name = MOD_NAME, version = ModInfo.VERSION, guiFactory = ModInfo.GUI_FACTORY, acceptedMinecraftVersions = "[1.12,1.13)")//, updateJSON = FORGE_UPDATE_JSON_URL) //disabled version update checker for now, as it was giving false positives
// public class OpenGlider {
// 
//     //Proxies
//     @SidedProxy(clientSide = ModInfo.CLIENT_PROXY, serverSide = ModInfo.COMMON_PROXY)
//     public static IProxy proxy;
// 
//     //Creative Tab
//     public static final CreativeTabs creativeTab = new CreativeTabs(MODID) {
// 
//         @Override
//         public ItemStack createIcon() {
//             return new ItemStack(ItemRegistry.GLIDER_BASIC);
//         }
//     };
// 
//     //Mod Instance
//     @Mod.Instance
//     public static OpenGlider instance;
// 
// 
//     @Mod.EventHandler
//     public void preInit(FMLPreInitializationEvent event) {
// 
//         //config
//         ConfigHandler.init(event.getSuggestedConfigurationFile());
// 
//         //wind
//         WindHelper.initNoiseGenerator();
// 
//         //register capabilities
//         CapabilityRegistry.registerAllCapabilities();
// 
//         //packets
//         PacketHandler.init();
// 
//         //init renderers and client event handlers
//         proxy.preInit(event);
//     }
// 
// 
//     @Mod.EventHandler
//     public void init(FMLInitializationEvent event) {
// 
//         //upgrades
//         UpgradeItems.initUpgradesList();
// 
//         //register server events
//         MinecraftForge.EVENT_BUS.register(new ServerEventHandler());
//         //register config changed event
//         MinecraftForge.EVENT_BUS.register(new ConfigHandler());
// 
//         proxy.init(event);
//     }
// 
// 
//     @Mod.EventHandler
//     public void postInit(FMLPostInitializationEvent event) {
// 
//         proxy.postInit(event);
//     }
// }
// 
// Path: src/main/java/gr8pefish/openglider/common/helper/Logger.java
// public class Logger{
// 
//     public static void log(Level logLevel, Object object){
//         FMLLog.log(MOD_NAME, logLevel, String.valueOf(object));
//     }
// 
//     public static void all(Object object){
//         log(Level.ALL, object);
//     }
// 
//     public static void debug(Object object){
//         log(Level.DEBUG, object);
//     }
// 
//     public static void error(Object object){
//         log(Level.ERROR, object);
//     }
// 
//     public static void fatal(Object object){
//         log(Level.FATAL, object);
//     }
// 
//     public static void info(Object object){
//         log(Level.INFO, object);
//     }
// 
//     public static void off(Object object){
//         log(Level.OFF, object);
//     }
// 
//     public static void trace(Object object){
//         log(Level.TRACE, object);
//     }
// 
//     public static void warn(Object object){
//         log(Level.WARN, object);
//     }
// }


// Path: src/main/java/gr8pefish/openglider/common/network/PacketSyncGliderDataToClient.java
import gr8pefish.openglider.common.OpenGlider;
import gr8pefish.openglider.common.helper.Logger;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.nbt.NBTTagCompound;
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 gr8pefish.openglider.common.network;


public class PacketSyncGliderDataToClient implements IMessage {

    private NBTTagCompound nbt;

    public PacketSyncGliderDataToClient() {}

    public PacketSyncGliderDataToClient(NBTTagCompound nbt) {
        this.nbt = nbt;
    }

    @Override
    public void fromBytes(ByteBuf buf) {
        nbt = ByteBufUtils.readTag(buf);
    }

    @Override
    public void toBytes(ByteBuf buf) {
        ByteBufUtils.writeTag(buf, nbt);
    }

    public static class Handler implements IMessageHandler<PacketSyncGliderDataToClient, IMessage> {

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

            Minecraft.getMinecraft().addScheduledTask(() -> {
                OpenGlider.proxy.getClientGliderCapability().deserializeNBT(message.nbt);