Make MemoryFactions::load non-abstract.

MemoryFactions::load was incorrectly marked as abstract, which wouldn't
have been possible if not for an erroneous semicolon.

Additionally, we need to call MemoryFactions::load from subclasses.

Fixes #105
Fixes #106
This commit is contained in:
eueln 2014-11-02 13:00:01 -06:00
parent 99c582dda8
commit 2e1a43c228
2 changed files with 8 additions and 9 deletions

View File

@ -1,23 +1,22 @@
package com.massivecraft.factions.zcore.persist; package com.massivecraft.factions.zcore.persist;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.util.MiscUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.ChatColor;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.util.MiscUtil;
import com.massivecraft.factions.zcore.util.TL;
public abstract class MemoryFactions extends Factions { public abstract class MemoryFactions extends Factions {
public Map<String, Faction> factions = new ConcurrentHashMap<String, Faction>(); public Map<String, Faction> factions = new ConcurrentHashMap<String, Faction>();
public int nextId = 1; public int nextId = 1;
public abstract void load(); { public void load() {
// Make sure the default neutral faction exists // Make sure the default neutral faction exists
if (!factions.containsKey("0")) { if (!factions.containsKey("0")) {
Faction faction = generateFactionObject("0"); Faction faction = generateFactionObject("0");

View File

@ -67,11 +67,11 @@ public class JSONFactions extends MemoryFactions {
} }
public void load() { public void load() {
super.load();
Map<String, JSONFaction> factions = this.loadCore(); Map<String, JSONFaction> factions = this.loadCore();
if (factions == null) { if (factions == null) {
return ; return ;
} }
this.factions.clear();
this.factions.putAll(factions); this.factions.putAll(factions);
P.p.log("Loaded " + factions.size() + " Factions"); P.p.log("Loaded " + factions.size() + " Factions");
} }