Geolykt / EnchantmentsPlus

Enchantments+, a Bukkit Custom Enchantments Plugin based on Zenchantments targetted at production grade servers
GNU General Public License v3.0
38 stars 15 forks source link

Error Spam in console #123

Closed LaurenceBarnes closed 2 years ago

LaurenceBarnes commented 2 years ago

The following exception is spamming the servers console. This did not occur until the creator of #122 who also is an administrator, has started to play with the plugin. I do not know the exact trigger, but it seems to occur after a player who uses enchanted items joined (the spam is quite extreme).

MyWorlds by bergerkiller is the world management plugin. One of the worlds involved is an "extra world".

Thanks in advance!

! [Wed 17:17:32 WARN  Enchantments_plus] Task #188 for Enchantments_plus v4.0.4 generated an exception
java.lang.IllegalArgumentException: Cannot measure distance between worldname_flat and world
    at org.bukkit.Location.distanceSquared(Location.java:510)
    at org.bukkit.Location.distance(Location.java:493)
    at enchantments-plus-4.0.4.jar//de.geolykt.enchantments_plus.enchantments.Tracer.tracer(Tracer.java:122)
    at enchantments-plus-4.0.4.jar//de.geolykt.enchantments_plus.Enchantments_plus.lambda$onEnable$3(Enchantments_plus.java:147)
    at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101)
    at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
    at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1558)
    at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:522)
    at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1482)
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1246)
    at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:320)
    at java.base/java.lang.Thread.run(Thread.java:833)
Geolykt commented 2 years ago

I'm a bit surprised that the spam is extreme - it should be incredibly rare as it only happens if the target of the tracer arrow has changed dimensions.

Will fix it regardless

LaurenceBarnes commented 2 years ago

well, I was able to read through the entire log. It started with the player (that has enchanted items) changing worlds.

LaurenceBarnes commented 2 years ago

It spammed about 6 times per second, so that's quite intense :p

thanks for the quick reply by the way!

LaurenceBarnes commented 2 years ago

also as I observed, after a restart, that does not occur in that other world. It might only occur after a switch between worlds.

EDIT: Did not occur the other way round (flat world, which is an "extra world" to "world")

LaurenceBarnes commented 2 years ago

hey, would you mind pushing this fix? :D The error occasionally spams again

Geolykt commented 2 years ago

I'd need to test a bit for regressions but otherwise I could release the build in theory