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.
-
字段概要
字段 -
构造器概要
构造器构造器说明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记录的实例。LeashInfo(UUID holderUUID, int holderId, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks) Instantiates a new Leash info.LeashInfo(UUID holderUUID, int holderId, Set<String> marks, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks) Instantiates a new Leash info.LeashInfo(net.minecraft.core.BlockPos knotPos, int holderId, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks) Instantiates a new Leash info.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. -
方法概要
修饰符和类型方法说明添加标记(如果不存在则添加)addMarks(@NotNull Collection<String> marksToAdd) 添加多个标记(集合版本)添加多个标记(自动检测并跳过重复标记)Optional<net.minecraft.core.BlockPos>返回blockPosOpt记录组件的值。清除所有标记static LeashInfocreate(net.minecraft.world.entity.Entity entity, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks) Create leash info.static LeashInfocreate(net.minecraft.world.entity.Entity entity, Set<String> marks, String reserved, Double maxDistance, Double elasticDistanceScale, int keepTicks, int maxKeepTicks) Create leash info.Decrement keep ticks leash info.返回elasticDistanceScale记录组件的值。final boolean指示某个其他对象是否“等于”此对象。getMarks()获取所有标记(不可修改的视图)booleanhasAllMarks(String @NotNull ... marksToCheck) 检查是否包含所有指定标记booleanhasAnyMark(String @NotNull ... marksToCheck) 检查是否包含任意指定标记final inthashCode()返回此对象的哈希代码值。boolean检查是否包含指定标记返回holderIdOpt记录组件的值。返回holderUUIDOpt记录组件的值。boolean是否需距离更新标记boolean是否需比例更新boolean检查是否包含无需更新标记int返回keepLeashTicks记录组件的值。添加无需更新标记(如果不存在则添加)Mark not update distance leash info.Mark not update scale leash info.marks()返回marks记录组件的值。返回maxDistance记录组件的值。int返回maxKeepLeashTicks记录组件的值。removeMark(String mark) 移除单个标记removeMarks(@NotNull Collection<String> marksToRemove) 移除多个标记(集合版本)removeMarks(String @NotNull ... marksToRemove) 移除多个标记reserved()返回reserved记录组件的值。Reset keep ticks leash info.final StringtoString()返回此记录的字符串表示形式。transferHolder(net.minecraft.world.entity.Entity entity) Transfer holder leash info.transferHolder(net.minecraft.world.entity.Entity entity, int maxKeepLeashTicks) Transfer holder leash info.transferHolder(net.minecraft.world.entity.Entity entity, int maxKeepLeashTicks, String newReserved) Transfer holder leash info.transferHolder(net.minecraft.world.entity.Entity entity, String newReserved) Transfer holder leash info.移除无需更新标记移除无需更新距离标记移除无需更新比例标记修改标记集合withReserved(String newReserved) 修改保留字段
-
字段详细资料
-
构造器详细资料
-
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 uuidholderId- the holder idreserved- the reservedmaxDistance- the max distanceelasticDistanceScale- the elastic distance scalekeepTicks- the keep ticksmaxKeepTicks- 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 uuidholderId- the holder idmarks- the marksreserved- the reservedmaxDistance- the max distanceelasticDistanceScale- the elastic distance scalekeepTicks- the keep ticksmaxKeepTicks- 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 posholderId- the holder idreserved- the reservedmaxDistance- the max distanceelasticDistanceScale- the elastic distance scalekeepTicks- the keep ticksmaxKeepTicks- 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 posholderId- the holder idmarks- the marksreserved- the reservedmaxDistance- the max distanceelasticDistanceScale- the elastic distance scalekeepTicks- the keep ticksmaxKeepTicks- 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 entitymarks- the marksreserved- the reservedmaxDistance- the max distanceelasticDistanceScale- the elastic distance scalekeepTicks- the keep ticksmaxKeepTicks- 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 entityreserved- the reservedmaxDistance- the max distanceelasticDistanceScale- the elastic distance scalekeepTicks- the keep ticksmaxKeepTicks- the max keep ticks- 返回:
- the leash info
-
decrementKeepTicks
Decrement keep ticks leash info.- 返回:
- the leash info
-
resetKeepTicks
Reset keep ticks leash info.- 返回:
- the leash info
-
transferHolder
Transfer holder leash info.- 参数:
entity- the entity- 返回:
- the leash info
-
transferHolder
Transfer holder leash info.- 参数:
entity- the entitynewReserved- the new reserved- 返回:
- the leash info
-
transferHolder
Transfer holder leash info.- 参数:
entity- the entitymaxKeepLeashTicks- 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 entitymaxKeepLeashTicks- the max keep leash ticksnewReserved- the new reserved- 返回:
- the leash info
-
withReserved
修改保留字段- 参数:
newReserved- the new reserved- 返回:
- the leash info
-
withMarks
修改标记集合- 参数:
newMarks- the new marks- 返回:
- the leash info
-
markNotUpdate
添加无需更新标记(如果不存在则添加)- 返回:
- the leash info
-
markNotUpdateDistance
Mark not update distance leash info.- 返回:
- the leash info
-
markNotUpdateScale
Mark not update scale leash info.- 返回:
- the leash info
-
unmarkNotUpdate
移除无需更新标记- 返回:
- the leash info
-
unmarkNotUpdateDistance
移除无需更新距离标记- 返回:
- the leash info
-
unmarkNotUpdateScale
移除无需更新比例标记- 返回:
- the leash info
-
isNotUpdate
public boolean isNotUpdate()检查是否包含无需更新标记- 返回:
- the boolean
-
isNeedUpdateDistance
public boolean isNeedUpdateDistance()是否需距离更新标记- 返回:
- the boolean
-
isNeedUpdateScale
public boolean isNeedUpdateScale()是否需比例更新- 返回:
- the boolean
-
addMark
添加标记(如果不存在则添加)- 参数:
mark- the mark- 返回:
- the leash info
-
addMarks
添加多个标记(自动检测并跳过重复标记)- 参数:
marksToAdd- the marks to add- 返回:
- the leash info
-
addMarks
添加多个标记(集合版本)- 参数:
marksToAdd- the marks to add- 返回:
- the leash info
-
removeMark
移除单个标记- 参数:
mark- the mark- 返回:
- the leash info
-
removeMarks
移除多个标记- 参数:
marksToRemove- the marks to remove- 返回:
- the leash info
-
removeMarks
移除多个标记(集合版本)- 参数:
marksToRemove- the marks to remove- 返回:
- the leash info
-
hasMark
检查是否包含指定标记- 参数:
mark- the mark- 返回:
- the boolean
-
hasAllMarks
检查是否包含所有指定标记- 参数:
marksToCheck- the marks to check- 返回:
- the boolean
-
hasAnyMark
检查是否包含任意指定标记- 参数:
marksToCheck- the marks to check- 返回:
- the boolean
-
getMarks
获取所有标记(不可修改的视图)- 返回:
- the marks
-
clearAllMarks
清除所有标记- 返回:
- the leash info
-
toString
返回此记录的字符串表示形式。此表示形式包含类型的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用Objects::equals(Object,Object)对参考组件进行比较;使用 '==' 对基元组件进行比较 -
blockPosOpt
返回blockPosOpt记录组件的值。- 返回:
blockPosOpt记录组件的值
-
holderUUIDOpt
返回holderUUIDOpt记录组件的值。- 返回:
holderUUIDOpt记录组件的值
-
holderIdOpt
返回holderIdOpt记录组件的值。- 返回:
holderIdOpt记录组件的值
-
marks
返回marks记录组件的值。- 返回:
marks记录组件的值
-
reserved
返回reserved记录组件的值。- 返回:
reserved记录组件的值
-
maxDistance
返回maxDistance记录组件的值。- 返回:
maxDistance记录组件的值
-
elasticDistanceScale
返回elasticDistanceScale记录组件的值。- 返回:
elasticDistanceScale记录组件的值
-
keepLeashTicks
public int keepLeashTicks()返回keepLeashTicks记录组件的值。- 返回:
keepLeashTicks记录组件的值
-
maxKeepLeashTicks
public int maxKeepLeashTicks()返回maxKeepLeashTicks记录组件的值。- 返回:
maxKeepLeashTicks记录组件的值
-