Solved Particle Effcts

Discussion in 'Spigot Plugin Development' started by ula492, May 23, 2016.

  1. lel just a single example :p

    I'm not saying its the thing you have to do.
     
  2. But the code I used here:
    Code (Text):
    if (event.getItem().getItemMeta().getDisplayName().contains("§aParticle Menu")) {
                if(!p.hasPermission("Rank.Particle.use")){
                    event.setCancelled(true);
                    p.getPlayer().playSound(p.getPlayer().getLocation(), Sound.ANVIL_LAND, 4F, 4F);
                    p.sendMessage("§4You Do not have the require rank to open this, Visit §awww.thevoidmc.net to purchase a rank!");
                }else{
                    event.setCancelled(true);
                    p.playSound(p.getLocation(), Sound.CLICK, 4F, 4F);
                    ParticleMenu.ParticleGUI(p);
                    Water.WaterHelix.remove(p.getUniqueId());
                }

            }
    does not cancel...

    Edit:
    I have to stop the Runnable dont i... and remove the player from the list.
     
  3. try not to cancel the event at the else statement if the player has no permission. I think its a PlayerInteractEvent.
     
  4. Yea, cus if i cancel the Runnable it cancels for all doesnt it?
     
  5. yeah why do you have to cancel the interact event if the player has a permission ? doesn't it only belongs to the player who doesn't have?

    try not to cancel like what I've said and check if its working.
     
  6. im trying to cancel if they open the menu, incase they have a particle so another particle is not stacked on to each other.

    If you are down to TS3, to help me out :) that would be amazing.
     
  7. oh check if the player has a particle then if he has // don't open the menu.
     
  8. I want the particle to be removed as soon as he opens the menu.
     
  9. Code (Java):
    PlayerInventoryEvent

    Player p = (Player) e.getPlayer();

    // remove the p's particle once he opens the inventory using this event
     
  10. Im having him being removed from the UUID list, so when he is removed, he wont have the particle and wont be in the list anymore.
     
  11. well do that thing

    on player open inventory event

    list.remove(uuid);
     
  12. tried that, it does not stop the particle effect
     
  13. at your particle effect do you have this ?

    Code (Java):
    if(list.contains(uuid)) {

      // run particle
     } else {
      // do something
    }
     
  14. Stop the runnable with this.cancel() if hes not in the list?
     
  15. About the 'this.plugin', if it works, and doesn't create lag, it's the right way. No matter what people say. Unless it causes confusion.
     
    • Agree Agree x 1
  16. I posted all my code in an earlier post.
     
  17. That would cancel everyone would it not?
     
  18. If all players' particles are created from the same BukkitRunnable, yes then it will.
     
  19. Im confused to hell. Im on 2 Hours of sleep in the past 2 days, but everyone is going to be going off that Runnable. So would it make a dif?
     
  20. Your current problem is that you want to remove the player right?