Release 1.0.1

- Suppression de nombreux messages de debug
- Ajout d'indications lors d'erreurs dans certaines commandes (pour éviter les internal error)
This commit is contained in:
leomelki 2020-03-20 00:56:45 +01:00
parent 0960fac4c2
commit 6c9bafd885
18 changed files with 24 additions and 56 deletions

View file

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>fr.leomelki</groupId> <groupId>fr.leomelki</groupId>
<artifactId>LoupGarou</artifactId> <artifactId>LoupGarou</artifactId>
<version>1.0.0</version> <version>1.0.1</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

View file

@ -230,8 +230,23 @@ public class MainLg extends JavaPlugin{
LGPlayer.thePlayer(Bukkit.getPlayer(args[1])).getGame().broadcastMessage("§cLa partie a été arrêtée de force !"); LGPlayer.thePlayer(Bukkit.getPlayer(args[1])).getGame().broadcastMessage("§cLa partie a été arrêtée de force !");
return true; return true;
}else if(args[0].equalsIgnoreCase("start")) { }else if(args[0].equalsIgnoreCase("start")) {
if(args.length < 2) {
sender.sendMessage("§4Utilisation : §c/lg start <pseudo>");
return true;
}
Player player = Bukkit.getPlayer(args[1]);
if(player == null) {
sender.sendMessage("§4Erreur : §cLe joueur §4"+args[1]+"§c n'existe pas !");
return true;
}
LGPlayer lgp = LGPlayer.thePlayer(player);
if(MainLg.getInstance().getConfig().getList("spawns").size() < lgp.getGame().getMaxPlayers()) {
sender.sendMessage("§4Erreur : §cIl n'y a pas assez de points de spawn !");
sender.sendMessage("§8§oPour les définir, merci de faire §7/lg addSpawn");
return true;
}
sender.sendMessage("§aVous avez bien démarré une nouvelle partie !"); sender.sendMessage("§aVous avez bien démarré une nouvelle partie !");
LGPlayer.thePlayer(Bukkit.getPlayer(args[1])).getGame().updateStart(); lgp.getGame().updateStart();
return true; return true;
}else if(args[0].equalsIgnoreCase("reloadconfig")) { }else if(args[0].equalsIgnoreCase("reloadconfig")) {
sender.sendMessage("§aVous avez bien reload la config !"); sender.sendMessage("§aVous avez bien reload la config !");

View file

@ -183,11 +183,9 @@ public class LGGame implements Listener{
} }
public void kill(LGPlayer player, Reason reason) { public void kill(LGPlayer player, Reason reason) {
System.out.println("Kill "+player.getName()+" ("+player.getRole()+") for "+reason+" ("+(!deaths.containsValue(player) && !player.isDead())+")");
if(!deaths.containsValue(player) && !player.isDead()){ if(!deaths.containsValue(player) && !player.isDead()){
LGNightPlayerPreKilledEvent event = new LGNightPlayerPreKilledEvent(this, player, reason); LGNightPlayerPreKilledEvent event = new LGNightPlayerPreKilledEvent(this, player, reason);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
System.out.println("Mort de "+player.getName()+" cancel:"+event.isCancelled());
if(!event.isCancelled()) if(!event.isCancelled())
deaths.put(event.getReason(), player); deaths.put(event.getReason(), player);
} }
@ -320,11 +318,13 @@ public class LGGame implements Listener{
return; return;
} }
if(timeLeft == 5*2-1) { if(timeLeft == 5*2-1) {
broadcastMessage("§2Attribution des rôles...");
for(LGPlayer lgp : getInGame()) { for(LGPlayer lgp : getInGame()) {
lgp.sendMessage("§8Plugin développé par : §e§lLeomelki§8.\n§8Projet organisé par : §e§lShytoos§8.\n");
lgp.sendTitle("", "§8§8Plugin LoupGarou par §e§lLeomelki§8 & §e§lShytoos", 40);
lgp.getPlayer().getInventory().clear(); lgp.getPlayer().getInventory().clear();
lgp.getPlayer().updateInventory(); lgp.getPlayer().updateInventory();
} }
broadcastMessage("§2Attribution des rôles...");
} }
if(--actualRole < 0) if(--actualRole < 0)
@ -339,7 +339,6 @@ public class LGGame implements Listener{
}.runTaskTimer(MainLg.getInstance(), 0, 4); }.runTaskTimer(MainLg.getInstance(), 0, 4);
} }
private void _start() { private void _start() {
broadcastMessage("§8Plugin développé par : §e§lLeomelki§8.\n§8Projet organisé par : §e§lShytoos§8.\n");
broadcastMessage("§8§oDébut de la partie..."); broadcastMessage("§8§oDébut de la partie...");
//Give roles... //Give roles...
ArrayList<LGPlayer> toGive = (ArrayList<LGPlayer>) inGame.clone(); ArrayList<LGPlayer> toGive = (ArrayList<LGPlayer>) inGame.clone();
@ -867,7 +866,6 @@ public class LGGame implements Listener{
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if(doEndGame && event.getWinType() != LGWinType.NONE) if(doEndGame && event.getWinType() != LGWinType.NONE)
endGame(event.getWinType()); endGame(event.getWinType());
System.out.println("Endgame check result > "+event.getWinType()+" ("+doEndGame+")");
return event.getWinType() != LGWinType.NONE; return event.getWinType() != LGWinType.NONE;
} }
} }

