diff --git a/src/main/java/com/massivecraft/factions/zcore/MPlugin.java b/src/main/java/com/massivecraft/factions/zcore/MPlugin.java index 900c5449..8a0e7a32 100644 --- a/src/main/java/com/massivecraft/factions/zcore/MPlugin.java +++ b/src/main/java/com/massivecraft/factions/zcore/MPlugin.java @@ -33,7 +33,7 @@ public abstract class MPlugin extends JavaPlugin { public PermUtil perm; // Persist related - public Gson gson; + public final Gson gson = this.getGsonBuilder().create(); private Integer saveTask = null; private boolean autoSave = true; protected boolean loadSuccessful = false; @@ -80,10 +80,6 @@ public abstract class MPlugin extends JavaPlugin { this.perm = new PermUtil(this); this.persist = new Persist(this); - // GSON 2.1 is now embedded in CraftBukkit, used by the auto-updater: https://github.com/Bukkit/CraftBukkit/commit/0ed1d1fdbb1e0bc09a70bc7bfdf40c1de8411665 -// if ( ! lib.require("gson.jar", "http://search.maven.org/remotecontent?filepath=com/google/code/gson/gson/2.1/gson-2.1.jar")) return false; - this.gson = this.getGsonBuilder().create(); - this.txt = new TextUtil(); initTXT(); diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java index 8bb3f17f..f9f884c1 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java @@ -13,7 +13,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; public abstract class MemoryFactions extends Factions { - public Map factions = new ConcurrentHashMap(); + public final Map factions = new ConcurrentHashMap(); public int nextId = 1; public void load() { diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java index 6abbd789..ecd33c4f 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java @@ -22,26 +22,18 @@ import java.util.logging.Level; public class JSONFactions extends MemoryFactions { // Info on how to persist - private Gson gson; + private final Gson gson; public Gson getGson() { return gson; } - public void setGson(Gson gson) { - this.gson = gson; - } - - private File file; + private final File file; public File getFile() { return file; } - public void setFile(File file) { - this.file = file; - } - // -------------------------------------------- // // CONSTRUCTORS // -------------------------------------------- //