PikaMug / Quests

Easy-to-use, open-source plugin for the creation and execution of quests on Minecraft servers.
https://modrinth.com/plugin/quests.classic
MIT License
152 stars 108 forks source link

IllegalArgumentException: Cannot measure distance between two worlds #1813

Closed sergix44 closed 3 years ago

sergix44 commented 3 years ago

The problem arises when I start a quest with a member in another world. The plugin fails to calculate the distance and spams errors in the console, continuing to spam the console event when terminating the quest. This seems to happen when the people in the same party are in different worlds. The error is fired for each quest with the share distance >0

What is your Quests version / build number (do not say "latest")? 4.0.8-b267

Describe the problem and how to replicate it. Any console errors to post using a pastebin?

``` ... [22:04:00] [Craft Scheduler Thread - 4191 - Quests/ERROR]: [Quests] Error occurred while dispatching REACH_LOCATION for quest ID custom20 [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: java.lang.IllegalArgumentException: Cannot measure distance between world and world_quest [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.Location.distanceSquared(Location.java:510) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.Quester.getMultiplayerQuesters(Quester.java:4085) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.Quester.dispatchMultiplayerEverything(Quester.java:3957) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.listeners.PlayerListener.lambda$playerMove$14(PlayerListener.java:999) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.lang.Thread.run(Thread.java:831) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/ERROR]: [Quests] Error occurred while dispatching REACH_LOCATION for quest ID custom21 [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: java.lang.IllegalArgumentException: Cannot measure distance between world and world_quest [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.Location.distanceSquared(Location.java:510) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.Quester.getMultiplayerQuesters(Quester.java:4085) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.Quester.dispatchMultiplayerEverything(Quester.java:3957) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.listeners.PlayerListener.lambda$playerMove$14(PlayerListener.java:999) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.lang.Thread.run(Thread.java:831) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/ERROR]: [Quests] Error occurred while dispatching REACH_LOCATION for quest ID custom73 [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: java.lang.IllegalArgumentException: Cannot measure distance between world and world_quest [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.Location.distanceSquared(Location.java:510) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.Quester.getMultiplayerQuesters(Quester.java:4085) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.Quester.dispatchMultiplayerEverything(Quester.java:3957) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at Quests-4.0.8.jar//me.blackvein.quests.listeners.PlayerListener.lambda$playerMove$14(PlayerListener.java:999) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [22:04:00] [Craft Scheduler Thread - 4191 - Quests/WARN]: at java.base/java.lang.Thread.run(Thread.java:831) ... ```

If applicable, can you provide an example quest from quests.yml using a pastebin?

``` custom73: name: Derattizzazione ask-message: AAA Cercasi disinfestatore per ripulire il Magazzino della Stazione di Posta [NW] finish-message: Grazie del servizio svolto! Controlla la Bacheca della Posta per altri lavoretti! block-start: world 1162.0 70.0 2790.0 stages: ordered: '1': locations-to-reach: - world -5480.0 71.0 3171.0 reach-location-radii: - 5 reach-location-names: - Stazione di Posta [SW] start-message: Raggiungi la Stazione di Posta Sud Ovest '2': npc-ids-to-kill: - 132 - 133 - 134 - 135 npc-kill-amounts: - 1 - 1 - 1 - 1 start-message: Scendi nel Magazzino e liberalo dai ratti! rewards: items: - ==: org.bukkit.inventory.ItemStack v: 2730 type: PLAYER_HEAD meta: ==: ItemMeta meta-type: SKULL display-name: '{"extra":[{"text":"Rat"}],"text":""}' internal: H4sIAAAAAAAA/02PPU7DMBzF/yCQiuEcTAwuTYI6dCgfbR3VCUnTpPbWpi75sEOVJpB44wZI3ICBEyDuxQ3IyPCk99P7LQ8BILhY5LWUj+XzLpUCAeraXpRVKg5n0KtEU9WlOCAAOOrBabiWtYBv0dqYrxK8XdkybonVcbDA0iXZ/oYUYbu5IxZR3T4bW/N2+M81q3VkSjawE1549UaFeD7wpZj5/VgtX1iQJEwR7OhJzrLbhGWx4eixpvcPjRvEJp9Sg2Xeq6NzgwU5phHTLPBzHlHd5ZpGTsqjMKNqotypo7haGqToD3feaARwDsdk2x05ufx8usoa+vYe/nx8If0L8Ae2qk1rCgEAAA== money: 20 quest-points: 1 planner: cooldown: 604800 override: false options: allow-commands: true allow-quitting: true ignore-silk-touch: true use-dungeonsxl-plugin: false use-parties-plugin: true share-progress-level: 1 same-quest-only: true share-distance: 20.0 handle-offline-players: false ```
PikaMug commented 3 years ago

Thanks for the report. Please give the following development build a try: https://ci.codemc.io/job/PikaMug/job/Quests/270/