Enderpearl Glitch Prevention.

Discussion in 'Plugin Requests' started by MoejoeAw44, Jan 24, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    MoejoeAw44

    Plugin name: Cobra

    I'm not going to follow the layout for this one because it's fairly small and requires no command / permissions.

    1) Cancel enderpearls that hit fence gates or 1x1 area in front / side / top / of fence gates.
    2) Refund the pearl it cancelled.
    3) Won't let you throw the pearl if a block is highlighted (ie: if you throw a pearl at a block close enough to break, don't let them throw it.

    messages:
    pearl-refunded: "&6Your pearl has been refunded due to prevent potential glitching".

    Reason of need: I need this because I run an HCF server and players can pearl glitch through fence gates and get into places they're not meant to be in.
     
  2. Offline

    87pen

    @MoejoeAw44 You want this for every half block that enderpearls can glitch through or just fence gates.
     
  3. Offline

    MoejoeAw44

    Maybe a config to add blocks by bukkit material ID.
     
  4. Offline

    87pen

    @MoejoeAw44 I can make it, maybe tonight, max it will take me until Wednesday.
     
    MoejoeAw44 likes this.
  5. Offline

    MoejoeAw44

    Any update?
     
  6. Offline

    87pen

    @MoejoeAw44 Making it tonight just finishing up a quick project.
     
    MoejoeAw44 likes this.
  7. Offline

    MoejoeAw44

    Any update on this?
     
  8. Offline

    87pen

    @MoejoeAw44 I am indeed still working on it. Proved trickier than I originally thought.
     
    MoejoeAw44 likes this.
  9. Offline

    MoejoeAw44

    Good to hear you're still working on it, keep me updated!
     
  10. Offline

    MoejoeAw44

    Any updates?
     
  11. Offline

    87pen

    @MoejoeAw44 I do not believe I can complete this and am going to withdraw from this request. Sorry I could not finish it.
     
    MoejoeAw44 likes this.
  12. Offline

    MoejoeAw44

    Well considering @87pen cannot finish this unfortunately, I welcome anyone else to give it a shot! :)
     
  13. Offline

    cluter123

    Could you send me what you have so far?
     
  14. Offline

    87pen

    @cluter123 I just have an event that gets when a projectile hits the ground, and checks if it's location is in a 1 block radius of a fencegate/material in a collection. I could not stop the enderpearl from teleporting the player so I didn't have much after.
     
  15. Offline

    I Al Istannen

    @MoejoeAw44 Hey, I have it working, but I need to know some things.

    Do you need the refunded EnderPearl to have the exact same data (e.g. DisplayName, Lore,...) or may it be a normal one?
    Bukkit autmatically cancels EnderPearl throwing if you could interact with the block. Should I cancel the click as a whole or just leave your third point out?
    Could you rephrase the blocks it should check for to be forbidden? Currently it checks in a cube around the location it hit.

    It relies on the Execution order of the events. I have no idea if they stay the same across different Bukkit versions, so I will try to make that unimportant. I tried to and I think it should work, but I can't test it. So hope for the best :)

    Link to current version: DropBox. The source code (1 java file) is inside, feel free to compile it yourself.

    @87pen I think your aprroach didn't work, because the TeleportEvent is iussed before the EnderPearl hits. At least that is what is happening on my test server. So I needed to save every player throwing an EnderPearl with the throwing location. This happens currently on the TeleportEvent, so the player will be teleported to the Location he was at right in the second the pearl hit. Problems arise if the execution order is dependent on the Bukkit version, but sadly I can't test this.
     
    Last edited: Jan 31, 2016
  16. Offline

    87pen

    @I Al Istannen
    This would have been a problem if I checked if the player was being teleported. I was checking when a projectile hits anywhere.
     
Thread Status:
Not open for further replies.

Share This Page