[HELP] Logout Location Bug

Discussion in 'Plugin Development' started by AaronL98, Mar 15, 2014.

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

    AaronL98

    Hi. I'm creating a double jump plugin, which leaves a trail of particles. I'm using a particle library I found here on Bukkit. It is working fine, but when you log out in the air, the particles are also displayed in the logout location upon every jump.

    I'm adding the player's name to an array list every time he double jumps, and removing it when he touches the ground. I'm using a scheduleSyncRepeatingTask upon doublejump and checking if the array list contains the players name, if it does, i will display a particle ever 1L.

    Code:java
    1. @EventHandler
    2. public void onPlayerToggleFlight(PlayerToggleFlightEvent e) {
    3. final Player p = e.getPlayer();
    4. if (p.getGameMode() == GameMode.CREATIVE)
    5. return;
    6. e.setCancelled(true);
    7. p.setAllowFlight(false);
    8. p.setFlying(false);
    9. p.setVelocity(p.getLocation().getDirection().multiply(1.25).setY(1));
    10. jumped.add(p.getName());
    11. Bukkit.getScheduler().scheduleSyncRepeatingTask(hub, new Runnable() {
    12. public void run() {
    13. if(p.getLocation().subtract(0,1,0).getBlock().getType()!=Material.AIR){}
    14. if (jumped.contains(p.getName())) {
    15. if(p.isOnline()){
    16. ParticleEffectNew.HEART.animateAtLocation(p.getLocation().subtract(0,1,0),
    17. 1, 1);
    18. if (p.getLocation().subtract(0, 1, 0).getBlock().getType() != Material.AIR) {
    19. jumped.remove(p.getName());
    20. }
    21. }
    22. }
    23. }
    24. }, 0L, 1L);
    25. p.playSound(p.getLocation(), Sound.ENDERDRAGON_WINGS, 1, 1);
    26.  
    27. }


    I have tried removing the player's name from the list upon joining.
    I have tried using a different particle effect (This probably wouldn't make a difference)


    Screenshot of glitch:
    [​IMG]
    --------

    I also have another problem where if you re log, when you jump it only spawns 1 particle.

    Screenshot of trail:
    [​IMG]
    Screenshot of 1 Particle:
    [​IMG]

    I would love some support on these problems. Thanks
     
  2. Offline

    thomasb454

    Sorry this has nothing to do with helping you, but could you show me this library? I've been searching for ages. Sorry for not helping out.
     
  3. Offline

    AaronL98

    https://gist.github.com/RingOfStorms/6194879

    Have fun :p.
     
  4. Offline

    thomasb454

  5. Offline

    AaronL98

    >3
     
  6. Offline

    AoH_Ruthless

  7. Offline

    AaronL98

  8. Offline

    AoH_Ruthless

    AaronL98
    We all have to be a noob sometimes! It keeps us humble :). In any case, you and I are both going to look like noobs if someone responds to this thread saying what you did wrong!

    And, if you are worried of being embarassed, report what you have found for the greater good. In the off-chance you have stumbled upon a bug, is it not better to report it and hope that it gets fixed?
     
  9. Offline

    AaronL98

    Agreed. XD I'll report it just now.

    I dont suppose anyone has a fix for this?

    Still been trying, cant find a solution...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page