Embrace diamond operator (again).

Not sure how these dodged the bullet of commit
0eeed4ff01, but here we go!
This commit is contained in:
Andreas Troelsen
2019-12-31 23:20:31 +01:00
parent eed5117454
commit 57c26b2faf
6 changed files with 9 additions and 9 deletions
@@ -182,7 +182,7 @@ public class ArenaMasterImpl implements ArenaMaster
public List<Player> getAllPlayersInArena(String arenaName) { public List<Player> getAllPlayersInArena(String arenaName) {
Arena arena = getArenaWithName(arenaName); Arena arena = getArenaWithName(arenaName);
return (arena != null) ? new ArrayList<>(arena.getPlayersInArena()) : new ArrayList<Player>(); return (arena != null) ? new ArrayList<>(arena.getPlayersInArena()) : new ArrayList<>();
} }
public List<Player> getAllLivingPlayers() { public List<Player> getAllLivingPlayers() {
@@ -194,7 +194,7 @@ public class ArenaMasterImpl implements ArenaMaster
public List<Player> getLivingPlayersInArena(String arenaName) { public List<Player> getLivingPlayersInArena(String arenaName) {
Arena arena = getArenaWithName(arenaName); Arena arena = getArenaWithName(arenaName);
return (arena != null) ? new ArrayList<>(arena.getPlayersInArena()) : new ArrayList<Player>(); return (arena != null) ? new ArrayList<>(arena.getPlayersInArena()) : new ArrayList<>();
} }
public Arena getArenaWithPlayer(Player p) { public Arena getArenaWithPlayer(Player p) {
@@ -45,7 +45,7 @@ public class ClassLimitManager
private void initInUseMap() { private void initInUseMap() {
// Initialize the in-use map with zeros. // Initialize the in-use map with zeros.
for (ArenaClass ac : classes.values()) { for (ArenaClass ac : classes.values()) {
classesInUse.put(ac, new HashSet<String>()); classesInUse.put(ac, new HashSet<>());
} }
} }
@@ -76,7 +76,7 @@ public class ClassLimitManager
if (classLimits.get(ac) == null) { if (classLimits.get(ac) == null) {
limits.set(ac.getConfigName(), -1); limits.set(ac.getConfigName(), -1);
classLimits.put(ac, new MutableInt(-1)); classLimits.put(ac, new MutableInt(-1));
classesInUse.put(ac, new HashSet<String>()); classesInUse.put(ac, new HashSet<>());
} }
if (classLimits.get(ac).value() <= -1) if (classLimits.get(ac).value() <= -1)
@@ -326,7 +326,7 @@ public class MASpawnThread implements Runnable
} }
private void removeDeadMonsters() { private void removeDeadMonsters() {
List<Entity> tmp = new ArrayList<Entity>(monsterManager.getMonsters()); List<Entity> tmp = new ArrayList<>(monsterManager.getMonsters());
for (Entity e : tmp) { for (Entity e : tmp) {
if (e == null) { if (e == null) {
continue; continue;
@@ -35,14 +35,14 @@ public class RewardManager
public void addReward(Player p, Thing thing) { public void addReward(Player p, Thing thing) {
if (!players.containsKey(p)) { if (!players.containsKey(p)) {
players.put(p, new ArrayList<Thing>()); players.put(p, new ArrayList<>());
} }
players.get(p).add(thing); players.get(p).add(thing);
} }
public List<Thing> getRewards(Player p) { public List<Thing> getRewards(Player p) {
List<Thing> rewards = players.get(p); List<Thing> rewards = players.get(p);
return (rewards == null ? new ArrayList<Thing>(1) : Collections.unmodifiableList(rewards)); return (rewards == null ? new ArrayList<>(1) : Collections.unmodifiableList(rewards));
} }
public void grantRewards(Player p) { public void grantRewards(Player p) {
@@ -35,7 +35,7 @@ public class ChainLightning implements Ability
if (target == null || !(target instanceof Player)) if (target == null || !(target instanceof Player))
return; return;
strikeLightning(arena, (Player) target, new ArrayList<Player>()); strikeLightning(arena, (Player) target, new ArrayList<>());
} }
private void strikeLightning(final Arena arena, final Player p, final List<Player> done) { private void strikeLightning(final Arena arena, final Player p, final List<Player> done) {
@@ -21,7 +21,7 @@ public class ShufflePositions implements Ability
@Override @Override
public void execute(Arena arena, MABoss boss) { public void execute(Arena arena, MABoss boss) {
// Grab the players and add the boss // Grab the players and add the boss
List<LivingEntity> entities = new ArrayList<LivingEntity>(arena.getPlayersInArena()); List<LivingEntity> entities = new ArrayList<>(arena.getPlayersInArena());
entities.add(boss.getEntity()); entities.add(boss.getEntity());
// Grab the locations // Grab the locations