Class Realm

java.lang.Object
com.mclds.plugins.realm.Realm

public class Realm extends Object
  • Field Details

    • name

      public String name
    • owner_uuid

      public String owner_uuid
    • nickname

      public String nickname
      目前用于传送指令
    • root

      @Nullable public @Nullable org.bukkit.Location root
    • root_realm_data

      @Nullable public @Nullable Realm.RootRealmData root_realm_data
    • location

      public org.bukkit.Location location
    • children

      public Set<org.bukkit.Location> children
      子领地
    • create_at

      public double create_at
      创建时间,对金币返还有帮助
    • explosion_destroyable_blocks

      public List<String> explosion_destroyable_blocks
      可以被爆炸破坏的方块
    • explosion_protect_blocks

      public List<String> explosion_protect_blocks
      爆炸时可以保护的方块
  • Constructor Details

    • Realm

      public Realm(String owner_uuid, org.bukkit.Location location, @Nullable @Nullable org.bukkit.Location root)
  • Method Details

    • isRoot

      public boolean isRoot()
    • getOwner

      public org.bukkit.OfflinePlayer getOwner()
    • isOwner

      public boolean isOwner(org.bukkit.OfflinePlayer player)
    • isMember

      public boolean isMember(org.bukkit.OfflinePlayer player)
    • isMemberHasPermission

      public boolean isMemberHasPermission(org.bukkit.OfflinePlayer member, RealmPermission permission)
    • getMemberPlayers

      public Set<org.bukkit.OfflinePlayer> getMemberPlayers()
    • getMember

      public Member getMember(org.bukkit.OfflinePlayer player)
    • addMember

      public boolean addMember(org.bukkit.OfflinePlayer player)
    • getDefaultMemberPermissions

      public Set<RealmPermission> getDefaultMemberPermissions()
      获取领地默认成员权限(统一存储在主领地)。 未设置(null,兼容旧数据)时回退为 {INTERACT},与历史 addMember 行为一致。
    • setDefaultMemberPermissions

      public void setDefaultMemberPermissions(Set<RealmPermission> permissions)
      设置领地默认成员权限(写入主领地)。子领地委托其主领地。
    • addMembers

      public boolean addMembers(Set<org.bukkit.OfflinePlayer> players)
    • update

      public boolean update()
    • removeMember

      public boolean removeMember(org.bukkit.OfflinePlayer player)
    • getRootRealm

      @Nullable public @Nullable Realm getRootRealm()
      获取主领地 如果当前领地是主领地,则返回NULL
    • getRootRealmOrSelf

      public Realm getRootRealmOrSelf()
    • children

      public Set<@Nullable Realm> children()
    • save

      public void save()
    • addChild

      public void addChild(Realm realm)
    • removeChild

      public void removeChild(Realm realm)
    • attachToRoot

      public void attachToRoot(Realm rootRealm)
      将本领地挂到指定主领地下(双向同步): 设置本领地 root 指向主领地,并把本领地加入主领地的 children 集合,最后一起持久化。
    • detachFromRoot

      public void detachFromRoot()
      从所属主领地的 children 集合中移除自己(双向同步的"摘除"侧)。 仅更新并持久化主领地,不修改本领地的 root 字段(由调用方决定,例如本领地即将被删除)。 若主领地已不存在则安全跳过。
    • getViewRecords

      public LinkedHashMap<String,Double> getViewRecords()
    • getValidViewCount

      public int getValidViewCount()
      获取有效的领地浏览数量
    • increaseViewCount

      public void increaseViewCount(String uniqueViewKey)
    • setListShowType

      public void setListShowType(RealmListShowType listShowType)
    • getListShowType

      public RealmListShowType getListShowType()
    • findRootRealmAndSort

      public static List<Realm> findRootRealmAndSort(List<Realm> realms, RealmSortType sortType)
      找到每个不用子领地的主领地,并对其排序领地
    • sort

      public static List<Realm> sort(List<Realm> realms, RealmSortType sortType)
    • setRealmTeleportLocation

      public void setRealmTeleportLocation(org.bukkit.Location location)
      设置主领地传送位置,如果当前领地不是主领地,则无法操作
    • getRealmTeleportLocation

      @Nullable public @Nullable org.bukkit.Location getRealmTeleportLocation()
      获取主领地传送位置,如果当前领地不是主领地,则返回NULL
    • saveRootRealmSetting

      public void saveRootRealmSetting(RealmSetting setting)
    • getRootRealmSetting

      public RealmSetting getRootRealmSetting()
      获取主领地设置
    • getName

      public String getName()
    • getNameOrRootName

      public String getNameOrRootName()
    • getFullDisplayName

      public String getFullDisplayName()
    • getLocationFormat

      public String getLocationFormat()
    • getByLocationFormat

      public static Realm getByLocationFormat(String locationFormat)
    • setIcon

      public void setIcon(String namespacedId)
    • setDescription

      public void setDescription(String desc)
    • setMembers

      public void setMembers(Set<Member> members)
    • clearMembers

      public void clearMembers()
    • hasIcon

      public boolean hasIcon()
    • getIcon

      public String getIcon()
    • getIconItem

      public org.bukkit.inventory.ItemStack getIconItem(org.bukkit.entity.Player viewer)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getRealmTotalMembers

      public static Set<Member> getRealmTotalMembers(Realm realm)
      获取当前领地所属的主领地的全部成员
    • isSameRootRealm

      public boolean isSameRootRealm(Realm other)
      判断两个领地是否属于同一个主领地
      Parameters:
      other - 另一个领地
    • getExplosionDestroyableBlocks

      public List<String> getExplosionDestroyableBlocks()
    • setExplosionDestroyableBlocks

      public void setExplosionDestroyableBlocks(List<String> blocks)
    • setExplosionProtectBlocks

      public void setExplosionProtectBlocks(List<String> explosion_protect_blocks)
    • getExplosionProtectBlocks

      public List<String> getExplosionProtectBlocks()
    • toString

      public String toString()
      Overrides:
      toString in class Object