joserodpt / RealScoreboard

Source-code for the RealScoreboard spigot plugin.
MIT License
20 stars 16 forks source link

[BUG] null ConcurrentModificationException being thrown #75

Closed OreoKirby closed 2 months ago

OreoKirby commented 2 months ago

Minecraft's Version

Paper version 1.21-49

Plugin's Version

RealScoreboard 1.4.3

Describe the bug

Console is throwing an exception sometimes when a player logs in.

To Reproduce

  1. Start up server from shutdown state.
  2. Login as a player.
  3. ???

Additional Information

[21:31:58 WARN]: [RealScoreboard] Plugin RealScoreboard v1.4.3 generated an exception while executing task 24998
java.util.ConcurrentModificationException: null
        at java.base/java.util.HashMap.computeIfAbsent(Unknown Source) ~[?:?]
        at at.helpch.placeholderapi.expansion.server.util.TimeFormatter.parseFormat(TimeFormatter.java:45) ~[?:?]
        at at.helpch.placeholderapi.expansion.server.util.TimeFormatter.formatTime(TimeFormatter.java:66) ~[?:?]
        at at.helpch.placeholderapi.expansion.server.ServerExpansion.onRequest(ServerExpansion.java:229) ~[?:?]
        at PlaceholderAPI-2.11.6.jar/me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:119) ~[PlaceholderAPI-2.11.6.jar:?]
        at PlaceholderAPI-2.11.6.jar/me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:71) ~[PlaceholderAPI-2.11.6.jar:?]
        at PlaceholderAPI-2.11.6.jar/me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:99) ~[PlaceholderAPI-2.11.6.jar:?]
        at RealScoreboard.jar/joserodpt.realscoreboard.utils.Placeholders.placeholderAPI(Placeholders.java:189) ~[RealScoreboard.jar:?]
        at RealScoreboard.jar/joserodpt.realscoreboard.utils.Placeholders.setPlaceHolders(Placeholders.java:184) ~[RealScoreboard.jar:?]
        at RealScoreboard.jar/joserodpt.realscoreboard.api.scoreboard.RSBPlayer$1.lambda$run$0(RSBPlayer.java:67) ~[RealScoreboard.jar:?]
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:?]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:?]
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:?]
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source) ~[?:?]
        at RealScoreboard.jar/joserodpt.realscoreboard.api.scoreboard.RSBPlayer$1.run(RSBPlayer.java:69) ~[RealScoreboard.jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.21.jar:1.21-49-b0ef3ca]
        at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.21.jar:1.21-49-b0ef3ca]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.21.jar:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
        at java.base/java.lang.Thread.run(Unknown Source) ~[?:?]

Note: Plugin is still active and appears to be working fine - just wanted to put this out there in-case it is a cause for concern.

joserodpt commented 2 months ago

Are you using any PAPI Extension to format the time? Server/Server Util extension?

The error comes from there: at at.helpch.placeholderapi.expansion.server.util.TimeFormatter.parseFormat(TimeFormatter.java:45) ~[?:?] at at.helpch.placeholderapi.expansion.server.util.TimeFormatter.formatTime(TimeFormatter.java:66) ~[?:?] at at.helpch.placeholderapi.expansion.server.ServerExpansion.onRequest(ServerExpansion.java:229) ~[?:?] at PlaceholderAPI-2.11.6.jar/me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:119) ~[PlaceholderAPI-2.11.6.jar:?] at PlaceholderAPI-2.11.6.jar/me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:71) ~[PlaceholderAPI-2.11.6.jar:?] at PlaceholderAPI-2.11.6.jar/me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:99) ~[PlaceholderAPI-2.11.6.jar:?]

What's your scoreboard config?

OreoKirby commented 2 months ago

PlaceholderAPI Version: 2.11.6

My PAPI Installed Expansions are:

  1. Essentials
  2. LuckPerms
  3. Multiverse
  4. Player
  5. PlayerList
  6. Server
  7. Vault
  8. WorldGuard

config.yml:

Debug: false
Config:
  Prefix: '&e&lInfo &6» &7'
  mcMMO-Support: false
  Check-for-Updates: true
  Use-Placeholders-In-Scoreboard-Titles: true
  RealScoreboard-Disabled-By-Default: false
  Auto-Hide-In-Vanish: true
  World-Scoreboard-Switch: true
  Animations:
    Loop-Delay: 20
  Reloaded: '&aThe config has been &areloaded.'
  Hours:
    Formatting: HH:mm:ss
    Offset: 0
  Days:
    Formatting: dd/MM/yyyy
    Offset: 0
  Messages:
    Scoreboard-Toggle:
      ON: Scoreboard has been toggled &aON&7.
      OFF: Scoreboard has been toggled &cOFF&7.
  Disabled-Worlds:
  - world_void
  Bypass-Worlds:
  - skywarsLobby
  Vanish-Commands:
  - pv
  - vanish
  - premiumvanish
Version: '17'

scoreboards.yml:

#✦------------------------------------------------------✦
#|                   Scoreboard Config                   |
#✦------------------------------------------------------✦
# RealScoreboard created by joserodpt and maintained by Neziw
# Parameter explanation:
# - Default: if the scoreboard is the default one, doesn't require a permission
# - Default-World: the default world where the scoreboard appears
# - Display-Name: used for GUI and other purposes.
# - Refresh-Scoreboard: the main refresh delay for the whole scoreboard
# - Refresh-Title: refresh delay only for the scoreboard title
# - Title-Loop-Delay: loop delay for the title animation task
# - Board-Loop-Delay: loop delay for the bards switching task (if the scoreboard has multiple boards)
Version: 3
Scoreboards:
  default:
    Default: true
    Default-World: world
    Other-Worlds: []
    Display-Name: '&7default'
    Permission: none
    Refresh:
      Scoreboard: 0
      Title: 0
      Title-Loop-Delay: 20
    Title:
    - '{#FFBB11}&lSERVER'
    Lines:
    - '%blank%'
    - '{#77FF77}&l| {#EEEEEE}Rank: %luckperms_prefix_element_highest_on_track_ranks%'
    - '{#77FF77}&l| {#EEEEEE}Balance: {#77FF77}$%vault_eco_balance_commas%'
    - '{#77FF77}&l| {#EEEEEE}Playtime: {#009900}%PlayTimes_playtime%'
    - '%blank%'
    - '{#FFFF77}&l| {#EEEEEE}World: {#FFFF77}%multiverse_world_alias%'
    - '{#FFFF77}&l| {#EEEEEE}%x% %y% %z%'
    - '%blank%'
    - '{#FF77FF}&l| {#EEEEEE}Vote Party: {#FF77FF}0'
    - '%blank%'
    - '{#AAAAAA}%server_time_MMMM dd, YYYY%'
joserodpt commented 2 months ago

Error comes from this placeholder: - '{#AAAAAA}%server_time_MMMM dd, YYYY%' from the Server PAPI extension. It seems that it's a bug with the Server Expansion itself. Contact PAPI support, RSB crashes but the crash isn't in this plugin's control.

OreoKirby commented 2 months ago

Added the "localtime" PAPI expansion.

Changed placeholder to %localtime_time_MMMM dd, YYYY%