// Path: src/main/java/me/dmillerw/remoteio/core/frequency/FrequencyRegistry.java
// public class FrequencyRegistry {
// 
//     private static Map<Integer, String> savedFrequencies = Maps.newHashMap();
// 
//     public static void saveFrequency(int frequency, String name) {
//         savedFrequencies.put(frequency, name);
//     }
// 
//     public static void deleteFrequency(int frequency) {
//         savedFrequencies.remove(frequency);
//     }
// 
//     public static Map<Integer, String> getSavedFrequencies() {
//         ImmutableMap.Builder<Integer, String> builder = ImmutableMap.builder();
//         builder.putAll(savedFrequencies);
//         return builder.build();
//     }
// 
//     public static void load(File file) {
//         if (!file.exists())
//             return;
// 
//         savedFrequencies.clear();
// 
//         try {
//             BufferedReader reader = new BufferedReader(new FileReader(file));
// 
//             String line;
//             while ((line = reader.readLine()) != null) {
//                 String[] split = line.split(";");
//                 int frequency;
//                 try {
//                      frequency = Integer.parseInt(split[0]);
//                 } catch (NumberFormatException ex) {
//                     continue;
//                 }
//                 savedFrequencies.put(frequency, split[1]);
//             }
//         } catch (IOException ex) {
//             ex.printStackTrace();
//         }
//     }
// 
//     public static void save(File file) {
//         if (file.exists())
//             file.delete();
// 
//         savedFrequencies.put(1, "Test");
//         savedFrequencies.put(2, "Banana");
// 
//         try {
//             BufferedWriter writer = new BufferedWriter(new FileWriter(file));
// 
//             for(Map.Entry<Integer, String> entry : savedFrequencies.entrySet()) {
//                 writer.write(Integer.toString(entry.getKey()));
//                 writer.write(";");
//                 writer.write(entry.getValue());
//                 writer.write("\n");
//             }
// 
//             writer.close();
//         } catch (IOException ex) {
//             ex.printStackTrace();
//         }
//     }
// }
// 
// Path: src/main/java/me/dmillerw/remoteio/network/PacketHandler.java
// public class PacketHandler {
// 
//     public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(ModInfo.MOD_ID);
// 
//     public static void addScheduledTask(INetHandler netHandler, Runnable runnable) {
//         FMLCommonHandler.instance().getWorldThread(netHandler).addScheduledTask(runnable);
//     }
// 
//     public static void initialize() {
//         INSTANCE.registerMessage(CActivateBlock.Handler.class, CActivateBlock.class, -1, Side.CLIENT);
//         INSTANCE.registerMessage(CBulkFrequencyUpdate.Handler.class, CBulkFrequencyUpdate.class, -2, Side.CLIENT);
//         INSTANCE.registerMessage(CFrequencyUpdate.Handler.class, CFrequencyUpdate.class, -3, Side.CLIENT);
// 
//         INSTANCE.registerMessage(SFrequencyUpdate.Handler.class, SFrequencyUpdate.class, 1, Side.SERVER);
//         INSTANCE.registerMessage(SSetFrequency.Handler.class, SSetFrequency.class, 2, Side.SERVER);
//     }
// }


import io.netty.buffer.ByteBuf;
import me.dmillerw.remoteio.core.frequency.FrequencyRegistry;
import me.dmillerw.remoteio.network.PacketHandler;
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;
import javax.annotation.Nullable;
package me.dmillerw.remoteio.network.packet.server;



/**
 * Created by dmillerw
 */
public class SFrequencyUpdate implements IMessage {

    public static final int TYPE_ADD = 0;
    public static final int TYPE_REMOVE = 1;

    protected byte type;
    public int frequency;
    @Nullable
    public String name;

    public SFrequencyUpdate() {

    }

