diff --git a/src/com/redstoner/misc/Main.java b/src/com/redstoner/misc/Main.java index 65227e7..3a80b88 100644 --- a/src/com/redstoner/misc/Main.java +++ b/src/com/redstoner/misc/Main.java @@ -7,11 +7,12 @@ import com.redstoner.coremods.debugger.Debugger; import com.redstoner.coremods.moduleLoader.ModuleLoader; import com.redstoner.modules.adminchat.Adminchat; import com.redstoner.modules.chatgroups.Chatgroups; +import com.redstoner.modules.warn.Warn; /** Main class. Duh. * * @author Pepich */ -@Version(major = 1, minor = 1, revision = 0, compatible = -1) +@Version(major = 1, minor = 1, revision = 1, compatible = -1) public class Main extends JavaPlugin { public static JavaPlugin plugin; @@ -25,6 +26,7 @@ public class Main extends JavaPlugin // TODO: Add modules (this also loads them if necessary) ModuleLoader.addModule(Adminchat.class); ModuleLoader.addModule(Chatgroups.class); + ModuleLoader.addModule(Warn.class); // And enable them ModuleLoader.enableModules(); } diff --git a/src/com/redstoner/modules/warn/Warn.java b/src/com/redstoner/modules/warn/Warn.java new file mode 100644 index 0000000..2fb95df --- /dev/null +++ b/src/com/redstoner/modules/warn/Warn.java @@ -0,0 +1,57 @@ +package com.redstoner.modules.warn; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.nemez.cmdmgr.Command; +import com.redstoner.annotations.Version; +import com.redstoner.misc.Utils; +import com.redstoner.modules.Module; + +@Version(major = 1, minor = 0, revision = 0, compatible = 1) +public class Warn implements Module +{ + @Command(hook = "warn") + public void warn_normal(CommandSender sender) + { + String name = ((Player) sender).getDisplayName(); + Utils.broadcast(null, "§2= Lag incoming! - §9" + name, null); + } + + @Command(hook = "warnp") + public void warn_possible(CommandSender sender) + { + String name = ((Player) sender).getDisplayName(); + Utils.broadcast(null, "§2= Possible lag incoming! - §9" + name, null); + } + + @Override + public boolean enabled() + { + return true; + } + + // @noformat + @Override + public String getCommandString() + { + return "command warn {\n" + + " [empty] {\n" + + " run warn;\n" + + " type player;\n" + + " help Warns other players about definite lag;\n" + + " perm utils.warn;\n" + + " }\n" + + "}\n" + + "\n" + + "command warnp {\n" + + " [empty] {\n" + + " run warnp;\n" + + " type player;\n" + + " help Warns other players about possible lag;\n" + + " perm utils.warn;\n" + + " }\n" + + "}"; + } + //@format +}