Class TcdcServerPlayNetworkHandler
java.lang.Object
io.github.thecsdev.tcdcommons.network.TcdcServerPlayNetworkHandler
TCDCommons server play network handler.
Keeps track of
Keeps track of
ServerPlayerEntity
data that is related to TCDCommons
.-
Method Summary
Modifier and TypeMethodDescriptionfinal net.minecraft.server.network.ServerPlayerEntity
final long
static final TcdcServerPlayNetworkHandler
of
(net.minecraft.server.network.ServerPlayerEntity player) Returns an instance ofTcdcServerPlayNetworkHandler
for a givenServerPlayerEntity
.final void
onCustomPayloadNetwork
(TCustomPayload payload) Handles a client sendingTCustomPayload
packets to this server.final void
Handles "fractured"CustomPayloadNetwork
packets.final void
sendCustomPayloadNetwork
(net.minecraft.util.Identifier packetId, io.netty.buffer.ByteBuf packetData) Sends aTCustomPayload
packet to the other side.final boolean
Sends theplayer
their player badge statistics.
-
Method Details
-
getPlayer
public final net.minecraft.server.network.ServerPlayerEntity getPlayer() -
nextS2CFracturedCpnPacketId
public final long nextS2CFracturedCpnPacketId() -
onCustomPayloadNetwork
Handles a client sendingTCustomPayload
packets to this server. Aka handles theCustomPayloadNetwork
. -
onFracturedCustomPayloadNetwork
public final void onFracturedCustomPayloadNetwork(CustomPayloadNetworkReceiver.PacketContext context) Handles "fractured"CustomPayloadNetwork
packets.- See Also:
-
sendCustomPayloadNetwork
public final void sendCustomPayloadNetwork(net.minecraft.util.Identifier packetId, io.netty.buffer.ByteBuf packetData) throws IllegalStateException, NullPointerException Sends aTCustomPayload
packet to the other side.- Throws:
IllegalStateException
NullPointerException
- See Also:
-
sendPlayerBadges
public final boolean sendPlayerBadges()Sends theplayer
their player badge statistics.- Returns:
true
if the packet was sent, andfalse
if the packet was not sent because the player doesn't have anyPlayerBadge
s assigned to them.
-
of
public static final TcdcServerPlayNetworkHandler of(net.minecraft.server.network.ServerPlayerEntity player) throws NullPointerException Returns an instance ofTcdcServerPlayNetworkHandler
for a givenServerPlayerEntity
. Creates one if it doesn't exist yet.- Parameters:
player
- TheServerPlayerEntity
.- Throws:
NullPointerException
-