Step 1 in many removing the universe system. Untested and lacking auto convert features.
This commit is contained in:
@@ -2,11 +2,9 @@ package com.massivecraft.factions.cmd.arg;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayerColls;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.FactionColl;
|
||||
import com.massivecraft.factions.entity.FactionColls;
|
||||
import com.massivecraft.massivecore.cmd.arg.ArgReaderAbstract;
|
||||
import com.massivecraft.massivecore.cmd.arg.ArgResult;
|
||||
import com.massivecraft.massivecore.util.IdUtil;
|
||||
@@ -18,18 +16,8 @@ public class ARFaction extends ArgReaderAbstract<Faction>
|
||||
// INSTANCE & CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static ARFaction get(Object universe) { return new ARFaction(FactionColls.get().get(universe)); }
|
||||
private ARFaction(FactionColl coll)
|
||||
{
|
||||
this.coll = coll;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final FactionColl coll;
|
||||
public FactionColl getColl() { return this.coll;}
|
||||
private static ARFaction i = new ARFaction();
|
||||
public static ARFaction get() { return i; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
@@ -41,16 +29,16 @@ public class ARFaction extends ArgReaderAbstract<Faction>
|
||||
ArgResult<Faction> result = new ArgResult<Faction>();
|
||||
|
||||
// Faction Name Exact
|
||||
result.setResult(this.getColl().getByName(str));
|
||||
result.setResult(FactionColl.get().getByName(str));
|
||||
if (result.hasResult()) return result;
|
||||
|
||||
// Faction Name Match
|
||||
result.setResult(this.getColl().getBestNameMatch(str));
|
||||
result.setResult(FactionColl.get().getBestNameMatch(str));
|
||||
if (result.hasResult()) return result;
|
||||
|
||||
// UPlayer Name Exact
|
||||
String id = IdUtil.getId(str);
|
||||
UPlayer uplayer = UPlayerColls.get().get(this.getColl()).get(id);
|
||||
MPlayer uplayer = MPlayer.get(id);
|
||||
if (uplayer != null)
|
||||
{
|
||||
result.setResult(uplayer.getFaction());
|
||||
|
Reference in New Issue
Block a user