Advertisement
hnOsmium0001

Untitled

Aug 9th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.asuramagica.tools.util;
  2.  
  3. import java.io.IOException;
  4. import java.util.function.BiConsumer;
  5.  
  6. import org.apache.commons.codec.Decoder;
  7. import org.apache.commons.codec.DecoderException;
  8. import org.apache.commons.codec.Encoder;
  9. import org.apache.commons.codec.EncoderException;
  10. import org.checkerframework.checker.nullness.qual.Nullable;
  11.  
  12. import com.google.common.base.Function;
  13.  
  14. import io.netty.handler.codec.DecoderResultProvider;
  15. import me.asuramagica.AsuraMagicaMod;
  16. import net.minecraft.network.INetHandler;
  17. import net.minecraft.network.IPacket;
  18. import net.minecraft.network.PacketBuffer;
  19. import net.minecraft.util.ResourceLocation;
  20. import net.minecraftforge.fml.network.NetworkRegistry;
  21. import net.minecraftforge.fml.network.simple.SimpleChannel;
  22.  
  23. public class EnergyTypePacketHandler {
  24.     private static final String PROTOCOL_VERSION = "1";
  25.     public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel(
  26.         new ResourceLocation(AsuraMagicaMod.MODID, "main"),
  27.         () -> PROTOCOL_VERSION,
  28.         PROTOCOL_VERSION::equals,
  29.         PROTOCOL_VERSION::equals
  30.     );
  31.    
  32.     // Call this method in your main mod class in setup
  33.     public static void registerMessages() {
  34.         int id = 0;
  35.         INSTANCE.registerMessage(id++, EnergyTypePacketHandler.class, EnergyTypePacketHandler::encode, EnergyTypePacketHandler::decode, EnergyTypePacketHandler::handle);
  36.     }
  37.  
  38.     public static void encode(EnergyTypePacketHandler msg, PacketBuffer buf) {
  39.     }
  40.  
  41.     public static EnergyTypePacketHandler decode(PacketBuffer buf) {
  42.     }
  43.  
  44.     public static void handle(EnergyTypePacketHandler msg, Supplier<NetworkEvent.Context> ctx) {
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement