예제 #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;
 }
예제 #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;
 }
예제 #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;
 }