Class NetworkChannel

java.lang.Object
com.hammy275.immersivemc.common.network.NetworkChannel

public class NetworkChannel extends Object
  • Constructor Details

    • NetworkChannel

      public NetworkChannel()
  • Method Details

    • register

      public <T> void register(Class<T> clazz, BiConsumer<T,net.minecraft.network.FriendlyByteBuf> encoder, Function<net.minecraft.network.FriendlyByteBuf,T> decoder, BiConsumer<T,net.minecraft.server.level.ServerPlayer> handler)
    • sendToServer

      public <T> void sendToServer(T message)
    • sendToPlayer

      public <T> void sendToPlayer(net.minecraft.server.level.ServerPlayer player, T message)
    • sendToPlayers

      public <T> void sendToPlayers(Iterable<net.minecraft.server.level.ServerPlayer> players, T message)
    • doReceive

      public <T> void doReceive(@Nullable @Nullable net.minecraft.server.level.ServerPlayer player, net.minecraft.network.FriendlyByteBuf buffer)