Skip to content

Skillw/AttributeSystem

Repository files navigation

AttributeSystem II

插件永久免费


插件

说明内容
兼容版本1.12.2+ (理论)
硬依赖Pouvoir
软依赖PlaceholderAPI Mythicmobs SkillAPI

GitHub Release

介绍

AttributeSystem 是基于 TabooLib VI & Pouvoir 编写的一款属性引擎插件
奉单一职责的宗旨,本引擎仅提供属性 属性读取 属性实现框架,具体属性与功能需要通过 配置 / API 来实现

AttributeSystem 提供包括但不限于以下API:

  • AttributeSystemAPI
  • AttributeManager
  • ConditionManager
  • EquipmentDataManager
  • AttributeDataManager
  • OperationManager
  • RealizeManager
  • ReadPatternManager

你可以通过编写代码/脚本来拓展AttributeSystem的诸多功能

包括但不限于

属性 (Attribute)

Attribute.createAttribute("example", ReadGroup){names +="示例属性" }.register()
varAttribute=find('com.skillw.attsystem.api.attribute.Attribute')varReadGroup=static('ReadGroup')//@Awake(Active)functionregAtt(){Attribute.createAttribute("example",ReadGroup,(builder)=>{builder.names.add("示例属性")}).register()}

读取格式 (Read Pattern)

@AutoRegister object MyReadPattern : ReadPattern("my_read_pattern"){overridefunread(string:String, attribute:Attribute, entity:LivingEntity?, slot:String?): Status?{//code } overridefunreadNBT(map:Map<String, Any>, attribute:Attribute): Status?{//code } overridefunplaceholder(key:String, attribute:Attribute, status:Status, entity:LivingEntity?): Any?{//code } overridefunstat(attribute:Attribute, status:Status, entity:LivingEntity?): TellrawJson{//code } }
//@ReadPattern(my_read_pattern)functionread(string,attribute,entity,slot){//code}functionreadNBT(map,attribute){//code}functionplaceholder(key,attribute,status,entity){//code}functionstat(attribute,status,entity){//code}

条件 (Condition)

@AutoRegister object LevelCondition : BaseCondition("level", setOf("Lv\\.(?<value>\\d+)", "等级限制: (?<value>\\d+)"), ConditionType.ALL){overridefuncondition(slot:String?, entity:LivingEntity?, matcher:Matcher, text:String): Boolean{entity ?:returntrueif (entity !isPlayer) returntrueval level =Coerce.toInteger(matcher.group("value")) return entity.level >= level } }
varCoere=static('Coere')//@Condition(Level,ALL,Lv\.(?<value>\d+),等级限制: (?<value>\d+))functionlevel(slot,entity,matcher,text){varhasEntity=entity!="null"if(!hasEntity)returntrueif(!(entityinstanceofPlayer)){returntrue}varlevel=Coerce.toInteger(matcher.group("value"))returnentity.level>=level}

Links

WIKI www.skillw.com/docs/attsystem/intro

JavaDoc http://doc.skillw.com/attsystem/

MCBBS https://www.mcbbs.net/forum.php?mod=viewthread&tid=1307249

爱发电 https://afdian.net/@glom_

About

Bukkit Attribute Engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •