// Path: src/main/java/fi/dy/masa/minihud/MiniHUD.java
// public class MiniHUD
// {
//     public static final Logger LOGGER = LogManager.getLogger(Reference.MOD_ID);
// 
//     public static void logInfo(String msg, Object... args)
//     {
//         if (Configs.Generic.DEBUG_MESSAGES.getBooleanValue())
//         {
//             LOGGER.info(msg, args);
//         }
//     }
// }


import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ResourceLocation;
import fi.dy.masa.malilib.network.PluginChannelHandler;
import fi.dy.masa.malilib.overlay.message.MessageDispatcher;
import fi.dy.masa.minihud.MiniHUD;
package fi.dy.masa.minihud.network;


public class ServuxInfoSubRegistrationPacketHandler implements PluginChannelHandler
{
    public static final ServuxInfoSubRegistrationPacketHandler INSTANCE = new ServuxInfoSubRegistrationPacketHandler();
    public static final ResourceLocation REG_CHANNEL = new ResourceLocation("servux:info_reg");

    protected static final List<ResourceLocation> CHANNELS = ImmutableList.of(REG_CHANNEL);
    protected static final int PACKET_S2C_METADATA = 1;

    @Override
    public List<ResourceLocation> getChannels()
    {
        return CHANNELS;
    }

    @Override
    public void onPacketReceived(PacketBuffer buf)
    {
        int type = buf.readVarInt();
        System.out.printf("REG packet received, type: %d\n", type);

        if (type == PACKET_S2C_METADATA)
        {
            try
            {
                ServuxInfoSubDataPacketHandler.INSTANCE.receiveMetadata(buf.readCompoundTag());
            }
            catch (Exception e)
            {
                MessageDispatcher.error("minihud.message.error.info_sub.failed_receive_metadata");
// Path: src/main/java/fi/dy/masa/minihud/MiniHUD.java
// public class MiniHUD
// {
//     public static final Logger LOGGER = LogManager.getLogger(Reference.MOD_ID);
// 
//     public static void logInfo(String msg, Object... args)
//     {
//         if (Configs.Generic.DEBUG_MESSAGES.getBooleanValue())
//         {
//             LOGGER.info(msg, args);
//         }
//     }
// }


// Path: src/main/java/fi/dy/masa/minihud/network/ServuxInfoSubRegistrationPacketHandler.java
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ResourceLocation;
import fi.dy.masa.malilib.network.PluginChannelHandler;
import fi.dy.masa.malilib.overlay.message.MessageDispatcher;
import fi.dy.masa.minihud.MiniHUD;

package fi.dy.masa.minihud.network;


public class ServuxInfoSubRegistrationPacketHandler implements PluginChannelHandler
{
    public static final ServuxInfoSubRegistrationPacketHandler INSTANCE = new ServuxInfoSubRegistrationPacketHandler();
    public static final ResourceLocation REG_CHANNEL = new ResourceLocation("servux:info_reg");

    protected static final List<ResourceLocation> CHANNELS = ImmutableList.of(REG_CHANNEL);
    protected static final int PACKET_S2C_METADATA = 1;

    @Override
    public List<ResourceLocation> getChannels()
    {
        return CHANNELS;
    }

    @Override
    public void onPacketReceived(PacketBuffer buf)
    {
        int type = buf.readVarInt();
        System.out.printf("REG packet received, type: %d\n", type);

        if (type == PACKET_S2C_METADATA)
        {
            try
            {
                ServuxInfoSubDataPacketHandler.INSTANCE.receiveMetadata(buf.readCompoundTag());
            }
            catch (Exception e)
            {
                MessageDispatcher.error("minihud.message.error.info_sub.failed_receive_metadata");
                MiniHUD.LOGGER.warn("Failed to receive info sub metadata from the server");