In my plugin there is a "rune" which allows you to fly, this has a certain radius, the issue I'm experiencing is when players quickly switch between two flight runes
eg: someone flies from runeA to runeB, their flight still gets revoked for a second before runeB reapplies it, I am trying to prevent it except I'm having some issues with execution
#(pgini) Finding better ways to perform a radius check
12 messages · Page 1 of 1 (latest)
(pgini) Finding better ways to perform a radius check
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
!pastejava
Help us help you by pasting your Java code to https://paste.denizenscript.com/New/Other?selected=other-java and linking it back here.
This is the current code: https://paste.denizenscript.com/View/123731
Content of Java Paste #123731: Flight Rune... pasted 2024/06/14 07:53:35 UTC-07:00, Paste length: 2979 characters across 89 lines, Content: package net.divinitystudios.runecraft.tasks;
Lines 60-69 is where I started trying to fix it by adding a delay, except I also need to check whether the player is in a new rune's radius
The radius check I have wouldn't work since it only checks the radius to the player's current rune instance, and not the one they move into
I thought about looping the save file for the rune's location and check if the player enters another rune but that feels not really lag friendly
That is also the way the previous version of the plugin did it (this is a rewrite) and there were complaints about a lot of runes causing lag
Soo yeah, I'm trying to find some other method that hopefully doesn't consist of iterating over ridiculous amounts of potential lines in a save file