diff --git a/src/com/cnaude/chairs/commands/ChairsIgnoreList.java b/src/com/cnaude/chairs/commands/ChairsIgnoreList.java index 0c2f3f7..8f6c49f 100644 --- a/src/com/cnaude/chairs/commands/ChairsIgnoreList.java +++ b/src/com/cnaude/chairs/commands/ChairsIgnoreList.java @@ -1,57 +1,12 @@ package com.cnaude.chairs.commands; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.ArrayList; +import java.util.HashSet; -import com.cnaude.chairs.core.Chairs; +public class ChairsIgnoreList { -@SuppressWarnings("serial") -public class ChairsIgnoreList implements Serializable { + private static HashSet ignoreList = new HashSet(); - private static ArrayList ignoreList = new ArrayList(); - private static final String IGNORE_FILE = "plugins"+File.separator+"Chairs"+File.separator+"ignores.ser"; - - private Chairs plugin; - public ChairsIgnoreList(Chairs plugin) { - this.plugin = plugin; - } - - @SuppressWarnings("unchecked") - public void load() { - File file = new File(IGNORE_FILE); - if (!file.exists()) { - plugin.logInfo("Ignore file '"+file.getAbsolutePath()+"' does not exist."); - return; - } - try { - FileInputStream f_in = new FileInputStream(file); - ObjectInputStream obj_in = new ObjectInputStream (f_in); - ignoreList = (ArrayList) obj_in.readObject(); - obj_in.close(); - plugin.logInfo("Loaded ignore list. (Count = "+ignoreList.size()+")"); - } - catch(Exception e) { - plugin.logError(e.getMessage()); - } - } - - public void save() { - try { - File file = new File(IGNORE_FILE); - FileOutputStream f_out = new FileOutputStream (file); - ObjectOutputStream obj_out = new ObjectOutputStream (f_out); - obj_out.writeObject (ignoreList); - obj_out.close(); - plugin.logInfo("Saved ignore list. (Count = "+ignoreList.size()+")"); - } - catch(Exception e) { - plugin.logError(e.getMessage()); - } + public ChairsIgnoreList() { } public void addPlayer(String s) { diff --git a/src/com/cnaude/chairs/core/Chairs.java b/src/com/cnaude/chairs/core/Chairs.java index 6275cf9..a0f78ea 100644 --- a/src/com/cnaude/chairs/core/Chairs.java +++ b/src/com/cnaude/chairs/core/Chairs.java @@ -66,8 +66,7 @@ public class Chairs extends JavaPlugin { return; } chairEffects = new ChairEffects(this); - ignoreList = new ChairsIgnoreList(this); - ignoreList.load(); + ignoreList = new ChairsIgnoreList(); psitdata = new PlayerSitData(this); getConfig().options().copyDefaults(true); saveConfig(); @@ -95,9 +94,6 @@ public class Chairs extends JavaPlugin { } } } - if (ignoreList != null) { - ignoreList.save(); - } if (chairEffects != null) { chairEffects.cancelHealing(); chairEffects.cancelPickup();