    public SFrequencyUpdate(byte type, int frequency, String name) {
// Path: src/main/java/me/dmillerw/remoteio/core/frequency/FrequencyRegistry.java
// public class FrequencyRegistry {
// 
//     private static Map<Integer, String> savedFrequencies = Maps.newHashMap();
// 
//     public static void saveFrequency(int frequency, String name) {
//         savedFrequencies.put(frequency, name);
//     }
// 
//     public static void deleteFrequency(int frequency) {
//         savedFrequencies.remove(frequency);
//     }
// 
//     public static Map<Integer, String> getSavedFrequencies() {
//         ImmutableMap.Builder<Integer, String> builder = ImmutableMap.builder();
//         builder.putAll(savedFrequencies);
//         return builder.build();
//     }
// 
//     public static void load(File file) {
//         if (!file.exists())
//             return;
// 
//         savedFrequencies.clear();
// 
//         try {
//             BufferedReader reader = new BufferedReader(new FileReader(file));
// 
//             String line;
//             while ((line = reader.readLine()) != null) {
//                 String[] split = line.split(";");
//                 int frequency;
//                 try {
//                      frequency = Integer.parseInt(split[0]);
//                 } catch (NumberFormatException ex) {
//                     continue;
//                 }
//                 savedFrequencies.put(frequency, split[1]);
//             }
//         } catch (IOException ex) {
//             ex.printStackTrace();
//         }
//     }
// 
//     public static void save(File file) {
//         if (file.exists())
//             file.delete();
// 
//         savedFrequencies.put(1, "Test");
//         savedFrequencies.put(2, "Banana");
// 
//         try {
//             BufferedWriter writer = new BufferedWriter(new FileWriter(file));
// 
//             for(Map.Entry<Integer, String> entry : savedFrequencies.entrySet()) {
//                 writer.write(Integer.toString(entry.getKey()));
//                 writer.write(";");
//                 writer.write(entry.getValue());
//                 writer.write("\n");
//             }
// 
//             writer.close();
//         } catch (IOException ex) {
//             ex.printStackTrace();
//         }
//     }
// }
// 
// Path: src/main/java/me/dmillerw/remoteio/network/PacketHandler.java
// public class PacketHandler {
// 
//     public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(ModInfo.MOD_ID);
// 
//     public static void addScheduledTask(INetHandler netHandler, Runnable runnable) {
//         FMLCommonHandler.instance().getWorldThread(netHandler).addScheduledTask(runnable);
//     }
// 
//     public static void initialize() {
//         INSTANCE.registerMessage(CActivateBlock.Handler.class, CActivateBlock.class, -1, Side.CLIENT);
//         INSTANCE.registerMessage(CBulkFrequencyUpdate.Handler.class, CBulkFrequencyUpdate.class, -2, Side.CLIENT);
//         INSTANCE.registerMessage(CFrequencyUpdate.Handler.class, CFrequencyUpdate.class, -3, Side.CLIENT);
// 
//         INSTANCE.registerMessage(SFrequencyUpdate.Handler.class, SFrequencyUpdate.class, 1, Side.SERVER);
//         INSTANCE.registerMessage(SSetFrequency.Handler.class, SSetFrequency.class, 2, Side.SERVER);
//     }
// }


// Path: src/main/java/me/dmillerw/remoteio/network/packet/server/SFrequencyUpdate.java
import io.netty.buffer.ByteBuf;
import me.dmillerw.remoteio.core.frequency.FrequencyRegistry;
import me.dmillerw.remoteio.network.PacketHandler;
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;
import javax.annotation.Nullable;

package me.dmillerw.remoteio.network.packet.server;



/**
 * Created by dmillerw
 */
public class SFrequencyUpdate implements IMessage {

    public static final int TYPE_ADD = 0;
    public static final int TYPE_REMOVE = 1;

    protected byte type;
    public int frequency;
    @Nullable
    public String name;

    public SFrequencyUpdate() {

    }

    public SFrequencyUpdate(byte type, int frequency, String name) {
        this.type = type;