View file

@ -265,7 +265,6 @@ public class LGPlayer {
public boolean canSelectDead; public boolean canSelectDead;
public LGPlayer getPlayerOnCursor(List<LGPlayer> list) { public LGPlayer getPlayerOnCursor(List<LGPlayer> list) {
Location loc = getPlayer().getLocation(); Location loc = getPlayer().getLocation();
System.out.println("hit > "+blacklistedChoice.size()+" > "+blacklistedChoice+" > "+list);
if(loc.getPitch() > 60) if(loc.getPitch() > 60)
if(blacklistedChoice.contains(this)) if(blacklistedChoice.contains(this))
return null; return null;
@ -275,7 +274,6 @@ public class LGPlayer {
loc.add(loc.getDirection()); loc.add(loc.getDirection());
for(LGPlayer player : list) { for(LGPlayer player : list) {
if(player != this && !blacklistedChoice.contains(player) && (!player.isDead() || canSelectDead) && VariousUtils.distanceSquaredXZ(loc, player.getPlayer().getLocation()) < 0.35 && Math.abs(loc.getY()-player.getPlayer().getLocation().getY()) < 2) { if(player != this && !blacklistedChoice.contains(player) && (!player.isDead() || canSelectDead) && VariousUtils.distanceSquaredXZ(loc, player.getPlayer().getLocation()) < 0.35 && Math.abs(loc.getY()-player.getPlayer().getLocation().getY()) < 2) {
System.out.println("detect");
return player; return player;
} }
} }

View file

@ -111,7 +111,6 @@ public class LGVote {
boolean equal = false; boolean equal = false;
for(Entry<LGPlayer, List<LGPlayer>> entry : votes.entrySet()) for(Entry<LGPlayer, List<LGPlayer>> entry : votes.entrySet())
if(entry.getValue().size() > max) { if(entry.getValue().size() > max) {
System.out.println(entry.getKey()+" has "+entry.getValue().size()+" vote(s)");
equal = false; equal = false;
max = entry.getValue().size(); max = entry.getValue().size();
choosen = entry.getKey(); choosen = entry.getKey();

View file

@ -18,23 +18,18 @@ public class LGChat {
} }
public void sendMessage(LGPlayer sender, String message) { public void sendMessage(LGPlayer sender, String message) {
System.out.println("sendmessage of "+sender.getName()+" "+this);
String sendMessage = getViewers().get(sender).send(sender, message); String sendMessage = getViewers().get(sender).send(sender, message);
for(Entry<LGPlayer, LGChatCallback> entry : viewers.entrySet()) { for(Entry<LGPlayer, LGChatCallback> entry : viewers.entrySet())
System.out.println(" to "+entry.getKey().getName());
entry.getKey().sendMessage(sendMessage != null ? sendMessage : entry.getValue().receive(sender, message)); entry.getKey().sendMessage(sendMessage != null ? sendMessage : entry.getValue().receive(sender, message));
}
} }
public void join(LGPlayer player, LGChatCallback callback) { public void join(LGPlayer player, LGChatCallback callback) {
System.out.println("join "+player.getName()+" ! "+this);
if(getViewers().containsKey(player)) if(getViewers().containsKey(player))
getViewers().replace(player, callback); getViewers().replace(player, callback);
else else
getViewers().put(player, callback); getViewers().put(player, callback);
} }
public void leave(LGPlayer player) { public void leave(LGPlayer player) {
System.out.println("leave "+player.getName()+" ! "+this);
getViewers().remove(player); getViewers().remove(player);
} }
} }

View file

@ -51,12 +51,6 @@ public class CancelListener implements Listener{
@EventHandler @EventHandler
public void onEntitySpawn(EntitySpawnEvent e) { public void onEntitySpawn(EntitySpawnEvent e) {
e.setCancelled(true); e.setCancelled(true);
//TODO here
/* System.out.println("\r\n" +
" //TODO here\r\n" +
" //ERREUR : LE LGN PEUT NE PAS AVOIR SON MENU SI IL A LE CHAT OUVERT PAR EX..AVOIR.\r\n" +
" //SI QQN VOIT PLUS SON PERSO -> sneak");
*///TODO : REMPLACER LE MUTE / UNNMUTE PAR UN SYSTEME DE CHAT AVEC UNE LISTE DES PARTICIPANTS DU CHAT DEDANS (ET DU COUP DES SUR CLASSES DE CHAT QUI OVERRIDE LA FONCTION QUI FORMATTE LES MESSAGES DU COUP POSSIBILITE DUTILISER CA POUR FAIRE UN SYSTEME SUR DISCORD (ET FAIRE UN TYPE DE SALON NOCHAT QUAND ON PEUT PAS PARLER))
} }
@EventHandler @EventHandler
public void onDrop(PlayerDropItemEvent e) { public void onDrop(PlayerDropItemEvent e) {

View file

@ -79,7 +79,6 @@ public class JoinListener implements Listener{
if(lgp.getRole() != null && !lgp.isDead()) if(lgp.getRole() != null && !lgp.isDead())
lgp.getGame().kill(lgp, Reason.DISCONNECTED, true); lgp.getGame().kill(lgp, Reason.DISCONNECTED, true);
lgp.getGame().getInGame().remove(lgp); lgp.getGame().getInGame().remove(lgp);
System.out.println("rem > "+lgp.getGame().getInGame());
lgp.getGame().checkLeave(); lgp.getGame().checkLeave();
} }
LGPlayer.removePlayer(p); LGPlayer.removePlayer(p);

View file

@ -86,7 +86,6 @@ public class RAssassin extends Role{
@EventHandler @EventHandler
public void onTour(LGRoleTurnEndEvent e) { public void onTour(LGRoleTurnEndEvent e) {
if(e.getGame() == getGame()) { if(e.getGame() == getGame()) {
System.out.println(e.getPreviousRole());
if(e.getPreviousRole() instanceof RLoupGarou) { if(e.getPreviousRole() instanceof RLoupGarou) {
for(LGPlayer lgp : getGame().getAlive()) for(LGPlayer lgp : getGame().getAlive())
if(lgp.getCache().getBoolean("assassin_protected")) { if(lgp.getCache().getBoolean("assassin_protected")) {

View file

@ -87,7 +87,6 @@ public class RBouffon extends Role{
needToPlay.remove(player); needToPlay.remove(player);
player.showView(); player.showView();
player.getCache().set("bouffon_win", true); player.getCache().set("bouffon_win", true);
System.out.println(getGame().getVote());
List<LGPlayer> choosable = getGame().getVote().getVotes(player); List<LGPlayer> choosable = getGame().getVote().getVotes(player);
StringJoiner sj = new StringJoiner("§6§o, §6§o§l"); StringJoiner sj = new StringJoiner("§6§o, §6§o§l");
for(LGPlayer lgp : choosable) for(LGPlayer lgp : choosable)
@ -98,7 +97,6 @@ public class RBouffon extends Role{
player.choose((choosen)->{ player.choose((choosen)->{
if(choosen != null) { if(choosen != null) {
System.out.println(choosable+" / "+getGame().getVote().getVotes()+" "+getGame().getVote());
if(!choosable.contains(choosen)) if(!choosable.contains(choosen))
player.sendMessage("§7§l"+choosen.getName()+"§4 n'a pas voté pour vous."); player.sendMessage("§7§l"+choosen.getName()+"§4 n'a pas voté pour vous.");
else if(choosen.isDead()) else if(choosen.isDead())

View file

@ -66,7 +66,6 @@ public class RChaperonRouge extends Role{
@EventHandler @EventHandler
public void onTour(LGRoleTurnEndEvent e) { public void onTour(LGRoleTurnEndEvent e) {
if(e.getGame() == getGame()) { if(e.getGame() == getGame()) {
System.out.println(e.getPreviousRole());
if(e.getPreviousRole() instanceof RLoupGarou) { if(e.getPreviousRole() instanceof RLoupGarou) {
for(LGPlayer lgp : getGame().getAlive()) for(LGPlayer lgp : getGame().getAlive())
if(lgp.getCache().getBoolean("chaperon_kill")) { if(lgp.getCache().getBoolean("chaperon_kill")) {

View file

@ -63,7 +63,6 @@ public class RChasseur extends Role{
}, (currentPlayer, secondsLeft)->{ }, (currentPlayer, secondsLeft)->{
return currentPlayer == player ? "§9§lC'est à ton tour !" : "§6Le Chasseur choisit sa cible (§e"+secondsLeft+" s§6)"; return currentPlayer == player ? "§9§lC'est à ton tour !" : "§6Le Chasseur choisit sa cible (§e"+secondsLeft+" s§6)";
}); });
System.out.println("tour de "+player.getName());
getGame().broadcastMessage("§9"+getBroadcastedTask()); getGame().broadcastMessage("§9"+getBroadcastedTask());
player.sendMessage("§6"+getTask()); player.sendMessage("§6"+getTask());
//player.sendTitle("§6C'est à vous de jouer", "§a"+getTask(), 60); //player.sendTitle("§6C'est à vous de jouer", "§a"+getTask(), 60);
@ -93,31 +92,24 @@ public class RChasseur extends Role{
@EventHandler @EventHandler
public void onPlayerKill(LGPlayerKilledEvent e) { public void onPlayerKill(LGPlayerKilledEvent e) {
System.out.println(e.getKilled().getRole()+" "+this); if(e.getKilled().getRole() == this && e.getReason() != Reason.DISCONNECTED)
if(e.getKilled().getRole() == this && e.getReason() != Reason.DISCONNECTED) {
needToPlay.add(e.getKilled()); needToPlay.add(e.getKilled());
System.out.println("added");
}
} }
@EventHandler @EventHandler
public void onDayStart(LGDayStartEvent e) { public void onDayStart(LGDayStartEvent e) {
if(e.getGame() != getGame())return; if(e.getGame() != getGame())return;
System.out.println("day start "+needToPlay.size());
if(needToPlay.size() > 0) if(needToPlay.size() > 0)
e.setCancelled(true); e.setCancelled(true);
if(!e.isCancelled())return; if(!e.isCancelled())return;
System.out.println("cancel");
new Runnable() { new Runnable() {
public void run() { public void run() {
if(needToPlay.size() == 0) { if(needToPlay.size() == 0) {
System.out.println("finish");
e.getGame().startDay(); e.getGame().startDay();
return; return;
} }
LGPlayer player = needToPlay.remove(0); LGPlayer player = needToPlay.remove(0);
System.out.println("> "+player.getName());
onNightTurn(player, this); onNightTurn(player, this);
} }
}.run(); }.run();
@ -126,22 +118,18 @@ public class RChasseur extends Role{
@EventHandler @EventHandler
public void onEndGame(LGGameEndEvent e) { public void onEndGame(LGGameEndEvent e) {
if(e.getGame() != getGame())return; if(e.getGame() != getGame())return;
System.out.println("game end "+needToPlay.size());
if(needToPlay.size() > 0) if(needToPlay.size() > 0)
e.setCancelled(true); e.setCancelled(true);
if(!e.isCancelled())return; if(!e.isCancelled())return;
System.out.println("cancel");
new Runnable() { new Runnable() {
public void run() { public void run() {
if(needToPlay.size() == 0) { if(needToPlay.size() == 0) {
System.out.println("finish game");
e.getGame().checkEndGame(true); e.getGame().checkEndGame(true);
return; return;
} }
LGPlayer player = needToPlay.remove(0); LGPlayer player = needToPlay.remove(0);
System.out.println(">>- "+player.getName());
onNightTurn(player, this); onNightTurn(player, this);
} }
}.run(); }.run();

View file

@ -59,13 +59,11 @@ public class RChienLoupLG extends Role{
@Override @Override
public void join(LGPlayer player, boolean sendMessage) { public void join(LGPlayer player, boolean sendMessage) {
super.join(player, sendMessage); super.join(player, sendMessage);
System.out.println(player.getName()+" a rejoint les LG (Chien Loup)");
player.setRole(this); player.setRole(this);
LGCustomItems.updateItem(player); LGCustomItems.updateItem(player);
for(Role role : getGame().getRoles()) for(Role role : getGame().getRoles())
if(role instanceof RLoupGarou) { if(role instanceof RLoupGarou) {
role.join(player, false); role.join(player, false);
System.out.println(player.getName()+" -> Chien LG -> Camp trouvé & join");
for(LGPlayer lgp : role.getPlayers()) for(LGPlayer lgp : role.getPlayers())
if(lgp != player) if(lgp != player)
lgp.sendMessage("§7§l"+player.getName()+"§6 a rejoint les §c§lLoups-Garous§6."); lgp.sendMessage("§7§l"+player.getName()+"§6 a rejoint les §c§lLoups-Garous§6.");

View file

@ -61,7 +61,6 @@ public class REnfantSauvageLG extends Role{
@Override @Override
public void join(LGPlayer player, boolean sendMessage) { public void join(LGPlayer player, boolean sendMessage) {
super.join(player, sendMessage); super.join(player, sendMessage);
System.out.println(player.getName()+" a rejoint les LG (Enfant Sauvage)");
player.setRole(this); player.setRole(this);
LGCustomItems.updateItem(player); LGCustomItems.updateItem(player);
RLoupGarou lgRole = null; RLoupGarou lgRole = null;
@ -81,7 +80,6 @@ public class REnfantSauvageLG extends Role{
} }
lgRole.join(player, false); lgRole.join(player, false);
System.out.println(player.getName()+" -> Enfant Sauvage -> Camp trouvé & join");
for(LGPlayer lgp : lgRole.getPlayers()) for(LGPlayer lgp : lgRole.getPlayers())
if(lgp != player) if(lgp != player)
lgp.sendMessage("§7§l"+player.getName()+"§6 a rejoint les §c§lLoups-Garous§6."); lgp.sendMessage("§7§l"+player.getName()+"§6 a rejoint les §c§lLoups-Garous§6.");

View file

@ -117,7 +117,6 @@ public class RLoupGarou extends Role{
boolean equal = false; boolean equal = false;
for(Entry<LGPlayer, List<LGPlayer>> entry : vote.getVotes().entrySet()) for(Entry<LGPlayer, List<LGPlayer>> entry : vote.getVotes().entrySet())
if(entry.getValue().size() > max) { if(entry.getValue().size() > max) {
System.out.println(entry.getKey()+" has "+entry.getValue().size()+" vote(s)");
equal = false; equal = false;
max = entry.getValue().size(); max = entry.getValue().size();
choosen = entry.getKey(); choosen = entry.getKey();
@ -129,7 +128,6 @@ public class RLoupGarou extends Role{
for(Entry<LGPlayer, List<LGPlayer>> entry : vote.getVotes().entrySet()) for(Entry<LGPlayer, List<LGPlayer>> entry : vote.getVotes().entrySet())
if(entry.getValue().size() == max && entry.getKey().getRoleType() != RoleType.LOUP_GAROU) if(entry.getValue().size() == max && entry.getKey().getRoleType() != RoleType.LOUP_GAROU)
choosable.add(entry.getKey()); choosable.add(entry.getKey());
System.out.println("Random choice for LG (removed lg from vote)");
if(choosable.size() > 0) if(choosable.size() > 0)
choosen = choosable.get(getGame().getRandom().nextInt(choosable.size())); choosen = choosable.get(getGame().getRandom().nextInt(choosable.size()));
} }
@ -175,10 +173,8 @@ public class RLoupGarou extends Role{
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onUpdatePrefix (LGUpdatePrefixEvent e) { public void onUpdatePrefix (LGUpdatePrefixEvent e) {
if(e.getGame() == getGame()) if(e.getGame() == getGame())
if(getPlayers().contains(e.getTo()) && getPlayers().contains(e.getPlayer())) { if(getPlayers().contains(e.getTo()) && getPlayers().contains(e.getPlayer()))
System.out.println("Prefix of "+e.getPlayer().getName()+" updated (lg) for "+e.getTo().getName());
e.setPrefix(e.getPrefix()+"§c"); e.setPrefix(e.getPrefix()+"§c");
}
} }
@EventHandler @EventHandler

View file

@ -126,7 +126,6 @@ public class RPretre extends Role{
meta.setEntityID(lgp.getPlayer().getEntityId()); meta.setEntityID(lgp.getPlayer().getEntityId());
meta.setMetadata(Arrays.asList(new WrappedWatchableObject(invisible, (byte)0))); meta.setMetadata(Arrays.asList(new WrappedWatchableObject(invisible, (byte)0)));
meta.sendPacket(player.getPlayer()); meta.sendPacket(player.getPlayer());
System.out.println("Spawning "+lgp.getName()+" for prêtre ("+player.getName()+")");
} }
}else }else
player.getPlayer().hidePlayer(lgp.getPlayer()); player.getPlayer().hidePlayer(lgp.getPlayer());

View file

@ -133,7 +133,6 @@ public class RPyromane extends Role{
List<LGPlayer> liste = player.getCache().<List<LGPlayer>>get("pyromane_essence"); List<LGPlayer> liste = player.getCache().<List<LGPlayer>>get("pyromane_essence");
LGPyromaneGasoilEvent event = new LGPyromaneGasoilEvent(getGame(), first); LGPyromaneGasoilEvent event = new LGPyromaneGasoilEvent(getGame(), first);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
System.out.println("Gasoil of "+event.getPlayer().getName()+" cancelled : "+event.isCancelled());
if(event.isCancelled()) if(event.isCancelled())
player.sendMessage("§7§l"+event.getPlayer().getName()+"§c est immunisé."); player.sendMessage("§7§l"+event.getPlayer().getName()+"§c est immunisé.");
else { else {
@ -174,9 +173,7 @@ public class RPyromane extends Role{
closeInventory(player); closeInventory(player);
if(lgp.getCache().<List<LGPlayer>>get("pyromane_essence").size() != 0) { if(lgp.getCache().<List<LGPlayer>>get("pyromane_essence").size() != 0) {
List<LGPlayer> liste = lgp.getCache().<List<LGPlayer>>get("pyromane_essence"); List<LGPlayer> liste = lgp.getCache().<List<LGPlayer>>get("pyromane_essence");
System.out.println(liste+" < liste des joueurs à kill par le pyro");
for(LGPlayer scndPlayer : liste) { for(LGPlayer scndPlayer : liste) {
System.out.println(scndPlayer.getName()+" mort: "+scndPlayer.isDead()+" & player: "+scndPlayer.getPlayer()+" / role:"+scndPlayer.getRole());
if(!scndPlayer.isDead() && scndPlayer.getPlayer() != null) { if(!scndPlayer.isDead() && scndPlayer.getPlayer() != null) {
getGame().kill(scndPlayer, Reason.PYROMANE); getGame().kill(scndPlayer, Reason.PYROMANE);
} }
@ -224,7 +221,6 @@ public class RPyromane extends Role{
lgp.stopChoosing(); lgp.stopChoosing();
LGPyromaneGasoilEvent event = new LGPyromaneGasoilEvent(getGame(), choosen); LGPyromaneGasoilEvent event = new LGPyromaneGasoilEvent(getGame(), choosen);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
System.out.println("Gasoil of "+event.getPlayer().getName()+" cancelled : "+event.isCancelled());
if(event.isCancelled()) if(event.isCancelled())
lgp.sendMessage("§7§l"+event.getPlayer().getName()+"§c est immunisée."); lgp.sendMessage("§7§l"+event.getPlayer().getName()+"§c est immunisée.");
else { else {
@ -234,7 +230,6 @@ public class RPyromane extends Role{
if(first != null) { if(first != null) {
event = new LGPyromaneGasoilEvent(getGame(), first); event = new LGPyromaneGasoilEvent(getGame(), first);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
System.out.println("Gasoil of "+event.getPlayer().getName()+" cancelled : "+event.isCancelled());
if(event.isCancelled()) if(event.isCancelled())
lgp.sendMessage("§7§l"+event.getPlayer().getName()+"§c est immunisée."); lgp.sendMessage("§7§l"+event.getPlayer().getName()+"§c est immunisée.");
else { else {

View file

@ -1,5 +1,5 @@
name: LoupGarou name: LoupGarou
version: 1.0.0 version: 1.0.1
description: Permet de jouer au jeu du loup garou description: Permet de jouer au jeu du loup garou
main: fr.leomelki.loupgarou.MainLg main: fr.leomelki.loupgarou.MainLg
depend: [ProtocolLib] depend: [ProtocolLib]