CarbonPaper99
关于对config获取的问题
例如:
config:
  # 在这里自定义添加
  # 格式:
  # <内部id>:
  #   playername: xxx
  #   runcommands:
  #   - '[Executors.Player] help'
由于config.<内部id>是玩家自己添加的
我要怎么get到config.<内部id>以及以下的内容呢?

hahahahah
本帖最后由 hahahahah 于 2019-6-22 16:27 编辑

没记错有个getKeys(boolean)方法获取键
for(String key:config.getKeys(true))
然后判断下第一个点前面字符串就行了

还一个方法就是,你在config.yml加一个记录添加的内部id

  1. config:
  2.   ids: id1;id2;id3
  3.   id1:
  4.     playername: xxx
  5.     runcommands:
  6.      - '[Executors.Player] help'
  7.   id2:
  8.     playername: xxx
  9.     runcommands:
  10.      - '[Executors.Player] help'
  11.   id3:
  12.     playername: xxx
  13.     runcommands:
  14.      - '[Executors.Player] help'
复制代码
然后处理下就行了

第一页 上一页 下一页 最后一页