记录类 ClientboundDamageEventPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundDamageEventPacket
- 所有已实现的接口:
Packet<ClientGamePacketListener>
public record ClientboundDamageEventPacket(int entityId, Holder<DamageType> sourceType, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition)
extends Record
implements Packet<ClientGamePacketListener>
-
字段概要
字段修饰符和类型字段说明private final int
entityId
记录组件的字段。private final int
sourceCauseId
记录组件的字段。private final int
sourceDirectId
记录组件的字段。sourcePosition
记录组件的字段。private final Holder
<DamageType> sourceType
记录组件的字段。static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundDamageEventPacket> -
构造器概要
构造器限定符构造器说明ClientboundDamageEventPacket
(int entityId, Holder<DamageType> sourceType, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition) 创建ClientboundDamageEventPacket
记录类的实例。private
ClientboundDamageEventPacket
(Entity p_270474_, DamageSource p_270781_) -
方法概要
修饰符和类型方法说明int
entityId()
返回entityId
记录组件的值。final boolean
指示某个其他对象是否“等于”此对象。void
handle
(ClientGamePacketListener p_270510_) final int
hashCode()
返回此对象的哈希代码值。private static int
readOptionalEntityId
(FriendlyByteBuf p_270462_) int
返回sourceCauseId
记录组件的值。int
返回sourceDirectId
记录组件的值。返回sourcePosition
记录组件的值。返回sourceType
记录组件的值。final String
toString()
返回此记录类的字符串表示形式。type()
private void
write
(RegistryFriendlyByteBuf p_321775_) private static void
writeOptionalEntityId
(FriendlyByteBuf p_270812_, int p_270852_) 从接口继承的方法 net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
字段详细资料
-
entityId
private final int entityIdentityId
记录组件的字段。 -
sourceType
sourceType
记录组件的字段。 -
sourceCauseId
private final int sourceCauseIdsourceCauseId
记录组件的字段。 -
sourceDirectId
private final int sourceDirectIdsourceDirectId
记录组件的字段。 -
sourcePosition
sourcePosition
记录组件的字段。 -
STREAM_CODEC
-
-
构造器详细资料
-
ClientboundDamageEventPacket
-
ClientboundDamageEventPacket
-
ClientboundDamageEventPacket
public ClientboundDamageEventPacket(int entityId, Holder<DamageType> sourceType, int sourceCauseId, int sourceDirectId, Optional<Vec3> sourcePosition) 创建ClientboundDamageEventPacket
记录类的实例。- 参数:
entityId
-entityId
记录组件的值sourceType
-sourceType
记录组件的值sourceCauseId
-sourceCauseId
记录组件的值sourceDirectId
-sourceDirectId
记录组件的值sourcePosition
-sourcePosition
记录组件的值
-
-
方法详细资料
-
writeOptionalEntityId
-
readOptionalEntityId
-
write
-
type
- 指定者:
type
在接口中Packet<ClientGamePacketListener>
-
handle
- 指定者:
handle
在接口中Packet<ClientGamePacketListener>
-
getSource
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用Objects::equals(Object,Object)
对参考组件进行比较;使用 '==' 对基元组件进行比较 -
entityId
public int entityId()返回entityId
记录组件的值。- 返回:
entityId
记录组件的值
-
sourceType
返回sourceType
记录组件的值。- 返回:
sourceType
记录组件的值
-
sourceCauseId
public int sourceCauseId()返回sourceCauseId
记录组件的值。- 返回:
sourceCauseId
记录组件的值
-
sourceDirectId
public int sourceDirectId()返回sourceDirectId
记录组件的值。- 返回:
sourceDirectId
记录组件的值
-
sourcePosition
返回sourcePosition
记录组件的值。- 返回:
sourcePosition
记录组件的值
-