Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[问题]: 覆盖文件时出现错误 #90

Open
3 tasks done
liangcha385 opened this issue Aug 3, 2024 · 1 comment
Open
3 tasks done

[问题]: 覆盖文件时出现错误 #90

liangcha385 opened this issue Aug 3, 2024 · 1 comment

Comments

@liangcha385
Copy link

🚀 是否已尝试最新的版本

  • 我已更新 TrMenu 至最新的版本, 并且同样复现该问题.

📚 是否已查阅 Wiki

  • 我已查阅 Wiki 对于该问题的相关内容, 并确定该问题是存在的.

🔗 是否存在重复 issue

  • 我已翻阅现有的 issue 没有发现内容重复, 亦或是对现有 issue 的更详细的描述.

📰 服务端详细信息

TrMenu Dump Information (Date: 2024-08-03 21:56:46)

| Server OS: Windows Server 2022 amd64 10.0
| Server software: git-Leaf-"83c2468" (MC: 1.20.4) (1.20.4-R0.1-SNAPSHOT)
| Java version: 21.0.4

| TrMenu: 3.3.0b-SNAPSHOT
Installed Plugins: 
· Adyeshach - 2.0.16 (0 KB)
· AkariLevel - 4.0.2 (0 KB)
· AttributePlus - 3.3.2.6 (0 KB)
· Citizens - 2.0.33-SNAPSHOT (build 3399) (0 KB)
· HeadDatabase - 4.19.8 (0 KB)
· KnapsackToGo4 - 2024.06.05.1539 (0 KB)
· LegendaryRunePlus - 1.0.6 (0 KB)
· LuckPerms - 5.4.134 (0 KB)
· MinePay - Release 3.2.8 (0 KB)
· MythicMobs - 5.6.2-3e052553 (0 KB)
· NotQuests - 5.17.1 (0 KB)
· PAPIProxyBridge - 1.6.1 (0 KB)
· PlaceholderAPI - 2.11.6 (0 KB)
· PlayerParticles - 8.6 (0 KB)
· PlayerPoints - 3.2.7 (0 KB)
· PlayerTitle - 4.1.3 (0 KB)
· ProtocolLib - 5.3.0-SNAPSHOT-723 (0 KB)
· SayanVanish - 1.4.1-SNAPSHOT-build.174-230b3c9 (0 KB)
· SignedVelocity - 1.2.3 (0 KB)
· TAB-Bridge - 5.0.7 (0 KB)
· Terra - 6.4.3-BETA+ab60f14ff (0 KB)
· TrMenu - 3.3.0b-SNAPSHOT (0 KB)
· Triton - 3.11.0 (0 KB)
· Vault - 1.7.3-b131 (0 KB)
· ViaBackwards - 5.0.2 (0 KB)
· ViaVersion - 5.0.2 (0 KB)
· WorldEdit - 7.3.4+6823-6263244 (0 KB)
· WorldGuard - 7.0.9+5934e49 (0 KB)
· XConomy - 2.26.3 (0 KB)
· packetevents - 2.4.0 (0 KB)
· spark - 1.10.93 (0 KB)
· voicechat - 2.5.16 (0 KB)

🔍 详细的描述

当我对相同文件名的文件进行覆盖时,会呼出错误
但重新载入的为已覆盖的版本

复现步骤:

  1. 让 trmenu 加载一份菜单,比如为 main_menu.yml
  2. 在运行过程中将一份同名文件覆盖,问题出现

🗄 服务端日志

