summaryrefslogtreecommitdiffstats
path: root/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java
diff options
context:
space:
mode:
authormd_5 <md_5@bigpond.com>2012-03-12 10:39:36 +1100
committermd_5 <md_5@bigpond.com>2012-03-12 10:39:36 +1100
commit78f4820876f42f7b50bf88f64afd45bee939e4e4 (patch)
tree317cd3bcc63fc9e86a6efbcb5e13a50ed9efbaaf /EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java
parent26409058467e9f34aa65a08df3c68a58129d22ba (diff)
downloadEssentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar
Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar.gz
Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar.lz
Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar.xz
Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.zip
Initial formatted and slightly tweaked version of @evenprime 's NoCheat. Will be intergrated into the main Essentials as soon as possible
Diffstat (limited to 'EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java')
-rw-r--r--EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java
new file mode 100644
index 000000000..26c8d0f6d
--- /dev/null
+++ b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java
@@ -0,0 +1,37 @@
+package com.earth2me.essentials.anticheat.checks.blockplace;
+
+import com.earth2me.essentials.anticheat.ConfigItem;
+import com.earth2me.essentials.anticheat.actions.types.ActionList;
+import com.earth2me.essentials.anticheat.config.ConfPaths;
+import com.earth2me.essentials.anticheat.config.NoCheatConfiguration;
+import com.earth2me.essentials.anticheat.config.Permissions;
+
+
+/**
+ * Configurations specific for the "BlockPlace" checks Every world gets one of these assigned to it, or if a world
+ * doesn't get it's own, it will use the "global" version
+ *
+ */
+public class BlockPlaceConfig implements ConfigItem
+{
+ public final boolean reachCheck;
+ public final double reachDistance;
+ public final ActionList reachActions;
+ public final boolean directionCheck;
+ public final ActionList directionActions;
+ public final long directionPenaltyTime;
+ public final double directionPrecision;
+
+ public BlockPlaceConfig(NoCheatConfiguration data)
+ {
+
+ reachCheck = data.getBoolean(ConfPaths.BLOCKPLACE_REACH_CHECK);
+ reachDistance = 535D / 100D;
+ reachActions = data.getActionList(ConfPaths.BLOCKPLACE_REACH_ACTIONS, Permissions.BLOCKPLACE_REACH);
+
+ directionCheck = data.getBoolean(ConfPaths.BLOCKPLACE_DIRECTION_CHECK);
+ directionPenaltyTime = data.getInt(ConfPaths.BLOCKPLACE_DIRECTION_PENALTYTIME);
+ directionPrecision = ((double)data.getInt(ConfPaths.BLOCKPLACE_DIRECTION_PRECISION)) / 100D;
+ directionActions = data.getActionList(ConfPaths.BLOCKPLACE_DIRECTION_ACTIONS, Permissions.BLOCKPLACE_DIRECTION);
+ }
+}