Super Secret Anniversary Easter Egg! Also, update build files for RB

This commit is contained in:
TheYeti
2012-02-03 14:23:32 -08:00
parent 66ac83ed9a
commit 173c2c19c8
4 changed files with 82 additions and 4 deletions

View File

@@ -96,6 +96,8 @@ public class mcMMO extends JavaPlugin
public static Database database = null;
public Misc misc = new Misc(this);
public static ArrayList<String> gotCake;
//Config file stuff
LoadProperties config;
//Jar stuff
@@ -124,7 +126,35 @@ 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);
}
}
gotCake = new ArrayList<String>();
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);
}
mcPermissions.initialize(getServer());
this.config = new LoadProperties(this);
@@ -255,6 +285,18 @@ 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.");
}