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