Record Class ServerBoundSpawnEntityPacket
java.lang.Object
java.lang.Record
de.luckymcdev.foundryengine.common.network.packets.world.ServerBoundSpawnEntityPacket
- All Implemented Interfaces:
AbstractPacket<ServerBoundSpawnEntityPacket>, net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record ServerBoundSpawnEntityPacket(String entityTypeId, double x, double y, double z, float yRot, float xRot)
extends Record
implements AbstractPacket<ServerBoundSpawnEntityPacket>
-
Nested Class Summary
Nested classes/interfaces inherited from interface AbstractPacket
AbstractPacket.Definition<T>Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AbstractPacket.Definition<ServerBoundSpawnEntityPacket> -
Constructor Summary
ConstructorsConstructorDescriptionServerBoundSpawnEntityPacket(String entityTypeId, double x, double y, double z, float yRot, float xRot) Creates an instance of aServerBoundSpawnEntityPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theentityTypeIdrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ServerBoundSpawnEntityPacket> getCodec()net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ServerBoundSpawnEntityPacket> getType()voidhandleServer(net.neoforged.neoforge.network.handling.IPayloadContext ctx) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.doublex()Returns the value of thexrecord component.floatxRot()Returns the value of thexRotrecord component.doubley()Returns the value of theyrecord component.floatyRot()Returns the value of theyRotrecord component.doublez()Returns the value of thezrecord component.Methods inherited from interface AbstractPacket
handleClient, typeMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
DEFINITION
-
-
Constructor Details
-
ServerBoundSpawnEntityPacket
public ServerBoundSpawnEntityPacket(String entityTypeId, double x, double y, double z, float yRot, float xRot) Creates an instance of aServerBoundSpawnEntityPacketrecord class.- Parameters:
entityTypeId- the value for theentityTypeIdrecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentyRot- the value for theyRotrecord componentxRot- the value for thexRotrecord component
-
-
Method Details
-
getType
public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ServerBoundSpawnEntityPacket> getType()- Specified by:
getTypein interfaceAbstractPacket<ServerBoundSpawnEntityPacket>
-
getBoundTo
- Specified by:
getBoundToin interfaceAbstractPacket<ServerBoundSpawnEntityPacket>
-
getCodec
public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ServerBoundSpawnEntityPacket> getCodec()- Specified by:
getCodecin interfaceAbstractPacket<ServerBoundSpawnEntityPacket>
-
handleServer
public void handleServer(net.neoforged.neoforge.network.handling.IPayloadContext ctx) - Specified by:
handleServerin interfaceAbstractPacket<ServerBoundSpawnEntityPacket>
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
entityTypeId
Returns the value of theentityTypeIdrecord component.- Returns:
- the value of the
entityTypeIdrecord component
-
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public double z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
yRot
public float yRot()Returns the value of theyRotrecord component.- Returns:
- the value of the
yRotrecord component
-
xRot
public float xRot()Returns the value of thexRotrecord component.- Returns:
- the value of the
xRotrecord component
-