Class NetworkChannel
java.lang.Object
com.hammy275.immersivemc.common.network.NetworkChannel
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> void
doReceive
(@Nullable net.minecraft.server.level.ServerPlayer player, net.minecraft.network.FriendlyByteBuf buffer) <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) <T> void
sendToPlayer
(net.minecraft.server.level.ServerPlayer player, T message) <T> void
sendToPlayers
(Iterable<net.minecraft.server.level.ServerPlayer> players, T message) <T> void
sendToServer
(T message)
-
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
-
doReceive
public <T> void doReceive(@Nullable @Nullable net.minecraft.server.level.ServerPlayer player, net.minecraft.network.FriendlyByteBuf buffer)
-