GithubHelp home page GithubHelp logo

Comments (6)

bensku avatar bensku commented on May 25, 2024

Actually, you should be able to get region data by using %event-region%, but that is bugging... I could fix it quickly, but I fear that might break other stuff.

from skript.

bensku avatar bensku commented on May 25, 2024

Very hard to solve, after few hours of debugging yesterday I could not figure out why it doesn't work and gave up... Will try again once I have loots of time.

from skript.

Pilvinen avatar Pilvinen commented on May 25, 2024

on region enter and on region leave seem to be completely broken now. The only exception to this is teleporting in and out of the regions which works perfectly. %region% and %event-region% also works perfectly when teleporting in and out of regions.

When you walk, the events don't fire at all.

from skript.

TheBentoBox avatar TheBentoBox commented on May 25, 2024

I've been having the same issue as Pilv. I actually reported it once here but it randomly fixed itself while the server was still running. It started again a few days ago.

from skript.

TheBentoBox avatar TheBentoBox commented on May 25, 2024

I may have found the issue? Keep in mind as I said before, I don't write plugins or know Java specifically, I'm just able to read it alright.

Towards the bottom of EvtRegionBorder.java, there's the code block which appears to actually be calling the region entry and leave events - casts the event to a PlayerMoveEvent, gets the previous and current location, and appropriately calls leave/entiry events respecitvely for regions at those location. In this commit, you changed if (to.equals(from)) to if (to.equals(from) || to.distanceSquared(from) < 2), which was eventually separated out and changed to if (to.getWorld().equals(from.getWorld()) && to.distanceSquared(from) < 2) as a result of this issue report, which is what it is currently.

I think the problem is that adding the to.distanceSquared(from) < 2 makes the event really inconsistent when moving at low speeds, because it just straight up won't fire unless you've moved far enough in that move event. The distance moved shouldn't matter.

I'd recommend removing this chunk of code entirely, reverting it to the old behavior:

if (to.getWorld().equals(from.getWorld()) && to.distanceSquared(from) < 2)
    return;

I tested at different speeds, and sprint flying quicker (I did /speed 3) through the region made the events fire much more consistently.

from skript.

bensku avatar bensku commented on May 25, 2024

I have no idea how, but this is fixed. Maybe some bug fix on Spigot?

from skript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.