关于对config获取的问题
例如:
config:
# 在这里自定义添加
# 格式:
# <内部id>:
# playername: xxx
# runcommands:
# - '[Executors.Player] help'
由于config.<内部id>是玩家自己添加的
我要怎么get到config.<内部id>以及以下的内容呢?
例如:
config:
# 在这里自定义添加
# 格式:
# <内部id>:
# playername: xxx
# runcommands:
# - '[Executors.Player] help'
由于config.<内部id>是玩家自己添加的
我要怎么get到config.<内部id>以及以下的内容呢?
 本帖最后由 hahahahah 于 2019-6-22 16:27 编辑 
没记错有个getKeys(boolean)方法获取键
for(String key:config.getKeys(true))
然后判断下第一个点前面字符串就行了
还一个方法就是,你在config.yml加一个记录添加的内部id
复制代码然后处理下就行了
没记错有个getKeys(boolean)方法获取键
for(String key:config.getKeys(true))
然后判断下第一个点前面字符串就行了
还一个方法就是,你在config.yml加一个记录添加的内部id
 
- config:
 
-   ids: id1;id2;id3
 
-   id1:
 
-     playername: xxx
 
-     runcommands:
 
-      - '[Executors.Player] help'
 
-   id2:
 
-     playername: xxx
 
-     runcommands:
 
-      - '[Executors.Player] help'
 
-   id3:
 
-     playername: xxx
 
-     runcommands:
 
-      - '[Executors.Player] help'