[21:54:39 WARN]: [TrMenu] File: plugins\TrMenu\menus\main_menu.yml
[21:54:39 INFO]: [TrMenu] 错误 | 载入菜单 main_menu 过程中发生错误! 定位于: YAML parsing failed
[21:54:39 INFO]: com.electronwill.nightconfig_3_6_7.core.io.ParsingException: YAML parsing failed
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.module.configuration.YamlParser.parse(YamlParser.kt:58)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//com.electronwill.nightconfig_3_6_7.core.io.ConfigParser.parse(ConfigParser.java:113)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//com.electronwill.nightconfig_3_6_7.core.io.ConfigParser.parse(ConfigParser.java:219)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//com.electronwill.nightconfig_3_6_7.core.io.ConfigParser.parse(ConfigParser.java:160)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//com.electronwill.nightconfig_3_6_7.core.io.ConfigParser.parse(ConfigParser.java:148)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.module.configuration.ConfigFile.loadFromFile(ConfigFile.kt:43)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.module.configuration.Configuration$Companion.loadFromFile(Configuration.kt:120)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.module.configuration.Configuration$Companion.loadFromFile$default(Configuration.kt:117)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.module.conf.MenuSerializer.serializeMenu(MenuSerializer.kt:66)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.module.conf.Loader$listen$1.invoke(Loader.kt:127)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.module.conf.Loader$listen$1.invoke(Loader.kt:124)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.util.file.FileListener.listener$lambda$0(FileListener.kt:20)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.common5.FileWatcher.lambda$addSimpleListener$2(FileWatcher.java:62)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.common5.FileWatcher.lambda$new$0(FileWatcher.java:43)
[21:54:39 INFO]:        at java.base/java.util.HashMap.forEach(HashMap.java:1429)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.common5.FileWatcher.lambda$new$1(FileWatcher.java:38)
[21:54:39 INFO]:        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
[21:54:39 INFO]:        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
[21:54:39 INFO]:        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
[21:54:39 INFO]:        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[21:54:39 INFO]:        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[21:54:39 INFO]:        at java.base/java.lang.Thread.run(Thread.java:1583)
[21:54:39 INFO]: Caused by: unacceptable code point '' (0x0) special characters are not allowed
[21:54:39 INFO]: in "'reader'", position 0
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.reader.StreamReader.update(StreamReader.java:208)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.reader.StreamReader.ensureEnoughData(StreamReader.java:173)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.reader.StreamReader.ensureEnoughData(StreamReader.java:168)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.reader.StreamReader.peek(StreamReader.java:123)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1204)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:320)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.scanner.ScannerImpl.checkToken(ScannerImpl.java:238)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.parser.ParserImpl$ParseImplicitDocumentStart.produce(ParserImpl.java:210)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.parser.ParserImpl.peekEvent(ParserImpl.java:161)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.parser.ParserImpl.checkEvent(ParserImpl.java:152)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.composer.Composer.getSingleNode(Composer.java:156)
[21:54:39 INFO]:        at AttributePlus-3.3.2.6.jar//org.yaml.snakeyaml_2_2.Yaml.compose(Yaml.java:575)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.module.configuration.YamlParser.loadFromString(YamlParser.kt:69)
[21:54:39 INFO]:        at TrMenu-3.3.0b-SNAPSHOT.jar//me.arasple.mc.trmenu.taboolib.module.configuration.YamlParser.parse(YamlParser.kt:56)
[21:54:39 INFO]:        ... 21 more
[21:54:39 INFO]: [TrMenu] 良好 | 自动重新载入菜单 main_menu.yml (47ms)

⚙ 配置文件

Title:
  - 'Hello, TrMenu!'
  - 'Hello, %player_name%!'
  - 'Support Animated Titles'

Title-Update: 80

Layout:
  - - '########`Close`'
    - '         '
    - '   PT   '
    - '         '
    - '####*###`Next`'

  - - '########`Close`'
    - '         '
    - '         '
    - '         '
    - '`Pre`########'

PlayerInventory:
  - - '         '
    - '         '
    - '         '
    - '         '

Options:
  Arguments: false
  Default-Arguments: [ ]
  # Not work with animated title
  Free-Slots:
    - 71-73
  Default-Layout: 0
  Hide-Player-Inventory: false
  Min-Click-Delay: 200
  Depend-Expansions: [ 'server', 'player', 'progress', 'animations' ]

Bindings:
  Commands:
    - '(?i)example(-)?(gui)?(s)?'
  Items:
    - 'material:compass'
    - 'material:clock,lore:OPEN_MENU'
    - 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDRmNDUyZDk5OGVhYmFjNDY0MmM2YjBmZTVhOGY0ZTJlNjczZWRjYWUyYTZkZmQ5ZTZhMmU4NmU3ODZlZGFjMCJ9fX0='

Events:
  Open:
    - condition: 'perm *trmenu.use'
      actions:
        - 'sound: BLOCK_CHEST_OPEN-1-0'
      deny:
        - 'sound: ENTITY_ITEM_BREAK-1-0'
        - 'title: `&c&lPermission Required` `&7&lYou need permission &6&ltrmenu.use &7&lto open this trplugins.menu` 15 20 15'
        - 'return'
  Close:
    - 'sound: BLOCK_CHEST_CLOSE-1-0'

