Oh yeah. I should not use ServerConf since this could be MConf.

This commit is contained in:
Olof Larsson 2013-08-29 10:55:35 +02:00
parent 3439cf75c5
commit f78872c157
5 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,3 @@
<a href="http://massivecraft.com/plugins/mcore">
<a href="http://massivecraft.com/mcore">
![MCore Logotype](https://raw.github.com/MassiveCraft/mcore/master/media/logo300.png)<br>
<b>http://massivecraft.com/plugins/mcore</b></a>
<b>http://massivecraft.com/mcore</b></a>

View File

@ -31,9 +31,6 @@ public class ConfServer extends SimpleConfig
public static String dburi = "default";
public static boolean useRecipientChatEvent = true;
public static boolean forceOnePlayerNameCase = true;
public static List<String> aliasesOuterMCore = MUtil.list("mcore");
public static List<String> aliasesOuterMCoreUsys = MUtil.list("usys");
public static List<String> aliasesOuterMCoreMStore = MUtil.list("mstore");

View File

@ -88,7 +88,7 @@ public class EngineOfflineCase implements Listener
public void forceOnePlayerNameCase(PlayerLoginEvent event)
{
// Stop if the feature is disabled
if (!ConfServer.forceOnePlayerNameCase) return;
if (!MCoreConf.get().isForcingOnePlayerNameCase()) return;
// Stop if we are using online mode
if (Bukkit.getOnlineMode()) return;

View File

@ -81,7 +81,7 @@ public class InternalListener implements Listener
public void recipientChat(final AsyncPlayerChatEvent event)
{
// Return unless we are using the recipient chat event
if (!ConfServer.useRecipientChatEvent) return;
if (!MCoreConf.get().isUsingRecipientChatEvent()) return;
// Prepare vars
final Player sender = event.getPlayer();

View File

@ -28,6 +28,8 @@ public class MCoreConf extends Entity<MCoreConf>
@Override
public MCoreConf load(MCoreConf that)
{
this.usingRecipientChatEvent = that.usingRecipientChatEvent;
this.forcingOnePlayerNameCase = that.forcingOnePlayerNameCase;
this.permissionDeniedFormats = that.permissionDeniedFormats;
this.permissionToTpdelay = that.permissionToTpdelay;
@ -39,6 +41,14 @@ public class MCoreConf extends Entity<MCoreConf>
// -------------------------------------------- //
// These getters and setters are obnoxious, defensive copying, NPE avoiding and probably thread safe.
private boolean usingRecipientChatEvent = true;
public boolean isUsingRecipientChatEvent() { return this.usingRecipientChatEvent; }
public void setUsingRecipientChatEvent(boolean usingRecipientChatEvent) { this.usingRecipientChatEvent = usingRecipientChatEvent; this.changed(); }
private boolean forcingOnePlayerNameCase = true;
public boolean isForcingOnePlayerNameCase() { return this.forcingOnePlayerNameCase; }
public void setForcingOnePlayerNameCase(boolean forcingOnePlayerNameCase) { this.forcingOnePlayerNameCase = forcingOnePlayerNameCase; this.changed(); }
private Map<String, String> permissionDeniedFormats = MUtil.map(
"some.awesome.permission.node", "<b>You must be awesome to %s<b>.",
"some.derp.permission.node.1", "derp",