Skip to content

Commit

Permalink
UPDATE 1.6.4 -Spleef Listeners fix
Browse files Browse the repository at this point in the history
Bug de Listerners corrigido novamente
  • Loading branch information
gabrizord authored Sep 14, 2017
1 parent 174b2c2 commit 4df6dbe
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 28 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
ChangeLog HEventosReloaded

HEventos ChangeLog version=1.6.4

14/09/2017
Bug de Listerners corrigido novamente

HEventos ChangeLog version=1.6.3

11/09/2017
Expand Down
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: me.herobrinedobem.heventos.HEventos
name: HEventosReloaded
version: 1.6.3
version: 1.6.4
author: GabrielDev
description: Plugin de eventos automaticos

Expand Down
2 changes: 1 addition & 1 deletion src/me/herobrinedobem/heventos/HEventos.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* @author Herobrinedobem (Gabriel Henrique)
* @author GabrielDev (DeathRush)
* @version 1.6.3
* @version 1.6.4
*/
public class HEventos extends JavaPlugin {

Expand Down
8 changes: 1 addition & 7 deletions src/me/herobrinedobem/heventos/eventos/Spleef.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,9 @@ public void scheduledMethod() {
}
}
if (getParticipantes().size() == 1) {
Player player = null;
for (Player p : getParticipantes()) {
player = p;
}
Player player = getParticipantes().get(0);
PlayerWinEvent event = new PlayerWinEvent(player, this, false);
HEventos.getHEventos().getServer().getPluginManager().callEvent(event);
for (Block b : cubo.getBlocks()) {
b.setType(Material.getMaterial(7));
}
stopEvent();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BatataQuenteListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onPlayerInteractEvent(PlayerInteractEntityEvent e) {
public void onPlayerInteractEventBQUENTE(PlayerInteractEntityEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand All @@ -44,7 +44,7 @@ public void onPlayerInteractEvent(PlayerInteractEntityEvent e) {
}

@EventHandler
public void onInventoryClickEvent(InventoryClickEvent e) {
public void onInventoryClickEventBQUENTE(InventoryClickEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand All @@ -56,7 +56,7 @@ public void onInventoryClickEvent(InventoryClickEvent e) {
}

@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent a) {
public void onPlayerDropItemBQUENTE(PlayerDropItemEvent a) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class BowSpleefListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onPlayerMoveEvent(PlayerMoveEvent e) {
public void onPlayerMoveEventBSPLEEF(PlayerMoveEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class EventoNormalListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent e) {
public void onPlayerInteractEventNORMAL(PlayerInteractEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class FrogListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onPlayerMoveEvent(PlayerMoveEvent e) {
public void onPlayerMoveEventFROG(PlayerMoveEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class KillerListener extends EventoBaseListener {
EventoBaseAPI evento;

@EventHandler
public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent e) {
public void onEntityDamageByEntityEventKILLER(EntityDamageByEntityEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand Down Expand Up @@ -52,7 +52,7 @@ public void onPlayerQuitEventKILLER(PlayerQuitEvent e) {
}

@EventHandler
public void onPotionSplashEvent(PotionSplashEvent e) {
public void onPotionSplashEventKILLER(PotionSplashEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento != null) {
if (e.getPotion().getShooter() instanceof Player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class MinaMortalListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onPotionSplashEvent(PotionSplashEvent e) {
public void onPotionSplashEventMINA(PotionSplashEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento != null) {
if (e.getPotion().getShooter() instanceof Player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class PaintballListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent e) {
public void onEntityDamageByEntityEventPAINTBALL(EntityDamageByEntityEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent e) {
}

@EventHandler
public void onPlayerLoseEvent(PlayerLoseEvent e) {
public void onPlayerLoseEventPAINTBALL(PlayerLoseEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
Paintball paintball = (Paintball) evento;
if (paintball.getTimeVermelho().contains(e.getPlayer())) {
Expand All @@ -85,7 +85,7 @@ public void onPlayerLoseEvent(PlayerLoseEvent e) {
}

@EventHandler
public void onInventoryClickEvent(InventoryClickEvent e) {
public void onInventoryClickEventPAINTBALL(InventoryClickEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand All @@ -96,7 +96,7 @@ public void onInventoryClickEvent(InventoryClickEvent e) {
e.setCancelled(true);
}

public void eliminar(Paintball paintball, Player atirou, Player atingido) {
private void eliminar(Paintball paintball, Player atirou, Player atingido) {
evento = HEventos.getHEventos().getEventosController().getEvento();
atingido.setHealth(20.0);
PlayerLoseEvent event = new PlayerLoseEvent(atingido, evento);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SemaforoListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent e) {
public void onPlayerInteractEventSEMAFORO(PlayerInteractEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand All @@ -47,7 +47,7 @@ public void onPlayerInteractEvent(PlayerInteractEvent e) {
}

@EventHandler
public void onPlayerMoveEvent(PlayerMoveEvent e) {
public void onPlayerMoveEventSEMAFORO(PlayerMoveEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import me.herobrinedobem.heventos.HEventos;
import me.herobrinedobem.heventos.api.EventoBaseAPI;
import me.herobrinedobem.heventos.api.EventoBaseListener;
import me.herobrinedobem.heventos.api.EventoType;
import me.herobrinedobem.heventos.api.events.PlayerLoseEvent;
import me.herobrinedobem.heventos.eventos.Spleef;

Expand All @@ -16,7 +17,7 @@ public class SpleefListener extends EventoBaseListener {
private EventoBaseAPI evento;

@EventHandler
public void onBlockBreakEvento(BlockBreakEvent e) {
public void onBlockBreakEventoSPLEEF(BlockBreakEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
Expand All @@ -33,13 +34,15 @@ public void onBlockBreakEvento(BlockBreakEvent e) {
}

@EventHandler
public void onPlayerMoveEvent(PlayerMoveEvent e) {
public void onPlayerMoveEventSPLEEF(PlayerMoveEvent e) {
evento = HEventos.getHEventos().getEventosController().getEvento();
if (evento == null)
return;
if (evento.getEventoType() == EventoType.SPLEEF)
return;
if (!evento.getParticipantes().contains(e.getPlayer()))
return;
if ((evento.isAberto()))
if (evento.isAberto())
return;
if (!evento.isOcorrendo())
return;
Expand Down
3 changes: 2 additions & 1 deletion src/me/herobrinedobem/heventos/utils/BukkitEventHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public static void unregisterEvents(Listener listener, Plugin plugin) {
if (method.getAnnotation(EventHandler.class) != null) {
BukkitEventHelper.unregisterEvent((Class<? extends Event>) method.getParameterTypes()[0], listener, plugin);
}

}
} catch (Exception e) {
e.printStackTrace();
}
}

Expand All @@ -30,6 +30,7 @@ public static void unregisterEvent(Class<? extends Event> eventClass, Listener l
try {
((HandlerList) eventClass.getMethod("getHandlerList").invoke(null)).unregister(regListener);
} catch (Exception e) {
e.printStackTrace();
}
}
}
Expand Down

1 comment on commit 4df6dbe

@gabrizord
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1 fix

Please sign in to comment.