From cc9a6aa9b9e00abb76aff4759c988261e9089fb7 Mon Sep 17 00:00:00 2001 From: TheYeti Date: Sat, 4 Feb 2012 22:57:43 -0800 Subject: [PATCH] Remove anniversary stuff --- .../nossr50/commands/mc/McmmoCommand.java | 27 ----------- src/main/java/com/gmail/nossr50/mcMMO.java | 46 +------------------ 2 files changed, 1 insertion(+), 72 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java index 9bc4e176e..bafb988ee 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java @@ -51,33 +51,6 @@ public class McmmoCommand implements CommandExecutor { player.sendMessage(ChatColor.GREEN + "If you like my work you can donate via Paypal: theno1yeti@gmail.com"); } - GregorianCalendar cakedayStart = new GregorianCalendar(2012, Calendar.FEBRUARY, 3); - GregorianCalendar cakedayEnd = new GregorianCalendar(2012, Calendar.FEBRUARY, 6); - GregorianCalendar day = new GregorianCalendar(); - int cakeCheck = 0; - - for (String cake : mcMMO.gotCake) - { - if (player.getName().equalsIgnoreCase(cake)) { - cakeCheck = 1; - } - } - - if (cakeCheck == 0) { - if (getDateRange(day.getTime(), cakedayStart.getTime(), cakedayEnd.getTime())) - { - player.sendMessage(ChatColor.BLUE + "Happy 1 Year Anniversary! In honor of all of"); - player.sendMessage(ChatColor.BLUE + "nossr50's work and all the devs, have some cake!"); - } - mcMMO.gotCake.add(player.getName()); - player.getInventory().addItem(new ItemStack(Material.CAKE_BLOCK, 1)); - } - return true; } - - private boolean getDateRange(Date date, Date start, Date end) - { - return !(date.before(start) || date.after(end)); - } } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 138b44c76..a3c22d8db 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -96,8 +96,6 @@ public class mcMMO extends JavaPlugin public static Database database = null; public Misc misc = new Misc(this); - public static ArrayList gotCake; - //Config file stuff LoadProperties config; //Jar stuff @@ -126,36 +124,6 @@ public class mcMMO extends JavaPlugin //Catch all for versions not matching and no specific code being needed else if(!vnum.equalsIgnoreCase(this.getDescription().getVersion())) updateFrom(-1); } - File cakeFile = new File(getDataFolder().getAbsolutePath() + File.separator + "cake"); - - if (!cakeFile.exists()) { - try { - cakeFile.createNewFile(); - } - catch (IOException ex) { - System.out.println(ex); - } - } - - new File(getDataFolder().getAbsolutePath() + File.separator + "players").mkdir(); - - gotCake = new ArrayList(); - - try { - gotCake.clear(); - BufferedReader reader = new BufferedReader(new FileReader(getDataFolder().getAbsolutePath() + File.separator + "players")); - String line = reader.readLine(); - - while(line != null) { - gotCake.add(line); - line = reader.readLine(); - } - - reader.close(); - } - catch (Exception ex) { - System.out.println(ex); - } this.config = new LoadProperties(this); this.config.load(); @@ -170,7 +138,7 @@ public class mcMMO extends JavaPlugin */ PluginManager pm = getServer().getPluginManager(); - + if(pm.getPlugin("Spout") != null) LoadProperties.spoutEnabled = true; else @@ -285,18 +253,6 @@ public class mcMMO extends JavaPlugin return permissions; } public void onDisable() { - try { - BufferedWriter writer = new BufferedWriter(new FileWriter(getDataFolder().getAbsolutePath() + File.separator + "cake")); - for (String player : gotCake) { - writer.write(player); - writer.newLine(); - } - writer.close(); - } - catch (Exception ex) { - System.out.println(ex); - } - Bukkit.getServer().getScheduler().cancelTasks(this); System.out.println("mcMMO was disabled."); }