Ejemplo n.º 1
0
 public boolean handleDeath(WarPlayer player, String deathMessage) {
   WarGame game = warzone.getGame().orElseThrow(IllegalStateException::new);
   plugin.delayTask(
       3,
       () -> {
         if (player.isPlayingWar()) game.resetPlayerState(player);
       });
   return true;
 }
Ejemplo n.º 2
0
 public boolean handlePlayerLeaveZone(WarPlayer player, WarLocation from, WarLocation to) {
   Optional<WarGame> game = warzone.getGame();
   if (game.isPresent() && game.get().isPlaying(player)) {
     player.sendMessage("Please use /warleave to exit the game before leaving.");
     warzone.mask(player);
     plugin.delayTask(3, () -> warzone.unmask(player));
     return true;
   }
   return false;
 }
Ejemplo n.º 3
0
 public boolean handlePlayerEnterZone(WarPlayer player, WarLocation from, WarLocation to) {
   Optional<WarGame> game = warzone.getGame();
   if (game.isPresent() && !game.get().isPlaying(player) || !player.isZoneMaker()) {
     player.sendMessage("Please join a team first.");
     player.setLocation(warzone.getTeleport());
     warzone.mask(player);
     plugin.delayTask(3, () -> warzone.unmask(player));
     return false;
   }
   return false;
 }