Conf should be called ConfServer.

This commit is contained in:
Olof Larsson 2013-03-26 09:50:19 +01:00
parent 2544fa0a6b
commit d274874092
5 changed files with 23 additions and 25 deletions

View File

@ -1,6 +1,5 @@
package com.massivecraft.mcore;
import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@ -11,10 +10,18 @@ import com.massivecraft.mcore.cmd.CmdMcore;
import com.massivecraft.mcore.usys.cmd.CmdUsys;
import com.massivecraft.mcore.util.MUtil;
public class Conf extends SimpleConfig
public class ConfServer extends SimpleConfig
{
// -------------------------------------------- //
// CONTENT
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static transient ConfServer i = new ConfServer();
public static ConfServer get() { return i; }
public ConfServer() { super(MCore.get()); }
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public static String dburi = "gson://./mstore";
@ -42,13 +49,4 @@ public class Conf extends SimpleConfig
if (Perm.NOTPDELAY.has(permissible, false)) return 0;
return Math.max(tpdelay, 0);
}
// -------------------------------------------- //
// META
// -------------------------------------------- //
public static transient Conf i = new Conf();
private Conf()
{
super(MCore.get(), new File("plugins/mcore/conf.json"));
}
}

View File

@ -49,9 +49,9 @@ public class MCore extends MPlugin
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static MCore p;
public static MCore get() { return p; }
public MCore() { p = this; }
private static MCore i;
public static MCore get() { return i; }
public MCore() { i = this; }
// -------------------------------------------- //
// STATIC
@ -73,7 +73,7 @@ public class MCore extends MPlugin
.registerTypeAdapter(PS.class, PSAdapter.get());
}
public static String getServerId() { return Conf.serverid; }
public static String getServerId() { return ConfServer.serverid; }
private static Db<?> db;
public static Db<?> getDb() { return db; }
@ -109,10 +109,10 @@ public class MCore extends MPlugin
if ( ! preEnable()) return;
Conf.i.load();
ConfServer.get().load();
// Setup the default database
db = MStore.getDb(Conf.dburi);
db = MStore.getDb(ConfServer.dburi);
// Setup PlayerUtil and it's events
new PlayerUtil(this);

View File

@ -1,6 +1,6 @@
package com.massivecraft.mcore.cmd;
import com.massivecraft.mcore.Conf;
import com.massivecraft.mcore.ConfServer;
import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.Perm;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
@ -11,7 +11,7 @@ public class CmdMcore extends MCommand
public CmdMcore()
{
this.addAliases(Conf.getCmdAliases(MCORE));
this.addAliases(ConfServer.getCmdAliases(MCORE));
this.addRequirements(ReqHasPerm.get(Perm.CMD_MCORE.node));
}
@ -19,6 +19,6 @@ public class CmdMcore extends MCommand
public void perform()
{
this.msg("<i>You are running %s", MCore.get().getDescription().getFullName());
this.msg("<i>The id of this server is \"<h>%s<i>\".", Conf.serverid);
this.msg("<i>The id of this server is \"<h>%s<i>\".", ConfServer.serverid);
}
}

View File

@ -4,7 +4,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.permissions.Permissible;
import com.massivecraft.mcore.Conf;
import com.massivecraft.mcore.ConfServer;
import com.massivecraft.mcore.ps.PS;
import com.massivecraft.mcore.util.SenderUtil;
@ -72,7 +72,7 @@ public abstract class TeleportMixinAbstract implements TeleportMixin
public static int getTpdelay(Permissible delayPermissible)
{
return Conf.getTpdelay(delayPermissible);
return ConfServer.getTpdelay(delayPermissible);
}
}

View File

@ -1,6 +1,6 @@
package com.massivecraft.mcore.usys.cmd;
import com.massivecraft.mcore.Conf;
import com.massivecraft.mcore.ConfServer;
import com.massivecraft.mcore.Perm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.MCommand;
@ -19,7 +19,7 @@ public class CmdUsys extends MCommand
{
super();
this.addAliases(Conf.getCmdAliases(USYS));
this.addAliases(ConfServer.getCmdAliases(USYS));
this.addSubCommand(this.cmdUsysMultiverse);
this.addSubCommand(this.cmdUsysUniverse);