Icons:
  '#':
    update: [ -1, 10, 15, -1 ]
    display:
      material: Gray Stained Glass Pane
      name: [ '&fTr&7Menu', '&7Tr&8Menu', '&8Tr&0Menu','&7Tr&8Menu' ]
      lore:
        - - '&7Thanks &f:> &7for using!'
        - - '&7Thanks &f:) &7for using!'
    actions:
      all: 'sound: BLOCK_NOTE_BLOCK_PLING-1-2'

  Close:
    update: [ -1, 5, -1, -1 ]
    display:
      material: Red Stained Glass Pane
      name: [ '&cC&7lose', '&cCl&7ose', '&cClo&7se', '&cClos&7e', '&cClose' ]
    actions:
      all: close

  Next:
    display:
      material: Cyan Stained Glass Pane
      name: '&bN&3ext Page'
    actions:
      all:
        - 'page: 1'
        - 'sound: BLOCK_CHEST_OPEN-1-2'
  Pre:
    display:
      material: Lime Stained Glass Pane
      name: '&aP&2revious Page'
    actions:
      all:
        - 'page: 0'
        - 'sound: BLOCK_CHEST_OPEN-1-2'

  '*':
    update: [ -1, 5, 20, -1 ]
    display:
      material: 'skull:9842dc3b917b1a796c303e15105474a8e315de7982b6ca54feafb5a4d13d4e95'
      name:
        - '&3&lSERVER'
        - '&b&lSE&3&lRVER'
        - '&3&lS&b&lER&3&lVER'
        - '&3&lSE&b&lRV&3&lER'
        - '&3&lSER&b&lVE&3&lR'
        - '&3&lSERV&b&lER'
      lore:
        - ''
        - '&8| &7RAM: &2%server_ram_used%/%server_ram_total% &7MB'
        - '&8[ %progress_bar_{server_ram_used}_m:{server_ram_total}_c:&3■_p:&7■_r:&8■_l:20% &8]'
        - ''
        - '&b${flash_➥} &3Left-Click &7to display more info.'
    actions:
      left:
        - 'set-meta: icon_server_hide true'
        - 'sound: BLOCK_NOTE_BLOCK_BIT-1-0'
        - 'refresh: *'
    icons:
      - condition: 'check &icon_server_hide is *true'
        priority: 5
        inherit: true
        display:
          lore:
            - ''
            - '&8| &7RAM: &2%server_ram_used%/%server_ram_total% &7MB'
            - '&8[ %progress_bar_{server_ram_used}_m:{server_ram_total}_c:&3■_p:&7■_r:&8■_l:20% &8]'
            - ''
            - '&8| &7ONLINE: &e%server_online% &6${js: utils.getOnlinePlayers().size() > 1 ? "Players" : "Player"}'
            - '&8| &7UPTIME: &e%server_uptime%'
            - '&8| &7TPS: &a%server_tps%'
            - ''
            - '&a${flash_➥} &2Right-Click &7to hide extra-info.'
        actions:
          right:
            - 'rem-meta: icon_server_hide'
            - 'sound: BLOCK_NOTE_BLOCK_BIT-1-2'
            - 'refresh: *'

  P:
    update: 20
    display:
      material: 'head:%player_name%'
      name: '&2&l%player_name%'
      lore:
        - ''
        - 'Hello, %player_name%! There''s your profile.'
        - ''
        - '&8| &7HEALTH: &c%player_health_rounded% ♥'
        - '&8| &7LEVEL: &3Lv.%player_level%'
        - '&8| &7TIME: &3%player_world_time_24%'
        - ''
        - '&8| &7REGISTER DATE: &3%player_first_join_date%'
        - '&8| &7IP: &3%player_ip%'
        - '&8| &7PING: ${js: varInt("%player_ping%") < 60 ? "&a" : "&2"}%player_ping% ms'
        - ''
        - '&8➥ &7Press number key &66 &7to high jump'
        - ''
        - '&8%player_uuid%'
    actions:
      all: 'sound: BLOCK_NOTE_BLOCK_PLING-1-2'
      number_key_6:
        - 'close'
        - 'title: `&b&LGET READY` &6&l3 10 20 40 &&& sound: ENTITY_ENDER_DRAGON_FLAP-1-0'
        - 'title: `&3&LGET READY` &6&l2 &&& sound: ENTITY_ENDER_DRAGON_FLAP-1-0 {Delay=20}'
        - 'title: `&9&LGET READY` &c&l1 &&& sound: ENTITY_ENDER_DRAGON_FLAP-1-0 {Delay=40}'
        - 'js: player.setVelocity(player.getVelocity().setY(25)) &&& js: player.setNoDamageTicks(600) &&& sound: ENTITY_ENDER_DRAGON_FLAP-1-1 {Delay=50}'
        - 'js: player.setVelocity(player.getVelocity().setY(45)) &&& title: &d&LAGAIN &7&lHIGHER! &&& sound: ENTITY_ENDER_DRAGON_FLAP-1-2 {Delay=100}'

  T:
    update: 20
    display:
      material: compass
      name: '&3&lTrMenu'
      amount: '${js: varInt("%server_time_s%") + 1}'
      lore:
        - ''
        - 'The following is the relevant statistics'
        - 'of TrMenu, from the bStats'
        - '&8(https://bstats.org/)'
        - ''
        - '&8| &3Servers: ${bStats.servers}'
        - '&8| &3Players: ${bStats.players}'
        - '&8| &3Menus: ${bStats.menus}'
        - ''
        - 'In the past half an hour,'
        - 'Menus have been opened ${bStats.opens} times'
        - ''

  Bee:
    update: 20
    display:
      material: 'head:b727d0ab03f5cd022f8705d3f7f133ca4920eae8e1e47b5074433a137e691e4e'
      name: '&eBee ~'
      slots:
        - [ 9 ]
        - [ 18 ]
        - [ 28 ]
        - [ 29 ]
        - [ 30 ]
        - [ 31 ]
        - [ 32 ]
        - [ 33 ]
        - [ 34 ]
        - [ 35 ]
        - [ 26 ]
        - [ 16 ]
        - [ 15 ]
        - [ 14 ]
        - [ 13 ]
        - [ 12 ]
        - [ 11 ]
        - [ 10 ]
    actions:
      all:
        - 'set-meta: angryBee true'
        - 'sound: ENTITY_ENDERMAN_HURT-1-2'
        - 'rem-meta: angryBee &&& refresh: Bee &&& sound: ENTITY_SPIDER_STEP-1-2 {Delay=80}'
        - 'refresh: Bee'
    icons:
      - condition: 'check &angryBee is *true'
        display:
          name: '&cBee &4~'
          material: 'head:e6b74e052b74288799ba6d9f35c5d0221cf8b04331547ec2f68d73597ae2c9b'
          lore:
            - 'unfortunate...'
        actions:
          all: 'sound: ENTITY_ENDERMAN_HURT-1-2'

