toxicity188 / BetterHud

A simple and powerful HUD plugin for minecraft!
MIT License
78 stars 13 forks source link

folia error #5

Closed ewof closed 3 months ago

ewof commented 3 months ago
[06:58:14 ERROR]: Thread Folia Async Scheduler Thread #31 failed main thread check: Cannot read world asynchronously
java.lang.Throwable: null
        at io.papermc.paper.util.TickThread.ensureTickThread(TickThread.java:57) ~[folia-1.20.4.jar:git-Folia-"25ee657"]
        at org.bukkit.craftbukkit.v1_20_R3.block.CraftBlock.getBiome(CraftBlock.java:357) ~[folia-1.20.4.jar:git-Folia-"25ee657"]
        at com.extendedclip.papi.expansion.player.PlayerUtil.getBiome(PlayerUtil.java:246) ~[?:?]
        at com.extendedclip.papi.expansion.player.PlayerExpansion.onRequest(PlayerExpansion.java:298) ~[?:?]
        at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:119) ~[PlaceholderAPI-2.11.5-DEV-Folia.jar:?]
        at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:71) ~[PlaceholderAPI-2.11.5-DEV-Folia.jar:?]
        at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:99) ~[PlaceholderAPI-2.11.5-DEV-Folia.jar:?]
        at kr.toxicity.hud.manager.PlaceholderManagerImpl$reload$1$1$1.invoke(PlaceholderManagerImpl.kt:429) ~[BetterHud-beta-18.jar:?]
        at kr.toxicity.hud.manager.PlaceholderManagerImpl$reload$1$1$1.invoke(PlaceholderManagerImpl.kt:421) ~[BetterHud-beta-18.jar:?]
        at kr.toxicity.hud.manager.PlaceholderManagerImpl.update(PlaceholderManagerImpl.kt:451) ~[BetterHud-beta-18.jar:?]
        at kr.toxicity.hud.player.HudPlayerImpl.update(HudPlayerImpl.kt:93) ~[BetterHud-beta-18.jar:?]
        at kr.toxicity.hud.player.HudPlayerImpl$startTick$1.invoke(HudPlayerImpl.kt:73) ~[BetterHud-beta-18.jar:?]
        at kr.toxicity.hud.player.HudPlayerImpl$startTick$1.invoke(HudPlayerImpl.kt:72) ~[BetterHud-beta-18.jar:?]
        at kr.toxicity.hud.util.PluginsKt.asyncTaskTimer$lambda$8(Plugins.kt:40) ~[BetterHud-beta-18.jar:?]
        at kr.toxicity.hud.scheduler.FoliaScheduler.asyncTaskTimer$lambda$3(FoliaScheduler.kt:54) ~[BetterHud-beta-18.jar:?]
        at io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler$AsyncScheduledTask.run(FoliaAsyncScheduler.java:217) ~[folia-1.20.4.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
toxicity188 commented 3 months ago

It is happened because you called 'biome' asynchrously. you should use sync placeholder.

ewof commented 3 months ago

layouts

temperature:
   placeholder: "%player_biome%"
   update: 20
   variable: "temperature"

placeholders

temperature:
  images:
    "1":
      name: temperature
      x: 100
      y: 38
  texts:
    "1":
      name: text
      pattern: "[string:temperature]"
      number-format: "#,###" #number format
      outline: true
      color: white
      scale: 0.5
      x: 110
      y: 38
      align: left

i dont even want to use player_biome i want to use mvndiseasons_temperature but when i do that it just says <none> i only set it to player_biome to see what would happen but if i do /papi parse me %mvndiseasons_temperature% it works fine

toxicity188 commented 3 months ago

temperature: placeholder: "%mvndiseasons_temperature%" update: 20 variable: "temperature"

ewof commented 3 months ago

yes if i do this it just says <none> image

toxicity188 commented 3 months ago

Then try it:

temperature:
  placeholder: "%mvndiseasons_temperature%"
  update: 20
  variable: "temperature"
  async: false

Also, please, do NOT spam your problem in github issue. go to question channel instead. i will no longer answer you in here.

ewof commented 3 months ago

exception still happens with player_biome and async: false i will go to questions channel for mvndiseasons_temperature showing none