From 388323e6b0135959272df1501523e54bf4557252 Mon Sep 17 00:00:00 2001 From: jojo Date: Sat, 19 Sep 2020 14:36:03 +0200 Subject: [PATCH] Simplify ItemCountdown --- src/de/steamwar/misslewars/MWTeam.java | 10 +++++----- .../steamwar/misslewars/countdowns/ItemCountdown.java | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/de/steamwar/misslewars/MWTeam.java b/src/de/steamwar/misslewars/MWTeam.java index 4cd09ee..201d9e8 100644 --- a/src/de/steamwar/misslewars/MWTeam.java +++ b/src/de/steamwar/misslewars/MWTeam.java @@ -77,7 +77,8 @@ public class MWTeam { return spawn; } - public void join (Player p) { + @SuppressWarnings("java:S1874") + public void join(Player p) { players.add(p); p.teleport(spawn); p.setGameMode(GameMode.SURVIVAL); @@ -87,11 +88,10 @@ public class MWTeam { if (MissileWars.getFightState() == FightState.WAITING && !enemy().getPlayers().isEmpty()) MissileWars.startRound(); } - - public void leave (Player p) { - if(!players.contains(p)) - return; + @SuppressWarnings("java:S1874") + public void leave(Player p) { + if(!players.contains(p)) return; players.remove(p); sbteam.removePlayer(p); if (players.isEmpty() && MissileWars.getFightState() == FightState.FIGHTING) diff --git a/src/de/steamwar/misslewars/countdowns/ItemCountdown.java b/src/de/steamwar/misslewars/countdowns/ItemCountdown.java index 35ca32f..3c6f9a3 100644 --- a/src/de/steamwar/misslewars/countdowns/ItemCountdown.java +++ b/src/de/steamwar/misslewars/countdowns/ItemCountdown.java @@ -20,7 +20,6 @@ package de.steamwar.misslewars.countdowns; import de.steamwar.misslewars.*; -import de.steamwar.misslewars.items.Missile; import de.steamwar.misslewars.items.SpecialItem; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -29,7 +28,10 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitTask; -import java.util.*; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; public class ItemCountdown extends StateDependent {