Added WECUI handshake option

This commit is contained in:
Jim Nordbø 2012-04-07 12:15:42 +02:00 committed by zml2008
parent d81090c5d9
commit 2ed92dafad
5 changed files with 9 additions and 3 deletions

View File

@ -78,6 +78,7 @@ public abstract class LocalConfiguration {
}; };
public boolean profile = false; public boolean profile = false;
public boolean enableWECUI = true;
public Set<Integer> disallowedBlocks = new HashSet<Integer>(); public Set<Integer> disallowedBlocks = new HashSet<Integer>();
public int defaultChangeLimit = -1; public int defaultChangeLimit = -1;
public int maxChangeLimit = -1; public int maxChangeLimit = -1;

View File

@ -137,13 +137,15 @@ public class BukkitPlayer extends LocalPlayer {
if (plugin.hasPluginChannelCUI(getName())) { if (plugin.hasPluginChannelCUI(getName())) {
player.sendPluginMessage(plugin, WorldEditPlugin.CUI_PLUGIN_CHANNEL, send.getBytes(CUIChannelListener.UTF_8_CHARSET)); player.sendPluginMessage(plugin, WorldEditPlugin.CUI_PLUGIN_CHANNEL, send.getBytes(CUIChannelListener.UTF_8_CHARSET));
} else { } else {
player.sendRawMessage("\u00A75\u00A76\u00A74\u00A75" + send); if (plugin.getLocalConfiguration().enableWECUI) {
player.sendRawMessage("\u00A75\u00A76\u00A74\u00A75" + send);
}
} }
} }
@Override @Override
public void dispatchCUIHandshake() { public void dispatchCUIHandshake() {
if (!plugin.hasPluginChannelCUI(getName())) { if (!plugin.hasPluginChannelCUI(getName()) && plugin.getLocalConfiguration().enableWECUI) {
player.sendRawMessage("\u00A75\u00A76\u00A74\u00A75"); player.sendRawMessage("\u00A75\u00A76\u00A74\u00A75");
player.sendRawMessage("\u00A74\u00A75\u00A73\u00A74"); player.sendRawMessage("\u00A74\u00A75\u00A73\u00A74");
} }

View File

@ -77,6 +77,7 @@ public class PropertiesConfiguration extends LocalConfiguration {
} }
profile = getBool("profile", profile); profile = getBool("profile", profile);
enableWECUI = getBool("enable-wecui-handshake", enableWECUI);
disallowedBlocks = getIntSet("disallowed-blocks", defaultDisallowedBlocks); disallowedBlocks = getIntSet("disallowed-blocks", defaultDisallowedBlocks);
defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit); defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit);
maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit); maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit);

View File

@ -59,6 +59,7 @@ public class YAMLConfiguration extends LocalConfiguration {
showFirstUseVersion = false; showFirstUseVersion = false;
profile = config.getBoolean("debug", profile); profile = config.getBoolean("debug", profile);
enableWECUI = config.getBoolean("enable-wecui-handshake", enableWECUI);
wandItem = config.getInt("wand-item", wandItem); wandItem = config.getInt("wand-item", wandItem);
defaultChangeLimit = Math.max(-1, config.getInt( defaultChangeLimit = Math.max(-1, config.getInt(
"limits.max-blocks-changed.default", defaultChangeLimit)); "limits.max-blocks-changed.default", defaultChangeLimit));

View File

@ -61,4 +61,5 @@ wand-item: 271
shell-save-type: shell-save-type:
no-double-slash: false no-double-slash: false
no-op-permissions: false no-op-permissions: false
debug: false debug: false
enable-wecui-handshake: true