Conf should be called ConfServer.
This commit is contained in:
parent
2544fa0a6b
commit
d274874092
@ -1,6 +1,5 @@
|
|||||||
package com.massivecraft.mcore;
|
package com.massivecraft.mcore;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
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.usys.cmd.CmdUsys;
|
||||||
import com.massivecraft.mcore.util.MUtil;
|
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";
|
public static String dburi = "gson://./mstore";
|
||||||
@ -42,13 +49,4 @@ public class Conf extends SimpleConfig
|
|||||||
if (Perm.NOTPDELAY.has(permissible, false)) return 0;
|
if (Perm.NOTPDELAY.has(permissible, false)) return 0;
|
||||||
return Math.max(tpdelay, 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"));
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -49,9 +49,9 @@ public class MCore extends MPlugin
|
|||||||
// INSTANCE & CONSTRUCT
|
// INSTANCE & CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static MCore p;
|
private static MCore i;
|
||||||
public static MCore get() { return p; }
|
public static MCore get() { return i; }
|
||||||
public MCore() { p = this; }
|
public MCore() { i = this; }
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// STATIC
|
// STATIC
|
||||||
@ -73,7 +73,7 @@ public class MCore extends MPlugin
|
|||||||
.registerTypeAdapter(PS.class, PSAdapter.get());
|
.registerTypeAdapter(PS.class, PSAdapter.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getServerId() { return Conf.serverid; }
|
public static String getServerId() { return ConfServer.serverid; }
|
||||||
private static Db<?> db;
|
private static Db<?> db;
|
||||||
public static Db<?> getDb() { return db; }
|
public static Db<?> getDb() { return db; }
|
||||||
|
|
||||||
@ -109,10 +109,10 @@ public class MCore extends MPlugin
|
|||||||
|
|
||||||
if ( ! preEnable()) return;
|
if ( ! preEnable()) return;
|
||||||
|
|
||||||
Conf.i.load();
|
ConfServer.get().load();
|
||||||
|
|
||||||
// Setup the default database
|
// Setup the default database
|
||||||
db = MStore.getDb(Conf.dburi);
|
db = MStore.getDb(ConfServer.dburi);
|
||||||
|
|
||||||
// Setup PlayerUtil and it's events
|
// Setup PlayerUtil and it's events
|
||||||
new PlayerUtil(this);
|
new PlayerUtil(this);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.massivecraft.mcore.cmd;
|
package com.massivecraft.mcore.cmd;
|
||||||
|
|
||||||
import com.massivecraft.mcore.Conf;
|
import com.massivecraft.mcore.ConfServer;
|
||||||
import com.massivecraft.mcore.MCore;
|
import com.massivecraft.mcore.MCore;
|
||||||
import com.massivecraft.mcore.Perm;
|
import com.massivecraft.mcore.Perm;
|
||||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||||
@ -11,7 +11,7 @@ public class CmdMcore extends MCommand
|
|||||||
|
|
||||||
public CmdMcore()
|
public CmdMcore()
|
||||||
{
|
{
|
||||||
this.addAliases(Conf.getCmdAliases(MCORE));
|
this.addAliases(ConfServer.getCmdAliases(MCORE));
|
||||||
this.addRequirements(ReqHasPerm.get(Perm.CMD_MCORE.node));
|
this.addRequirements(ReqHasPerm.get(Perm.CMD_MCORE.node));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,6 +19,6 @@ public class CmdMcore extends MCommand
|
|||||||
public void perform()
|
public void perform()
|
||||||
{
|
{
|
||||||
this.msg("<i>You are running %s", MCore.get().getDescription().getFullName());
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.permissions.Permissible;
|
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.ps.PS;
|
||||||
import com.massivecraft.mcore.util.SenderUtil;
|
import com.massivecraft.mcore.util.SenderUtil;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public abstract class TeleportMixinAbstract implements TeleportMixin
|
|||||||
|
|
||||||
public static int getTpdelay(Permissible delayPermissible)
|
public static int getTpdelay(Permissible delayPermissible)
|
||||||
{
|
{
|
||||||
return Conf.getTpdelay(delayPermissible);
|
return ConfServer.getTpdelay(delayPermissible);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.massivecraft.mcore.usys.cmd;
|
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.Perm;
|
||||||
import com.massivecraft.mcore.cmd.HelpCommand;
|
import com.massivecraft.mcore.cmd.HelpCommand;
|
||||||
import com.massivecraft.mcore.cmd.MCommand;
|
import com.massivecraft.mcore.cmd.MCommand;
|
||||||
@ -19,7 +19,7 @@ public class CmdUsys extends MCommand
|
|||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.addAliases(Conf.getCmdAliases(USYS));
|
this.addAliases(ConfServer.getCmdAliases(USYS));
|
||||||
|
|
||||||
this.addSubCommand(this.cmdUsysMultiverse);
|
this.addSubCommand(this.cmdUsysMultiverse);
|
||||||
this.addSubCommand(this.cmdUsysUniverse);
|
this.addSubCommand(this.cmdUsysUniverse);
|
||||||
|
Loading…
Reference in New Issue
Block a user