Class PoliticalSystemManager

java.lang.Object
net.chen.legacyLand.nation.politics.PoliticalSystemManager

public class PoliticalSystemManager extends Object
政治体制管理器 - 从 politics.yml 加载政体定义,管理效果生命周期
  • Method Details

    • getInstance

      public static PoliticalSystemManager getInstance()
    • load

      public void load(LegacyLand plugin)
      从 politics.yml 加载所有政体定义
    • getSystem

      public PoliticalSystem getSystem(String id)
      获取指定政体
    • getDefaultSystem

      public PoliticalSystem getDefaultSystem()
      获取默认政体(配置中的第一个)
    • isValidSystem

      public boolean isValidSystem(String id)
      检查政体ID是否有效
    • getSystemIds

      public Set<String> getSystemIds()
      获取所有政体ID
    • registerEffect

      public void registerEffect(String systemId, PoliticalEffect effect)
      为指定政体注册自定义效果
      Parameters:
      systemId - 政体ID
      effect - 效果实现
    • registerEffectFactory

      public void registerEffectFactory(String effectName, PoliticalEffectFactory factory)
      注册效果工厂(用于从配置创建效果)
      Parameters:
      effectName - 效果名称(对应配置中的 custom-effects 键)
      factory - 效果工厂
    • applySystemChange

      public void applySystemChange(com.palmergames.bukkit.towny.object.Nation nation, String oldSystemId, String newSystemId)
      当国家切换政体时,触发效果变更
      Parameters:
      nation - 国家
      oldSystemId - 旧政体ID(可为null)
      newSystemId - 新政体ID
    • isOnCooldown

      public boolean isOnCooldown(String nationName)
      检查国家是否在切换冷却中
    • getRemainingCooldown

      public long getRemainingCooldown(String nationName)
      获取剩余冷却时间(秒)