Record Class LeashInfo

java.lang.Object
java.lang.Record
top.r3944realms.superleadrope.api.type.capabilty.LeashInfo

public record LeashInfo(Optional<net.minecraft.core.BlockPos> blockPosOpt, Optional<UUID> holderUUIDOpt, Optional<Integer> holderIdOpt, Set<String> marks, String reserved, Double maxDistance, Double elasticDistanceScale, int keepLeashTicks, int maxKeepLeashTicks) extends Record
The type Leash info.
  • 字段详细资料

    • MARK_NOT_UPDATE

      public static final String MARK_NOT_UPDATE
      The constant MARK_NOT_UPDATE.
      另请参阅:
    • MARK_ONLY_NOT_UPDATE_MAX_DISTANCE

      public static final String MARK_ONLY_NOT_UPDATE_MAX_DISTANCE
      The constant MARK_ONLY_NOT_UPDATE_MAX_DISTANCE.
      另请参阅:
    • MARK_ONLY_NOT_UPDATE_ELASTIC_DISTANCE_SCALE

      public static final String MARK_ONLY_NOT_UPDATE_ELASTIC_DISTANCE_SCALE
      The constant MARK_ONLY_NOT_UPDATE_ELASTIC_DISTANCE_SCALE.
      另请参阅:
    • EMPTY

      public static final LeashInfo EMPTY
      The constant EMPTY.
  • 构造器详细资料

    • LeashInfo

      public LeashInfo(UUID holderUUID, int holderId, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks)
      Instantiates a new Leash info.
      参数:
      holderUUID - the holder uuid
      holderId - the holder id
      reserved - the reserved
      maxDistance - the max distance
      elasticDistanceScale - the elastic distance scale
      keepTicks - the keep ticks
      maxKeepTicks - the max keep ticks
    • LeashInfo

      public LeashInfo(UUID holderUUID, int holderId, Set<String> marks, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks)
      Instantiates a new Leash info.
      参数:
      holderUUID - the holder uuid
      holderId - the holder id
      marks - the marks
      reserved - the reserved
      maxDistance - the max distance
      elasticDistanceScale - the elastic distance scale
      keepTicks - the keep ticks
      maxKeepTicks - the max keep ticks
    • LeashInfo

      public LeashInfo(net.minecraft.core.BlockPos knotPos, int holderId, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks)
      Instantiates a new Leash info.
      参数:
      knotPos - the knot pos
      holderId - the holder id
      reserved - the reserved
      maxDistance - the max distance
      elasticDistanceScale - the elastic distance scale
      keepTicks - the keep ticks
      maxKeepTicks - the max keep ticks
    • LeashInfo

      public LeashInfo(net.minecraft.core.BlockPos knotPos, int holderId, Set<String> marks, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks)
      Instantiates a new Leash info.
      参数:
      knotPos - the knot pos
      holderId - the holder id
      marks - the marks
      reserved - the reserved
      maxDistance - the max distance
      elasticDistanceScale - the elastic distance scale
      keepTicks - the keep ticks
      maxKeepTicks - the max keep ticks
    • LeashInfo

      public LeashInfo(Optional<net.minecraft.core.BlockPos> blockPosOpt, Optional<UUID> holderUUIDOpt, Optional<Integer> holderIdOpt, Set<String> marks, String reserved, Double maxDistance, Double elasticDistanceScale, int keepLeashTicks, int maxKeepLeashTicks)
      创建 LeashInfo 记录的实例。
      参数:
      blockPosOpt - blockPosOpt 记录组件的值
      holderUUIDOpt - holderUUIDOpt 记录组件的值
      holderIdOpt - holderIdOpt 记录组件的值
      marks - marks 记录组件的值
      reserved - reserved 记录组件的值
      maxDistance - maxDistance 记录组件的值
      elasticDistanceScale - elasticDistanceScale 记录组件的值
      keepLeashTicks - keepLeashTicks 记录组件的值
      maxKeepLeashTicks - maxKeepLeashTicks 记录组件的值
  • 方法详细资料

    • create

      public static LeashInfo create(net.minecraft.world.entity.Entity entity, Set<String> marks, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks)
      Create leash info.
      参数:
      entity - the entity
      marks - the marks
      reserved - the reserved
      maxDistance - the max distance
      elasticDistanceScale - the elastic distance scale
      keepTicks - the keep ticks
      maxKeepTicks - the max keep ticks
      返回:
      the leash info
    • create

      public static LeashInfo create(net.minecraft.world.entity.Entity entity, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks)
      Create leash info.
      参数:
      entity - the entity
      reserved - the reserved
      maxDistance - the max distance
      elasticDistanceScale - the elastic distance scale
      keepTicks - the keep ticks
      maxKeepTicks - the max keep ticks
      返回:
      the leash info
    • decrementKeepTicks

      public LeashInfo decrementKeepTicks()
      Decrement keep ticks leash info.
      返回:
      the leash info
    • resetKeepTicks

      public LeashInfo resetKeepTicks()
      Reset keep ticks leash info.
      返回:
      the leash info
    • transferHolder

      public LeashInfo transferHolder(net.minecraft.world.entity.Entity entity)
      Transfer holder leash info.
      参数:
      entity - the entity
      返回:
      the leash info
    • transferHolder

      public LeashInfo transferHolder(net.minecraft.world.entity.Entity entity, String newReserved)
      Transfer holder leash info.
      参数:
      entity - the entity
      newReserved - the new reserved
      返回:
      the leash info
    • transferHolder

      public LeashInfo transferHolder(net.minecraft.world.entity.Entity entity, int maxKeepLeashTicks)
      Transfer holder leash info.
      参数:
      entity - the entity
      maxKeepLeashTicks - the max keep leash ticks
      返回:
      the leash info
    • transferHolder

      public LeashInfo transferHolder(net.minecraft.world.entity.Entity entity, int maxKeepLeashTicks, String newReserved)
      Transfer holder leash info.
      参数:
      entity - the entity
      maxKeepLeashTicks - the max keep leash ticks
      newReserved - the new reserved
      返回:
      the leash info
    • withReserved

      public LeashInfo withReserved(String newReserved)
      修改保留字段
      参数:
      newReserved - the new reserved
      返回:
      the leash info
    • withMarks

      public LeashInfo withMarks(Set<String> newMarks)
      修改标记集合
      参数:
      newMarks - the new marks
      返回:
      the leash info
    • markNotUpdate

      public LeashInfo markNotUpdate()
      添加无需更新标记(如果不存在则添加)
      返回:
      the leash info
    • markNotUpdateDistance

      public LeashInfo markNotUpdateDistance()
      Mark not update distance leash info.
      返回:
      the leash info
    • markNotUpdateScale

      public LeashInfo markNotUpdateScale()
      Mark not update scale leash info.
      返回:
      the leash info
    • unmarkNotUpdate

      public LeashInfo unmarkNotUpdate()
      移除无需更新标记
      返回:
      the leash info
    • unmarkNotUpdateDistance

      public LeashInfo unmarkNotUpdateDistance()
      移除无需更新距离标记
      返回:
      the leash info
    • unmarkNotUpdateScale

      public LeashInfo unmarkNotUpdateScale()
      移除无需更新比例标记
      返回:
      the leash info
    • isNotUpdate

      public boolean isNotUpdate()
      检查是否包含无需更新标记
      返回:
      the boolean
    • isNeedUpdateDistance

      public boolean isNeedUpdateDistance()
      是否需距离更新标记
      返回:
      the boolean
    • isNeedUpdateScale

      public boolean isNeedUpdateScale()
      是否需比例更新
      返回:
      the boolean
    • addMark

      public LeashInfo addMark(String mark)
      添加标记(如果不存在则添加)
      参数:
      mark - the mark
      返回:
      the leash info
    • addMarks

      public LeashInfo addMarks(String @NotNull ... marksToAdd)
      添加多个标记(自动检测并跳过重复标记)
      参数:
      marksToAdd - the marks to add
      返回:
      the leash info
    • addMarks

      public LeashInfo addMarks(@NotNull @NotNull Collection<String> marksToAdd)
      添加多个标记(集合版本)
      参数:
      marksToAdd - the marks to add
      返回:
      the leash info
    • removeMark

      public LeashInfo removeMark(String mark)
      移除单个标记
      参数:
      mark - the mark
      返回:
      the leash info
    • removeMarks

      public LeashInfo removeMarks(String @NotNull ... marksToRemove)
      移除多个标记
      参数:
      marksToRemove - the marks to remove
      返回:
      the leash info
    • removeMarks

      public LeashInfo removeMarks(@NotNull @NotNull Collection<String> marksToRemove)
      移除多个标记(集合版本)
      参数:
      marksToRemove - the marks to remove
      返回:
      the leash info
    • hasMark

      public boolean hasMark(String mark)
      检查是否包含指定标记
      参数:
      mark - the mark
      返回:
      the boolean
    • hasAllMarks

      @Contract(pure=true) public boolean hasAllMarks(String @NotNull ... marksToCheck)
      检查是否包含所有指定标记
      参数:
      marksToCheck - the marks to check
      返回:
      the boolean
    • hasAnyMark

      @Contract(pure=true) public boolean hasAnyMark(String @NotNull ... marksToCheck)
      检查是否包含任意指定标记
      参数:
      marksToCheck - the marks to check
      返回:
      the boolean
    • getMarks

      @Contract(pure=true) public @Unmodifiable Set<String> getMarks()
      获取所有标记(不可修改的视图)
      返回:
      the marks
    • clearAllMarks

      public LeashInfo clearAllMarks()
      清除所有标记
      返回:
      the leash info
    • toString

      public final String toString()
      返回此记录的字符串表示形式。此表示形式包含类型的名称,后跟每个记录组件的名称和值。
      指定者:
      toString 在类中 Record
      返回:
      此对象的字符串表示形式
    • hashCode

      public final int hashCode()
      返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。
      指定者:
      hashCode 在类中 Record
      返回:
      此对象的哈希代码值
    • equals

      public final boolean equals(Object o)
      指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用 Objects::equals(Object,Object) 对参考组件进行比较;使用 '==' 对基元组件进行比较
      指定者:
      equals 在类中 Record
      参数:
      o - 要与之进行比较的对象
      返回:
      如果此对象与 o 参数相同,则为 true;否则为 false
    • blockPosOpt

      public Optional<net.minecraft.core.BlockPos> blockPosOpt()
      返回 blockPosOpt 记录组件的值。
      返回:
      blockPosOpt 记录组件的值
    • holderUUIDOpt

      public Optional<UUID> holderUUIDOpt()
      返回 holderUUIDOpt 记录组件的值。
      返回:
      holderUUIDOpt 记录组件的值
    • holderIdOpt

      public Optional<Integer> holderIdOpt()
      返回 holderIdOpt 记录组件的值。
      返回:
      holderIdOpt 记录组件的值
    • marks

      public Set<String> marks()
      返回 marks 记录组件的值。
      返回:
      marks 记录组件的值
    • reserved

      public String reserved()
      返回 reserved 记录组件的值。
      返回:
      reserved 记录组件的值
    • maxDistance

      public Double maxDistance()
      返回 maxDistance 记录组件的值。
      返回:
      maxDistance 记录组件的值
    • elasticDistanceScale

      public Double elasticDistanceScale()
      返回 elasticDistanceScale 记录组件的值。
      返回:
      elasticDistanceScale 记录组件的值
    • keepLeashTicks

      public int keepLeashTicks()
      返回 keepLeashTicks 记录组件的值。
      返回:
      keepLeashTicks 记录组件的值
    • maxKeepLeashTicks

      public int maxKeepLeashTicks()
      返回 maxKeepLeashTicks 记录组件的值。
      返回:
      maxKeepLeashTicks 记录组件的值