Solved Disabling 'moving too fast'

Discussion in 'Bukkit Help' started by Muizers, Sep 28, 2012.

Thread Status:
Not open for further replies.
  1. --------------------------------------------------------------------------------
    EDIT: Solution here!

    ------------------------------------------------------------------------------------------------
    Hey all!

    First said, I need a REAL answer to this. I've read over twenty of comparable threads on these and other forums and no-one has given a solution. I've seen many useless answers like 'enable allow-flight' or 'use NoCheat' or 'this happens when people move too fast'.

    Sigh, so here's my actual problem.

    How do I disable that Bukkit puts a player back in place if the player 'moves too fast'? I don't care about the console message, I don't care about the 'moving too fast' kick, I just want the player to be able to move.

    Furthermore, I would like to say that I have allow-flight=true, and what I'm doing is giving the player a velocity using Player.setVelocity(...) of the Bukkit API, within a plugin.

    That is also the only plugin in the server.

    Please, please answer my question! I've searched for it, but couldn't find, perhaps you can? Or know?

    Thanks so much in advance!
     
  2. Offline

    breezeyboy

    First of all.
    First said, I need a REAL answer to this. I've read over twenty of comparable threads on these and other forums and no-one has given a solution. I've seen many useless answers like 'enable allow-flight' or 'use NoCheat' or 'this happens when people move too fast'.

    are not usles^^

    2. its a lag issue, it only happens when the player is hacking or lagging
     
  3. Don't make such stupid comments on my topic please. Read my question thoroughly before answering. I am a plugin developer, not a server owner.

    Bump. Sorry but I believe this is an important and needed feature and I need a fix.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  4. Offline

    xMrPoi

  5. Offline

    xMrPoi

    Yeah, I didn't see it either. I also had this problem and the first thing I looked for in the chagelog was this xD
     
  6. Nope this has NOT been fixed.
     
  7. Offline

    xMrPoi

    Hm, it no longer happens to me...
     
  8. I tested it thoroughly. It keeps happening when I increase the speed to about 7 in void time. So setting a velocity to a vector with an absolute value of about 7 will generate the message and setback.

    Need Dinnerbone's phone number. XD
     
  9. Offline

    Alkhemyst

    Edited to be "User-friendly" because tough love isn't allowed on bukkit.
    Allow-"Flight"
    Moving to "Fast"
    Theres a big difference and nothing is going to change the fact that allow flight won't do anyting until there is an allow-speedhacks option.
     
  10. I was incredibly stunned by the answer too. Haha. And my first post was written exactly so to prevent it XD

    Ah well, yes the problem also occurs in vanilla. And I still don't want the player to have fly hacks.

    What I exactly want, is to allow high speeds. What I will do is set the velocity from the server, but that isn't allowed atm, while it should be. I still don't want players to use flying hacks, but for that I can use NoCheat later, cause NoCheat won't block it if another plugin changes the speed of a player, cause that is not considered hacking of course haha.

    And worst thing is, people have been asking for a fix to this since Bukkit #1000. I don't see a bright future :(

    With the help of @ferrybig, who suggested the use of the getHandle() method of CraftPlayer, I figured out the following code does exactly what you want, per player, on any desired moment:

    Code:
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
    ((CraftPlayer) event.getPlayer()).getHandle().netServerHandler.checkMovement = false;
    }
    You can also use true instead of false to enable checking again later. You can of course call the code at any time, not just within a PlayerJoinEvent method. Also this is completely per player.

    Tested it thoroughly, seems to work per-player perfectly! Now I can even enable the checks on a player again when I've finished changing their velocities server-side.

    PS You should reference both the latest library of Bukkit and CraftBukkit for this to function properly!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  11. Offline

    Alkhemyst

    So with this you get your desired effect by disabling the Movement checker but still checking the players y co-ord and the nearest /top block to ensure they do not fly? Nicely done. I'll get back on my VoidBeGone plugin since nobody else wants to do it or believe it is possible.
     
  12. Yes that is the case.
     
  13. Offline

    jmack2424

    Great solution, but it doesn't prevent it completely. In the NetServerHandler, there is still the lines:

    Code:
    if (!this.checkMovement) {
        d0 = packet10flying.y - this.z;
        if (packet10flying.x == this.y && d0 * d0 < 0.01D && packet10flying.z == this.q) {
            this.checkMovement = true;
        }
    }
    That checks for 'flight' even when the player isn't flying. And it will occasionally pull the player to the ground and re-enable checkMovement. I see no other workaraound besides a custom CraftBukkit build. They need to re-examine their speed measurements used to determine if a player is moving too 'fast', or allow a setting to bypass if we so choose.
     
  14. Thanks for noting this, I'm not sure if it's possible to use Reflection on craftbukkit but I'm going to try to change this. But it's probably, as I'm used to while reading the craftbukkit code, part of one insanely long method. Ah well, I'll go see now.

    Thanks again!
     
Thread Status:
Not open for further replies.

Share This Page