From 870532802120496889e2f001857390382c8c8120 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Mon, 16 May 2011 13:36:54 +0200 Subject: [PATCH] Added warning in case allow-flight is set to false in server.properties. --- plugin.yml | 2 +- src/cc/co/evenprime/bukkit/nocheat/NoCheat.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin.yml b/plugin.yml index 2cb0ffcd..5d97a8da 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,7 +3,7 @@ name: NoCheat author: Evenprime main: cc.co.evenprime.bukkit.nocheat.NoCheat -version: 0.9.6 +version: 0.9.7 commands: nocheat: diff --git a/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java b/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java index 6fa922eb..b3ae1dea 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java +++ b/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java @@ -1,6 +1,7 @@ package cc.co.evenprime.bukkit.nocheat; +import java.io.File; import java.util.logging.Level; import java.util.logging.Logger; @@ -26,6 +27,7 @@ import com.ensifera.animosity.craftirc.CraftIRC; import com.nijikokun.bukkit.Permissions.Permissions; import com.nijiko.permissions.PermissionHandler; import org.bukkit.plugin.Plugin; +import org.bukkit.util.config.Configuration; /** * @@ -62,6 +64,7 @@ public class NoCheat extends JavaPlugin { // CraftIRC 2.x, if available private CraftIRC irc; + private boolean allowFlightSet; public NoCheat() { @@ -129,6 +132,9 @@ public class NoCheat extends JavaPlugin { // parse the nocheat.yml config file setupConfig(); + if(allowFlightSet && movingCheck.isActive()) { + Logger.getLogger("Minecraft").warning( "[NoCheat] you have set \"allow-flight=false\" in your server.properties file. That builtin anti-flying-mechanism will likely conflict with this plugin. Please consider deactivating it by setting it to \"true\""); + } PluginDescriptionFile pdfFile = this.getDescription(); @@ -298,6 +304,10 @@ public class NoCheat extends JavaPlugin { this.config = new NoCheatConfiguration(this); else this.config.config(); + + Configuration serverConfig = new Configuration(new File("server.properties")); + + allowFlightSet = serverConfig.getBoolean("allow-flight", false); }