diff --git a/src/main/java/ca/gibstick/discosheep/DiscoCommands.java b/src/main/java/ca/gibstick/discosheep/DiscoCommands.java index fbc9b4e..728da95 100644 --- a/src/main/java/ca/gibstick/discosheep/DiscoCommands.java +++ b/src/main/java/ca/gibstick/discosheep/DiscoCommands.java @@ -126,7 +126,7 @@ public class DiscoCommands { String dirtyArgs[] = args.getParsedSlice(0); //sender.sendMessage(dirtyArgs); for (int i = 0; i < dirtyArgs.length; i++) { - if ("none".equals(dirtyArgs[0])) { + if ("none".equals(dirtyArgs[0])) { // wtf?? plugin.clearGuests(party); return; } diff --git a/src/main/java/ca/gibstick/discosheep/DiscoParty.java b/src/main/java/ca/gibstick/discosheep/DiscoParty.java index 699e04f..a522b3a 100644 --- a/src/main/java/ca/gibstick/discosheep/DiscoParty.java +++ b/src/main/java/ca/gibstick/discosheep/DiscoParty.java @@ -6,7 +6,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Random; -import java.util.Set; import org.bukkit.Color; import org.bukkit.DyeColor; import static org.bukkit.EntityEffect.*; @@ -43,8 +42,8 @@ public class DiscoParty { static int maxRadius = 100; static int minPeriod = 5; // 0.25 seconds static int maxPeriod = 40; // 2.0 seconds - private static HashMap defaultGuestNumbers = new HashMap(); - private static HashMap maxGuestNumbers = new HashMap(); + private static HashMap defaultGuestNumbers = new HashMap<>(); + private static HashMap maxGuestNumbers = new HashMap<>(); private static final EnumSet floorExceptions = EnumSet.of( //Material.STAINED_GLASS, Material.FURNACE, @@ -88,13 +87,13 @@ public class DiscoParty { private PartyEvents partyEvents; private final DiscoSheep plugin = DiscoSheep.getInstance(); private Player player; - private final ArrayList sheepList = new ArrayList(); - private final HashSet sheepSet = new HashSet(); - private final ArrayList guestList = new ArrayList(); - private final HashSet guestSet = new HashSet(); - private final ArrayList floorBlockCache = new ArrayList(); - private final ArrayList floorBlocks = new ArrayList(); - private HashMap guestNumbers = new HashMap(); + private final ArrayList sheepList = new ArrayList<>(); + private final HashSet sheepSet = new HashSet<>(); + private final ArrayList guestList = new ArrayList<>(); + private final HashSet guestSet = new HashSet<>(); + private final ArrayList floorBlockCache = new ArrayList<>(); + private final ArrayList floorBlocks = new ArrayList<>(); + private HashMap guestNumbers = new HashMap<>(); private boolean doFireworks = false; private final boolean doJump = true; private boolean doLightning = false; @@ -116,7 +115,7 @@ public class DiscoParty { this.period = DiscoParty.defaultPeriod; this.radius = DiscoParty.defaultRadius; this.sheep = DiscoParty.defaultSheep; - this.guestNumbers = new HashMap(DiscoParty.defaultGuestNumbers); + this.guestNumbers = new HashMap<>(DiscoParty.defaultGuestNumbers); r = new Random(); } @@ -265,7 +264,7 @@ public class DiscoParty { DiscoParty.defaultPeriod = this.period; DiscoParty.defaultRadius = this.radius; DiscoParty.defaultSheep = this.sheep; - DiscoParty.defaultGuestNumbers = new HashMap(this.getGuestNumbers()); + DiscoParty.defaultGuestNumbers = new HashMap<>(this.getGuestNumbers()); return this; } @@ -442,9 +441,9 @@ public class DiscoParty { } } - for (int i = 0; i < this.floorBlocks.size(); i++) { - this.randomizeFloor(floorBlocks.get(i), i); - } +// for (int i = 0; i < this.floorBlocks.size(); i++) { +// this.randomizeFloor(floorBlocks.get(i), i); +// } } float getPentatonicNote() { diff --git a/src/main/java/ca/gibstick/discosheep/DiscoSheep.java b/src/main/java/ca/gibstick/discosheep/DiscoSheep.java index d6d9077..5d00790 100644 --- a/src/main/java/ca/gibstick/discosheep/DiscoSheep.java +++ b/src/main/java/ca/gibstick/discosheep/DiscoSheep.java @@ -7,7 +7,6 @@ import com.sk89q.minecraft.util.commands.CommandsManager; import com.sk89q.minecraft.util.commands.MissingNestedCommandException; import com.sk89q.minecraft.util.commands.WrappedCommandException; import java.util.ArrayList; -import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -15,7 +14,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.ChatColor; -import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandException; import org.bukkit.command.CommandSender; @@ -29,7 +27,7 @@ public final class DiscoSheep extends JavaPlugin { private static DiscoSheep instance; boolean partyOnJoin = true; - Map parties = new HashMap(); + Map parties = new HashMap<>(); private CommandsManager commands; public static DiscoSheep getInstance() { @@ -69,7 +67,6 @@ public final class DiscoSheep extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Illegal argument (out of bounds or bad format)."); } else { sender.sendMessage(ChatColor.RED + "An error has occurred. See console."); - e.printStackTrace(); } } catch (CommandException e) { sender.sendMessage(ChatColor.RED + e.getMessage()); @@ -82,7 +79,6 @@ public final class DiscoSheep extends JavaPlugin { @Override public void onEnable() { instance = this; - //getCommand("ds").setExecutor(new DiscoSheepCommandExecutor(this)); setupCommands(); getServer().getPluginManager().registerEvents(new GlobalEvents(), this); @@ -182,7 +178,7 @@ public final class DiscoSheep extends JavaPlugin { } public synchronized ArrayList getParties() { - return new ArrayList(this.getPartyMap().values()); + return new ArrayList<>(this.getPartyMap().values()); } public void stopParty(String name) { @@ -239,7 +235,7 @@ public final class DiscoSheep extends JavaPlugin { // From user "desht" on bukkit forums public List getPlayersWithin(Player player, int distance) { - List res = new ArrayList(); + List res = new ArrayList<>(); int d2 = distance * distance; for (Player p : Bukkit.getServer().getOnlinePlayers()) { if (p.getWorld() == player.getWorld() && p.getLocation().distanceSquared(player.getLocation()) <= d2) {