From fcc0a169af2821c00e5167e3d8e2f98157c491e6 Mon Sep 17 00:00:00 2001 From: NeatMonster Date: Thu, 5 Apr 2012 22:17:41 +0200 Subject: [PATCH] + Added Rei's Minimap and MinecraftAutoMap disabling codes + Added a toggle in the configuration to allow client mods + Added an explanation about the WaterWalk check in the instructions --- Instructions.txt | 122 ++++++++++++------ plugin.yml | 44 ++++--- .../neatmonster/nocheatplus/NoCheatPlus.java | 18 ++- .../nocheatplus/config/ConfPaths.java | 2 + .../config/DefaultConfiguration.java | 2 + .../nocheatplus/config/Permissions.java | 83 ++++++------ 6 files changed, 180 insertions(+), 91 deletions(-) diff --git a/Instructions.txt b/Instructions.txt index 3bfcb734..85c55cdd 100644 --- a/Instructions.txt +++ b/Instructions.txt @@ -136,6 +136,24 @@ By default all these permissions are set to "op", which means players with OP-status have all permissions, unless you change it. + +-------------------------------------------------------------------------------- +----------------------- Permissions for ADMINISTRATION ------------------------- +-------------------------------------------------------------------------------- + + - nocheatplus.admin.chatlog + The player will receive log messages that are directed at the "ingame chat" + as a normal chat message ingame. + + - nocheatplus.admin.commands + The player gets access to some of the "/nocheatplus" commands + + - nocheatplus.admin.reload + In combination with "nocheatplus.admin.commands", the player gets access to the + "/nocheatplus reload" command, which will cause NoCheatPlus to reread its config + files. + + -------------------------------------------------------------------------------- --------------------------- Permissions for CHECKS ----------------------------- -------------------------------------------------------------------------------- @@ -145,7 +163,7 @@ having one of these nodes means he will NOT be checked. Players without the permission node will be checked. - Example: A player has permission "NoCheatPlus.checks.moving.morepackets". That + Example: A player has permission "nocheatplus.checks.moving.morepackets". That means he is allowed to use that hack/cheat because NoCheatPlus won't check/stop it. @@ -253,39 +271,35 @@ -------------------------------------------------------------------------------- ---------------------------- Permissions for CHECKS ----------------------------- +---------------------------- Permissions for MODS ------------------------------ -------------------------------------------------------------------------------- - - nocheatplus.zombe.fly + + - nocheatplus.mods.zombe.fly Don't prevent the player from using Zombe's fly mod + + - nocheatplus.mods.zombe.xray + Don't prevent the player from using Zombe's noclip - - nocheatplus.zombe.cheats + - nocheatplus.mods.zombe.cheats Don't prevent the player from using all other Zombe's cheats - - nocheatplus.cjb.fly + - nocheatplus.mods.cjb.fly Don't prevent the player from using CJB's fly mod - - nocheatplus.cjb.xray - Don't prevent the player from using CJB's Xray + - nocheatplus.mods.cjb.xray + Don't prevent the player from using CJB's xray - - nocheatplus.cjb.minimap + - nocheatplus.mods.cjb.minimap Don't prevent the player from using CJB's minimap + + - nocheatplus.mods.rei.cave + Don't prevent the player from using Rei's Minimap's cave mode + + - nocheatplus.mods.rei.radar + Don't prevent the player from using Rei's Minimap's radar - --------------------------------------------------------------------------------- ------------------------ Permissions for ADMINISTRATION ------------------------- --------------------------------------------------------------------------------- - - - nocheatplus.admin.chatlog - The player will receive log messages that are directed at the "ingame chat" - as a normal chat message ingame. - - - nocheatplus.admin.commands - The player gets access to some of the "/NoCheatPlus" commands - - - nocheatplus.admin.reload - In combination with "NoCheatPlus.admin.commands", the player gets access to the - "/NoCheatPlus reload" command, which will cause NoCheatPlus to reread its config - files. + - nocheatplus.mods.mcautomap + Don't prevent the player from using all Minecraft AutoMap's cheats -------------------------------------------------------------------------------- @@ -295,15 +309,20 @@ NoCheatPlus defines "parent" nodes for all permissions already for you. That means you can use one of the following: - - NoCheatPlus - - NoCheatPlus.admin - - NoCheatPlus.checks - - NoCheatPlus.checks.moving - - NoCheatPlus.checks.blockbreak - - NoCheatPlus.checks.blockplace - - NoCheatPlus.checks.inventory - - NoCheatPlus.checks.chat - - NoCheatPlus.checks.fight + - nocheatplus + - nocheatplus.admin + - nocheatplus.checks + - nocheatplus.checks.moving + - nocheatplus.checks.blockbreak + - nocheatplus.checks.blockplace + - nocheatplus.checks.inventory + - nocheatplus.checks.chat + - nocheatplus.checks.fight + - nocheatplus.mods + - nocheatplus.mods.zombe + - nocheatplus.mods.cjb + - nocheatplus.mods.rei + - nocheatplus.mods.mcautomap To give a player all the permissions that start with that permission node. @@ -314,11 +333,11 @@ You can exclude a specific player from getting logged by appending ".silent" to the relevant permission node of the specific check. E.g. - - NoCheatPlus.checks.moving.nofall.silent + - nocheatplus.checks.moving.nofall.silent will prevent NoCheatPlus from recording log messages for that player for the "nofall" check, while still executing all other actions as usual. These silent - permissions won't show up elsewhere, e.g. when using the "NoCheatPlus permlist" + permissions won't show up elsewhere, e.g. when using the "nocheatplus permlist" command. @@ -347,13 +366,13 @@ prefix: Will be placed in front of many log messages. To get colors, use "&" - followed by a number (0-9) or a letter (A-F). E.g. "&7NC&f:" would produce - the letters NC in red (&7), followed by black text (&f). + followed by a number (0-9) or a letter (A-F). E.g. "&7NCP&f:" would produce + the letters NCP in red (&7), followed by black text (&f). filename: The name of the logfile that NoCheatPlus will use to log its messages. The - default name is "NoCheatPlus.log", but you can use a different one if you want + default name is "nocheatplus.log", but you can use a different one if you want to. file: @@ -371,7 +390,7 @@ Should NoCheatPlus display messages in the ingame chat? Set to false if you don't want NoCheatPlus to show messages ingame. The messages will only be seen - by players with the permission node "NoCheatPlus.admin.chatlog" or if you don't + by players with the permission node "nocheatplus.admin.chatlog" or if you don't use a permissions plugin, by players who are OP. showactivechecks: @@ -604,6 +623,31 @@ teleport the player back to a location where he was ~1 second before ("cancel" his movement). The Violation Level VL is the number of packets that the player sent beyond the expected amount + + 3) WATERWALK: + + The waterwalk check is used to prevent players from walking on water using + a client dedicated to griefing (this mode is usually called Jesus mod). + Firstly, it'll check if the player's move is valid (not only moving the X + and Z axes but also on the Y axis and, of course, if the player is near the + surface (most of the griefing client set the player 0.3 blocks under the + water surface). Secondly, it'll make sure the player is using the borders + of the block to climb outside the water (it prevents players using griefing + clients to simply jump multiple times over the water). + + active: + Should players be checked for this kind of cheating. If you are not + interested in players that cheat that way, set this to false. It is a + good idea to have this active, because player won't be able to cross + easily the oceans. + + actions: + What should happen if a player is considered to be cheating by walking + on water. Default is to log messages and to prevent the player from moving + ("cancel" his last movement). The Violation Level (VL) of this check is + the distance between the player and the surface or how far away he is from + the normal position if a player climbing a block. The VL increases with + every failed check and slowly decreases for every passed check. ---------------------------- BLOCKBREAK Subsection ----------------------------- diff --git a/plugin.yml b/plugin.yml index 9623b4c2..d2603ab0 100644 --- a/plugin.yml +++ b/plugin.yml @@ -94,19 +94,33 @@ permissions: description: Allow a player to eat food faster than normally possible nocheatplus.checks.inventory.instantbow: description: Allow a player to charge his bow faster than usual - nocheatplus.zombe: - description: Allow the player to use Zombe's cheats (including fly, Xray, etc.) + nocheatplus.mods: + description: Allow the player to use all the client mods children: - nocheatplus.zombe.fly: - description: Allow the player to use Zombe's fly - nocheatplus.zombe.cheats: - description: Allow the player to use Zombe's cheats (including Xray, etc.) - nocheatplus.cjb: - description: Allow the player to use CJB's cheats (including fly, Xray, minimap, etc.) - children: - nocheatplus.cjb.fly: - description: Allow the player to use CJB's fly - nocheatplus.cjb.xray: - description: Allow the player to use CJB's Xray - nocheatplus.cjb.minimap: - description: Allow the player to use CJB's minimap \ No newline at end of file + nocheatplus.mods.zombe: + description: Allow the player to use all Zombe's cheats + children: + nocheatplus.mods.zombe.fly: + description: Allow the player to use Zombe's fly mod + nocheatplus.mods.zombe.noclip: + description: Allow the player to use Zombe's noclip + nocheatplus.mods.zombe.cheats: + description: Allow the player to use all other Zombe's cheats + nocheatplus.mods.cjb: + description: Allow the player to use all CJB's cheats + children: + nocheatplus.mods.cjb.fly: + description: Allow the player to use CJB's fly mod + nocheatplus.mods.cjb.xray: + description: Allow the player to use CJB's xray + nocheatplus.mods.cjb.minimap: + description: Allow the player to use CJB's minimap + nocheatplus.mods.rei: + description: Allow the player to use all Rei's Minimap's cheats + children: + nocheatplus.mods.rei.cave: + description: Allow the player to use Rei's cave mode + nocheatplus.mods.rei.radar: + description: Allow the player to use Rei's radar + nocheatplus.mods.mcautomap: + description: Allow the player to use all Minecraft AutoMap's cheats diff --git a/src/me/neatmonster/nocheatplus/NoCheatPlus.java b/src/me/neatmonster/nocheatplus/NoCheatPlus.java index 372ad286..0ca63695 100644 --- a/src/me/neatmonster/nocheatplus/NoCheatPlus.java +++ b/src/me/neatmonster/nocheatplus/NoCheatPlus.java @@ -13,6 +13,7 @@ import me.neatmonster.nocheatplus.checks.fight.FightCheckListener; import me.neatmonster.nocheatplus.checks.inventory.InventoryCheckListener; import me.neatmonster.nocheatplus.checks.moving.MovingCheckListener; import me.neatmonster.nocheatplus.command.CommandHandler; +import me.neatmonster.nocheatplus.config.ConfPaths; import me.neatmonster.nocheatplus.config.ConfigurationCacheStore; import me.neatmonster.nocheatplus.config.ConfigurationManager; import me.neatmonster.nocheatplus.config.NoCheatPlusConfiguration; @@ -187,22 +188,37 @@ public class NoCheatPlus extends JavaPlugin implements Listener { ignoreCancelled = true, priority = EventPriority.MONITOR) public void onPlayerJoin(final PlayerJoinEvent event) { final Player player = event.getPlayer(); + if (conf.getConfigurationCacheForWorld(player.getWorld().getName()).getConfiguration() + .getBoolean(ConfPaths.ALLOW_CLIENT_MODS)) + return; String message = ""; // Disable Zombe's fly mod if (!player.hasPermission(Permissions.ZOMBE_FLY)) message = message + "§f §f §1 §0 §2 §4"; + // Disable Zombe's noclip + if (!player.hasPermission(Permissions.ZOMBE_NOCLIP)) + message = message + "§f §f §4 §0 §9 §6"; // Disable Zombe's cheats if (!player.hasPermission(Permissions.ZOMBE_CHEATS)) message = message + "§f §f §2 §0 §4 §8"; // Disable CJB's fly mod if (!player.hasPermission(Permissions.CJB_FLY)) message = message + "§3 §9 §2 §0 §0 §1"; - // Disable CJB's XRay + // Disable CJB's xray if (!player.hasPermission(Permissions.CJB_XRAY)) message = message + "§3 §9 §2 §0 §0 §2"; // Disable CJB's minimap if (!player.hasPermission(Permissions.CJB_MINIMAP)) message = message + "§3 §9 §2 §0 §0 §3"; + // Disable Rei's Minimap's cave mode + if (!player.hasPermission(Permissions.REI_CAVE)) + message = message + "§0§0§1§e§f"; + // Disable Rei's Minimap's radar + if (!player.hasPermission(Permissions.REI_RADAR)) + message = message + "§0§0§2§3§4§5§6§7§e§f"; + // Disable Minecraft AutoMap's cheats + if (!player.hasPermission(Permissions.MC_AUTOMAP)) + message = message + "§0§0§1§2§3§4§5§6§7§8§f§e"; player.sendMessage(message); } diff --git a/src/me/neatmonster/nocheatplus/config/ConfPaths.java b/src/me/neatmonster/nocheatplus/config/ConfPaths.java index e3f782fd..90b6dab9 100644 --- a/src/me/neatmonster/nocheatplus/config/ConfPaths.java +++ b/src/me/neatmonster/nocheatplus/config/ConfPaths.java @@ -146,6 +146,8 @@ public abstract class ConfPaths { public static final String FIGHT_INSTANTHEAL_CHECK = FIGHT_INSTANTHEAL + "active"; public final static String FIGHT_INSTANTHEAL_ACTIONS = FIGHT_INSTANTHEAL + "actions"; + public final static String ALLOW_CLIENT_MODS = "allowclientmods"; + public final static String STRINGS = "strings"; } diff --git a/src/me/neatmonster/nocheatplus/config/DefaultConfiguration.java b/src/me/neatmonster/nocheatplus/config/DefaultConfiguration.java index 1bc7c589..a82c68fe 100644 --- a/src/me/neatmonster/nocheatplus/config/DefaultConfiguration.java +++ b/src/me/neatmonster/nocheatplus/config/DefaultConfiguration.java @@ -125,6 +125,8 @@ public class DefaultConfiguration extends NoCheatPlusConfiguration { set(ConfPaths.FIGHT_INSTANTHEAL_CHECK, true); set(ConfPaths.FIGHT_INSTANTHEAL_ACTIONS, "log:fheal:1:1:if cancel"); + set(ConfPaths.ALLOW_CLIENT_MODS, false); + set(ConfPaths.STRINGS + ".drop", "[player] failed [check]: Tried to drop more items than allowed. VL [violations]"); set(ConfPaths.STRINGS + ".moveshort", "[player] failed [check]. VL [violations]"); diff --git a/src/me/neatmonster/nocheatplus/config/Permissions.java b/src/me/neatmonster/nocheatplus/config/Permissions.java index 9ef796df..0370b8da 100644 --- a/src/me/neatmonster/nocheatplus/config/Permissions.java +++ b/src/me/neatmonster/nocheatplus/config/Permissions.java @@ -9,10 +9,41 @@ public class Permissions { private static final String NOCHEATPLUS = "nocheatplus"; private static final String ADMIN = NOCHEATPLUS + ".admin"; private static final String CHECKS = NOCHEATPLUS + ".checks"; - private static final String ZOMBE = NOCHEATPLUS + ".zombe"; - private static final String CJB = NOCHEATPLUS + ".cjb"; + private static final String MODS = NOCHEATPLUS + ".mods"; - public static final String MOVING = CHECKS + ".moving"; + /** ADMIN **/ + public static final String ADMIN_CHATLOG = ADMIN + ".chatlog"; + public static final String ADMIN_COMMANDS = ADMIN + ".commands"; + public static final String ADMIN_RELOAD = ADMIN + ".reload"; + + /** CHECKS **/ + private static final String BLOCKBREAK = CHECKS + ".blockbreak"; + public static final String BLOCKBREAK_REACH = BLOCKBREAK + ".reach"; + public static final String BLOCKBREAK_DIRECTION = BLOCKBREAK + ".direction"; + public static final String BLOCKBREAK_NOSWING = BLOCKBREAK + ".noswing"; + + private static final String BLOCKPLACE = CHECKS + ".blockplace"; + public static final String BLOCKPLACE_REACH = BLOCKPLACE + ".reach"; + public static final String BLOCKPLACE_DIRECTION = BLOCKPLACE + ".direction"; + + private static final String CHAT = CHECKS + ".chat"; + public static final String CHAT_SPAM = CHAT + ".spam"; + public static final String CHAT_COLOR = CHAT + ".color"; + + private static final String FIGHT = CHECKS + ".fight"; + public static final String FIGHT_DIRECTION = FIGHT + ".direction"; + public static final String FIGHT_NOSWING = FIGHT + ".noswing"; + public static final String FIGHT_REACH = FIGHT + ".reach"; + public static final String FIGHT_SPEED = FIGHT + ".speed"; + public static final String FIGHT_GODMODE = FIGHT + ".godmode"; + public static final String FIGHT_INSTANTHEAL = FIGHT + ".instantheal"; + + private static final String INVENTORY = CHECKS + ".inventory"; + public static final String INVENTORY_DROP = INVENTORY + ".drop"; + public static final String INVENTORY_INSTANTBOW = INVENTORY + ".instantbow"; + public static final String INVENTORY_INSTANTEAT = INVENTORY + ".instanteat"; + + private static final String MOVING = CHECKS + ".moving"; public static final String MOVING_RUNFLY = MOVING + ".runfly"; public static final String MOVING_SWIMMING = MOVING + ".swimming"; public static final String MOVING_SNEAKING = MOVING + ".sneaking"; @@ -21,42 +52,22 @@ public class Permissions { public static final String MOVING_MOREPACKETS = MOVING + ".morepackets"; public static final String MOVING_WATERWALK = MOVING + ".waterwalk"; - public static final String BLOCKBREAK = CHECKS + ".blockbreak"; - public static final String BLOCKBREAK_REACH = BLOCKBREAK + ".reach"; - public static final String BLOCKBREAK_DIRECTION = BLOCKBREAK + ".direction"; - public static final String BLOCKBREAK_NOSWING = BLOCKBREAK + ".noswing"; - - public static final String BLOCKPLACE = CHECKS + ".blockplace"; - public static final String BLOCKPLACE_REACH = BLOCKPLACE + ".reach"; - public static final String BLOCKPLACE_DIRECTION = BLOCKPLACE + ".direction"; - - public static final String CHAT = CHECKS + ".chat"; - public static final String CHAT_SPAM = CHAT + ".spam"; - public static final String CHAT_COLOR = CHAT + ".color"; - - public static final String FIGHT = CHECKS + ".fight"; - public static final String FIGHT_DIRECTION = FIGHT + ".direction"; - public static final String FIGHT_NOSWING = FIGHT + ".noswing"; - public static final String FIGHT_REACH = FIGHT + ".reach"; - public static final String FIGHT_SPEED = FIGHT + ".speed"; - public static final String FIGHT_GODMODE = FIGHT + ".godmode"; - public static final String FIGHT_INSTANTHEAL = FIGHT + ".instantheal"; - - public static final String ADMIN_CHATLOG = ADMIN + ".chatlog"; - public static final String ADMIN_COMMANDS = ADMIN + ".commands"; - public static final String ADMIN_RELOAD = ADMIN + ".reload"; - - public static final String INVENTORY = CHECKS + ".inventory"; - 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 ZOMBE_FLY = ZOMBE + ".fly"; - public static final String ZOMBE_CHEATS = ZOMBE + ".cheats"; - + /** MODS **/ + private static final String CJB = MODS + ".cjb"; public static final String CJB_FLY = CJB + ".fly"; public static final String CJB_XRAY = CJB + ".xray"; public static final String CJB_MINIMAP = CJB + ".minimap"; + public static final String MC_AUTOMAP = MODS + ".mcautomap"; + + private static final String REI = MODS + ".rei"; + public static final String REI_CAVE = REI + ".cave"; + public static final String REI_RADAR = REI + ".radar"; + + private static final String ZOMBE = MODS + ".zombe"; + public static final String ZOMBE_FLY = ZOMBE + ".fly"; + public static final String ZOMBE_NOCLIP = ZOMBE + ".noclip"; + public static final String ZOMBE_CHEATS = ZOMBE + ".cheats"; + private Permissions() {} }