Class PlayerPositionPacket
java.lang.Object
org.cyclops.cyclopscore.network.PacketBase
org.cyclops.cyclopscore.network.PacketCodec
org.cyclops.cyclopscore.network.packet.PlayerPositionPacket
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
- Direct Known Subclasses:
RingOfFirePacket
An abstract superclass for all packets that contain the position and uuid
of a player and execute a specific action on the client side that is visible by
all players in a specific range around the given player.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cyclops.cyclopscore.network.PacketCodec
PacketCodec.ICodecAction, PacketCodec.ICodecRunnable
-
Field Summary
Fields inherited from class org.cyclops.cyclopscore.network.PacketCodec
fieldCache, READ_STRING_MAX_LENGTH
-
Constructor Summary
ConstructorDescriptionPlayerPositionPacket
(net.minecraft.resources.ResourceLocation id) Creates a packet with no contentPlayerPositionPacket
(net.minecraft.resources.ResourceLocation id, net.minecraft.world.entity.player.Player player) PlayerPositionPacket
(net.minecraft.resources.ResourceLocation id, net.minecraft.world.entity.player.Player player, int range) -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionClient
(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player) Actions for client-side.void
actionServer
(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player) Actions for server-side.protected abstract PlayerPositionPacket
create
(net.minecraft.world.entity.player.Player player, int range) protected abstract ModBase
boolean
isAsync()
protected abstract void
performClientAction
(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player) Methods inherited from class org.cyclops.cyclopscore.network.PacketCodec
addCodedAction, decode, encode, getAction, getActionSuper, read, write
Methods inherited from class org.cyclops.cyclopscore.network.PacketBase
id, write
-
Field Details
-
uuid
-
position
protected net.minecraft.world.phys.Vec3 position
-
-
Constructor Details
-
PlayerPositionPacket
public PlayerPositionPacket(net.minecraft.resources.ResourceLocation id) Creates a packet with no content -
PlayerPositionPacket
public PlayerPositionPacket(net.minecraft.resources.ResourceLocation id, net.minecraft.world.entity.player.Player player) -
PlayerPositionPacket
public PlayerPositionPacket(net.minecraft.resources.ResourceLocation id, net.minecraft.world.entity.player.Player player, int range)
-
-
Method Details
-
isAsync
public boolean isAsync()- Specified by:
isAsync
in classPacketBase
- Returns:
- If this packet can run on a thread other than the main-thread of Minecraft. If this is asynchronous, the player parameter inside the action is not guaranteed to be defined.
-
actionClient
public void actionClient(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player) Description copied from class:PacketBase
Actions for client-side.- Specified by:
actionClient
in classPacketBase
- Parameters:
level
- The world.player
- The player. Can be null if this packet is asynchronous.
-
actionServer
public void actionServer(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player) Description copied from class:PacketBase
Actions for server-side.- Specified by:
actionServer
in classPacketBase
- Parameters:
level
- The world.player
- The player.
-
create
protected abstract PlayerPositionPacket create(net.minecraft.world.entity.player.Player player, int range) -
getModInstance
-
performClientAction
protected abstract void performClientAction(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player)
-