Slimefun / Slimefun4

Slimefun 4 - A unique Spigot/Paper plugin that looks and feels like a modpack. We've been giving you backpacks, jetpacks, reactors and much more since 2013.
GNU General Public License v3.0
966 stars 545 forks source link

NullPointerException when triggering hologram projector updates via chat message #3445

Closed L4BORG closed 2 years ago

L4BORG commented 2 years ago

❗ Checklist

📍 Description

com.destroystokyo.paper.exception.ServerSchedulerException: Task #34239066 for Slimefun vDEV - 999 (git e02eedd9) generated an exception
    at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:498)
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1567)
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:490)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1483)
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1282)
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot invoke "String.trim()" because "in" is null
    at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1838)
    at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    at java.base/java.lang.Double.parseDouble(Double.java:651)
    at Slimefun4.jar//io.github.thebusybiscuit.slimefun4.implementation.items.blocks.HologramProjector.getArmorStand(HologramProjector.java:135)
    at Slimefun4.jar//io.github.thebusybiscuit.slimefun4.implementation.items.blocks.HologramProjector.lambda$openEditor$1(HologramProjector.java:109)
    at Slimefun4.jar//io.github.thebusybiscuit.slimefun4.libraries.dough.chat.ChatInput$1.onChat(ChatInput.java:58)
    at Slimefun4.jar//io.github.thebusybiscuit.slimefun4.libraries.dough.chat.ChatInputListener.lambda$checkInput$1(ChatInputListener.java:79)
    at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101)
    at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
    at app//net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1567)
    at app//net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:490)
    at app//net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1483)
    at app//net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1282)
    ... 2 more

📑 Reproduction Steps

I saw a lot of those, but I'm not sure why I don't think NULL could end up in HologramProjector?

💡 Expected Behavior

Not sure, maybe the solution would be to skip HologramProjector on null?

📷 Screenshots / Videos

No response

📜 Server Log

No response

📂 /error-reports/ folder

No response

💻 Server Software

Paper

🎮 Minecraft Version

1.17.x

⭐ Slimefun version

> sf versions
[03:04:41 INFO]: This Server uses the following setup of Slimefun:
Paper git-Paper-408 (MC: 1.17.1)
Slimefun DEV - 999 (git e02eedd9)
Metrics-Module #28
Java 17

Installed Addons: (3)
  EcoPower vDEV - 5 (git 5c1ecd68)
  SlimefunLuckyBlocks vDEV - 36 (git 60f0c8dc)
  ExoticGarden vDEV - 77 (git a2c4b6d3)

🧭 Other plugins

No response

WalshyDev commented 2 years ago

Caused by: https://github.com/Slimefun/Slimefun4/blob/a34c4696fd65dce7a2cfeddbf0e2656ee082e19d/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java#L135

So the offset is not stored anymore, this shouldn't ever happen unless someone resets data. Did you happen to modify or remove some SF data for the blocks around here (or just for the whole world)?

Without reproduction steps finding this would be insanely hard but a simple "fix" (which isn't actually a fix, just avoiding the problem)

L4BORG commented 2 years ago

By changing SF data you mean like edit SF files? In data-storage folder? I'm pretty sure nobody touched those.

Would it be possible this is caused by missing armor stand? For example if we have a plugin that would limit number of armor stands per chunk and if there are too many it would start despawning them.

L4BORG commented 2 years ago

I've tested this, I can't replicate exception by removing armor stands... so I'm guessing it's something else.

EpicPlayerA10 commented 2 years ago

To reproduce it you need to click edit text and break hologram projector. When you type in chat something it throws an exception.