Record Class PacketRecordedAction
java.lang.Object
java.lang.Record
com.petrolpark.core.actionrecord.packet.PacketRecordedAction
- All Implemented Interfaces:
IRecordedAction<PacketRecordedAction>
public record PacketRecordedAction(net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ServerGamePacketListener> packet)
extends Record
implements IRecordedAction<PacketRecordedAction>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PacketRecordedAction> protected static final Supplier<net.minecraft.network.ProtocolInfo<net.minecraft.network.protocol.game.ServerGamePacketListener>> -
Constructor Summary
ConstructorsConstructorDescriptionPacketRecordedAction(net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ServerGamePacketListener> packet) Creates an instance of aPacketRecordedActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<PacketRecordedAction> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ServerGamePacketListener> packet()Returns the value of thepacketrecord component.voidplay(net.minecraft.server.level.ServerPlayer player) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
PROTOCOL_INFO
protected static final Supplier<net.minecraft.network.ProtocolInfo<net.minecraft.network.protocol.game.ServerGamePacketListener>> PROTOCOL_INFO -
CODEC
-
-
Constructor Details
-
PacketRecordedAction
public PacketRecordedAction(net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ServerGamePacketListener> packet) Creates an instance of aPacketRecordedActionrecord class.- Parameters:
packet- the value for thepacketrecord component
-
-
Method Details
-
play
public void play(net.minecraft.server.level.ServerPlayer player) throws RecordedActionExecutionException - Specified by:
playin interfaceIRecordedAction<PacketRecordedAction>- Throws:
RecordedActionExecutionException
-
codec
- Specified by:
codecin interfaceIRecordedAction<PacketRecordedAction>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
packet
public net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ServerGamePacketListener> packet()Returns the value of thepacketrecord component.- Returns:
- the value of the
packetrecord component
-