Tasks:
  tikTok:
    period: 80
    task:
      - condition: '$ sender.isOp()'
        actions:
          - 'sound: BLOCK_NOTE_BLOCK_BIT-1-2'

Functions:
  flash: |-
    function flash() {
      var display = new Date().getSeconds() % 2 == 0
      return display ? args[0] : "  "
    }
    flash()

  bStats:
    servers: vars("${bStats.query_servers_&a_&7 servers}")
    players: vars("${bStats.query_players_&6_&7 players}")
    menus: vars("${bStats.query_menus_&2_&7 menus}")
    opens: |-
      function opens() {
        var data = utils.query("https://bstats.org/api/v1/plugins/5742/charts/menu_open_counts/data?maxElements=1")
        if (data.has()){
          return "&b" + data.asJson().getAsJsonArray().get(0).getAsJsonArray().get(1) + "&7"
        }
        return "&8Loading." + vars("${flash_.}") + "&7"
      }
      opens()
    query: |-
      function query() {
        var data = utils.query("https://bstats.org/api/v1/plugins/5742/charts/" + args[0] + "/data?maxElements=1")
        if (data.has()){
          return args[1] + data.asJson().getAsJsonArray().get(0).getAsJsonArray().get(1) + args[2]
        }
        return "&8Loading." + vars("${flash_.}")
      }
      query()
@CoderKuo
Copy link
Owner

最新版本测试一下 我这里没出现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants