LuizB Postado Fevereiro 21, 2016 Denunciar Compartilhar Postado Fevereiro 21, 2016 Tipo porque o Codigo abaixo n funfa ?tipo vc continua clicando e as bolas saindoe o tempo nunca Acaba, fica só mandando as mensagem de aguarde, Quando clica @EventHandler public void interact(PlayerInteractEvent e){ Action eventAction = e.getAction(); final Player player = e.getPlayer(); if (pyro.contains(player.getName())) { if (eventAction == Action.RIGHT_CLICK_AIR || eventAction == Action.RIGHT_CLICK_BLOCK){ if (player.getItemInHand().getType().equals(Material.STONE_HOE)){ player.launchProjectile(Fireball.class).setVelocity(player.getLocation().getDirection().multiply(0.5)); if (!dly.contains(player)) { dly.add(player); Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin) this, new Runnable() { public void run() { dly.remove(player); } }, Principal.cf.getConfig().getInt("Delay") * 20L); }else{ player.sendMessage(Principal.cf.getConfig().getString("MensagemDelay")); } } } } } } OBS: o Delay que ta na config é 3 Link para o comentário Compartilhar em outros sites More sharing options...
LuizB Postado Fevereiro 22, 2016 Autor Denunciar Compartilhar Postado Fevereiro 22, 2016 dd @EventHandler public void interact(PlayerInteractEvent e){ Action eventAction = e.getAction(); final Player player = e.getPlayer(); if (pyro.contains(player.getName())) { if (eventAction == Action.RIGHT_CLICK_AIR || eventAction == Action.RIGHT_CLICK_BLOCK){ if (player.getItemInHand().getType().equals(Material.STONE_HOE)) if ((!dly.contains(player))) { dly.add(player); player.launchProjectile(Fireball.class).setVelocity(player.getLocation().getDirection().multiply(0.5)); Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin) this, new Runnable() { public void run() { dly.remove(player); } }, Principal.cf.getConfig().getInt("Delay") * 20L); } } else { player.sendMessage(Principal.cf.getConfig().getString("MensagemDelay")); } } } } vlw tiu ai teste mesma coisa Link para o comentário Compartilhar em outros sites More sharing options...
CFelipe Postado Fevereiro 22, 2016 Denunciar Compartilhar Postado Fevereiro 22, 2016 mesma coisa tem skype? Link para o comentário Compartilhar em outros sites More sharing options...
MrPowerGamerBR Postado Fevereiro 22, 2016 Denunciar Compartilhar Postado Fevereiro 22, 2016 @EventHandler public void interact(PlayerInteractEvent e){ Action eventAction = e.getAction(); final Player player = e.getPlayer(); if (pyro.contains(player.getName())) { if (eventAction == Action.RIGHT_CLICK_AIR || eventAction == Action.RIGHT_CLICK_BLOCK){ if (player.getItemInHand().getType().equals(Material.STONE_HOE)){ if (!dly.contains(player)) { dly.add(player); player.launchProjectile(Fireball.class).setVelocity(player.getLocation().getDirection().multiply(0.5)); Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin) this, new Runnable() { public void run() { dly.remove(player); } }, Principal.cf.getConfig().getInt("Delay") * 20L); }else{ player.sendMessage(Principal.cf.getConfig().getString("MensagemDelay")); } } } } } } Resolvido, vlw flw. Link para o comentário Compartilhar em outros sites More sharing options...
LuizB Postado Fevereiro 22, 2016 Autor Denunciar Compartilhar Postado Fevereiro 22, 2016 @EventHandler public void interact(PlayerInteractEvent e){ Action eventAction = e.getAction(); final Player player = e.getPlayer(); if (pyro.contains(player.getName())) { if (eventAction == Action.RIGHT_CLICK_AIR || eventAction == Action.RIGHT_CLICK_BLOCK){ if (player.getItemInHand().getType().equals(Material.STONE_HOE)){ if (!dly.contains(player)) { dly.add(player); player.launchProjectile(Fireball.class).setVelocity(player.getLocation().getDirection().multiply(0.5)); Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin) this, new Runnable() { public void run() { dly.remove(player); } }, Principal.cf.getConfig().getInt("Delay") * 20L); }else{ player.sendMessage(Principal.cf.getConfig().getString("MensagemDelay")); } } } } } } Resolvido, vlw flw. tipo n sei pq ele n ta removendo o player da arrayList Link para o comentário Compartilhar em outros sites More sharing options...
LuizB Postado Fevereiro 22, 2016 Autor Denunciar Compartilhar Postado Fevereiro 22, 2016 (editado) Tá sim, ele remove após 20 * número que você colocou na config. Eu coloquei 3 o cara disse que 20L = 1 segundo, passei + de 1 minuto tentando clicar e n vai Config: #### Delay para Usar A Bola De Fogo (Obs Use Em Segundos) #### Delay: 3 Editado Fevereiro 22, 2016 por Cuthmf Link para o comentário Compartilhar em outros sites More sharing options...
žφµร†ล√™ Postado Fevereiro 24, 2016 Denunciar Compartilhar Postado Fevereiro 24, 2016 Sua dúvida foi marcada como [Resolvido] e movido à área de dúvidas resolvidas.Atenciosamente,Gamer's Board Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
LuizB
Tipo porque o Codigo abaixo n funfa ?
tipo vc continua clicando e as bolas saindo
e o tempo nunca Acaba, fica só mandando as mensagem de aguarde, Quando clica
OBS: o Delay que ta na config é 3
Link para o comentário
Compartilhar em outros sites
36 respostass a esta questão
Posts Recomendados