Package org.cyclops.cyclopscore.network
Class PacketHandler
java.lang.Object
org.cyclops.cyclopscore.network.PacketHandler
- All Implemented Interfaces:
org.cyclops.cyclopscore.network.IPacketHandler
@Sharable
public final class PacketHandler
extends Object
implements org.cyclops.cyclopscore.network.IPacketHandler
Advanced packet handler of
PacketBase
instances.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Deprecated.static final record
Deprecated. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handlePacketClient
(net.neoforged.neoforge.network.handling.IPayloadContext context, org.cyclops.cyclopscore.network.PacketBase packet) void
handlePacketServer
(net.neoforged.neoforge.network.handling.IPayloadContext context, org.cyclops.cyclopscore.network.PacketBase packet) protected void
init
(net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent event) <P extends org.cyclops.cyclopscore.network.PacketBase>
voidregister
(Class<P> clazz, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<P> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, P> codec) <P extends org.cyclops.cyclopscore.network.PacketBase>
voidregister
(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<P> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, P> codec) Deprecated.protected <P extends org.cyclops.cyclopscore.network.PacketBase>
voidregisterActual
(net.neoforged.neoforge.network.registration.PayloadRegistrar registrar, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<P> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, P> codec) void
sendToAll
(org.cyclops.cyclopscore.network.PacketBase packet) void
sendToAllAround
(org.cyclops.cyclopscore.network.PacketBase packet, PacketHandler.TargetPoint point) Deprecated.void
sendToAllAroundPoint
(org.cyclops.cyclopscore.network.PacketBase packet, org.cyclops.cyclopscore.network.IPacketHandler.TargetPoint point) void
sendToDimension
(org.cyclops.cyclopscore.network.PacketBase packet, net.minecraft.server.level.ServerLevel dimension) void
sendToPlayer
(org.cyclops.cyclopscore.network.PacketBase packet, net.minecraft.server.level.ServerPlayer player) void
sendToServer
(org.cyclops.cyclopscore.network.PacketBase packet)
-
Constructor Details
-
PacketHandler
-
-
Method Details
-
init
protected void init(net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent event) -
register
public <P extends org.cyclops.cyclopscore.network.PacketBase> void register(Class<P> clazz, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<P> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, P> codec) - Specified by:
register
in interfaceorg.cyclops.cyclopscore.network.IPacketHandler
-
register
@Deprecated public <P extends org.cyclops.cyclopscore.network.PacketBase> void register(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<P> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, P> codec) Deprecated. -
registerActual
protected <P extends org.cyclops.cyclopscore.network.PacketBase> void registerActual(net.neoforged.neoforge.network.registration.PayloadRegistrar registrar, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<P> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, P> codec) -
handlePacketClient
public void handlePacketClient(net.neoforged.neoforge.network.handling.IPayloadContext context, org.cyclops.cyclopscore.network.PacketBase packet) -
handlePacketServer
public void handlePacketServer(net.neoforged.neoforge.network.handling.IPayloadContext context, org.cyclops.cyclopscore.network.PacketBase packet) -
sendToServer
public void sendToServer(org.cyclops.cyclopscore.network.PacketBase packet) - Specified by:
sendToServer
in interfaceorg.cyclops.cyclopscore.network.IPacketHandler
-
sendToPlayer
public void sendToPlayer(org.cyclops.cyclopscore.network.PacketBase packet, net.minecraft.server.level.ServerPlayer player) - Specified by:
sendToPlayer
in interfaceorg.cyclops.cyclopscore.network.IPacketHandler
-
sendToAllAround
@Deprecated public void sendToAllAround(org.cyclops.cyclopscore.network.PacketBase packet, PacketHandler.TargetPoint point) Deprecated.Send a packet to all in the target range.- Parameters:
packet
- The packet.point
- The point.
-
sendToAllAroundPoint
public void sendToAllAroundPoint(org.cyclops.cyclopscore.network.PacketBase packet, org.cyclops.cyclopscore.network.IPacketHandler.TargetPoint point) - Specified by:
sendToAllAroundPoint
in interfaceorg.cyclops.cyclopscore.network.IPacketHandler
-
sendToDimension
public void sendToDimension(org.cyclops.cyclopscore.network.PacketBase packet, net.minecraft.server.level.ServerLevel dimension) - Specified by:
sendToDimension
in interfaceorg.cyclops.cyclopscore.network.IPacketHandler
-
sendToAll
public void sendToAll(org.cyclops.cyclopscore.network.PacketBase packet) - Specified by:
sendToAll
in interfaceorg.cyclops.cyclopscore.network.IPacketHandler
-