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:15:00 +01:00
parent eed5117454
commit 57c26b2faf
6 changed files with 9 additions and 9 deletions

View File

@ -182,7 +182,7 @@ public class ArenaMasterImpl implements ArenaMaster
public List<Player> getAllPlayersInArena(String 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() {
@ -194,7 +194,7 @@ public class ArenaMasterImpl implements ArenaMaster
public List<Player> getLivingPlayersInArena(String 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) {

View File

@ -45,7 +45,7 @@ public class ClassLimitManager
private void initInUseMap() {
// Initialize the in-use map with zeros.
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) {
limits.set(ac.getConfigName(), -1);
classLimits.put(ac, new MutableInt(-1));
classesInUse.put(ac, new HashSet<String>());
classesInUse.put(ac, new HashSet<>());
}
if (classLimits.get(ac).value() <= -1)

View File

@ -326,7 +326,7 @@ public class MASpawnThread implements Runnable
}
private void removeDeadMonsters() {
List<Entity> tmp = new ArrayList<Entity>(monsterManager.getMonsters());
List<Entity> tmp = new ArrayList<>(monsterManager.getMonsters());
for (Entity e : tmp) {
if (e == null) {
continue;

View File

@ -35,14 +35,14 @@ public class RewardManager
public void addReward(Player p, Thing thing) {
if (!players.containsKey(p)) {
players.put(p, new ArrayList<Thing>());
players.put(p, new ArrayList<>());
}
players.get(p).add(thing);
}
public List<Thing> getRewards(Player 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) {

View File

@ -35,7 +35,7 @@ public class ChainLightning implements Ability
if (target == null || !(target instanceof Player))
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) {

View File

@ -21,7 +21,7 @@ public class ShufflePositions implements Ability
@Override
public void execute(Arena arena, MABoss 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());
// Grab the locations