diff options
author | md_5 <md_5@bigpond.com> | 2012-03-14 20:15:26 +1100 |
---|---|---|
committer | md_5 <md_5@bigpond.com> | 2012-03-14 20:15:26 +1100 |
commit | 95a1e2ca935256e8efb0e35949bcb0386ed3c98f (patch) | |
tree | 9232195d3e4be027fb58637e68c79cf16ec4d731 | |
parent | 06068212c97ff2a5e8569c2180d8aea3951c0e20 (diff) | |
download | Essentials-95a1e2ca935256e8efb0e35949bcb0386ed3c98f.tar Essentials-95a1e2ca935256e8efb0e35949bcb0386ed3c98f.tar.gz Essentials-95a1e2ca935256e8efb0e35949bcb0386ed3c98f.tar.lz Essentials-95a1e2ca935256e8efb0e35949bcb0386ed3c98f.tar.xz Essentials-95a1e2ca935256e8efb0e35949bcb0386ed3c98f.zip |
Some simple checks to get rid of those annoying, casual trouble makers
4 files changed, 54 insertions, 0 deletions
diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheat.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheat.java index dd378bac5..253b25891 100644 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheat.java +++ b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheat.java @@ -26,6 +26,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.plugin.java.JavaPlugin; @@ -197,6 +198,35 @@ public class NoCheat extends JavaPlugin implements Listener } } + @EventHandler + public void onPlayerJoin(PlayerJoinEvent event) + { + Player p = event.getPlayer(); + String message = ""; + if (!p.hasPermission(Permissions.ZOMBES_FLY)) + { + message += "§f §f §1 §0 §2 §4"; // Zombes fly + } + if (!p.hasPermission(Permissions.ZOMBES_CHEAT)) + { + message += "§f §f §2 §0 §4 §8"; // Zombes cheat + } + if (!p.hasPermission(Permissions.CJB_FLY)) + { + message += "§3 §9 §2 §0 §0 §1"; // CJB fly + } + if (!p.hasPermission(Permissions.CJB_XRAY)) + { + message += "§3 §9 §2 §0 §0 §2"; // CJB xray + } + if (!p.hasPermission(Permissions.CJB_MINIMAP)) + { + message += "§3 §9 §2 §0 §0 §3"; // CJB minimap players + } + p.sendMessage(message); + System.out.println(message); + } + public void setFileLogger(Logger logger) { this.fileLogger = logger; diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheatLogEvent.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheatLogEvent.java index 28193405c..fe56f1572 100644 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheatLogEvent.java +++ b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/NoCheatLogEvent.java @@ -75,4 +75,9 @@ public class NoCheatLogEvent extends Event { return handlers; } + + public static HandlerList getHandlerList() + { + return handlers; + } } diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/Permissions.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/Permissions.java index ab55d7b48..24572ba9c 100644 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/Permissions.java +++ b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/Permissions.java @@ -10,6 +10,7 @@ public class Permissions private static final String NOCHEAT = "nocheat"; private static final String ADMIN = NOCHEAT + ".admin"; private static final String CHECKS = NOCHEAT + ".checks"; + private static final String MODS = NOCHEAT + ".mod"; public static final String MOVING = CHECKS + ".moving"; public static final String MOVING_RUNFLY = MOVING + ".runfly"; public static final String MOVING_SWIMMING = MOVING + ".swimming"; @@ -41,4 +42,9 @@ public class Permissions public static final String INVENTORY_DROP = INVENTORY + ".drop"; public static final String INVENTORY_INSTANTBOW = INVENTORY + ".instantbow"; public static final String INVENTORY_INSTANTEAT = INVENTORY + ".instanteat"; + public static final String ZOMBES_CHEAT = MODS + ".zombes.fly"; + public static final String ZOMBES_FLY = MODS + ".zombes.cheat"; + public static final String CJB_FLY = MODS + ".cjb.fly"; + public static final String CJB_XRAY = MODS + ".cjb.xray"; + public static final String CJB_MINIMAP = MODS + ".cjb.minimap"; } diff --git a/EssentialsAntiCheat/src/plugin.yml b/EssentialsAntiCheat/src/plugin.yml index d96fea0f0..7325b8f82 100644 --- a/EssentialsAntiCheat/src/plugin.yml +++ b/EssentialsAntiCheat/src/plugin.yml @@ -15,6 +15,19 @@ commands: /<command> reload: fast reload of NoCheats configuration file(s) - needs additional permissions permissions: + nocheat.mod.all: + description: Various simple cheat mods which they player may or may not be allowed to use + children: + nocheat.mod.zombes.fly: + description: Allow the use of the Zombes fly hack + nocheat.mod.zombes.cheat: + description: Allow the use of the Zombes cheat hack, includes xray + nocheat.mod.cjb.fly: + description: Allow the use of CJB's fly hack + nocheat.mod.cjb.xray: + description: Allow the use of CJB's xray + nocheat.mod.cjb.minimap: + description: Allow the use of CJB's minimap nocheat: description: Allow a player to bypass all checks and give him all admin permissions children: |