summaryrefslogtreecommitdiffstats
path: root/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/inventory/InventoryConfig.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/inventory/InventoryConfig.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/inventory/InventoryConfig.java')
-rw-r--r--EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/inventory/InventoryConfig.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/inventory/InventoryConfig.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/inventory/InventoryConfig.java
new file mode 100644
index 000000000..44f59ff04
--- /dev/null
+++ b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/inventory/InventoryConfig.java
@@ -0,0 +1,40 @@
+package com.earth2me.essentials.anticheat.checks.inventory;
+
+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 "Inventory" 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 InventoryConfig implements ConfigItem
+{
+ public final boolean dropCheck;
+ public final long dropTimeFrame;
+ public final int dropLimit;
+ public final ActionList dropActions;
+ public final boolean bowCheck;
+ public final ActionList bowActions;
+ public final boolean eatCheck;
+ public final ActionList eatActions;
+
+ public InventoryConfig(NoCheatConfiguration data)
+ {
+
+ dropCheck = data.getBoolean(ConfPaths.INVENTORY_DROP_CHECK);
+ dropTimeFrame = data.getInt(ConfPaths.INVENTORY_DROP_TIMEFRAME) * 1000;
+ dropLimit = data.getInt(ConfPaths.INVENTORY_DROP_LIMIT);
+ dropActions = data.getActionList(ConfPaths.INVENTORY_DROP_ACTIONS, Permissions.INVENTORY_DROP);
+
+ bowCheck = data.getBoolean(ConfPaths.INVENTORY_INSTANTBOW_CHECK);
+ bowActions = data.getActionList(ConfPaths.INVENTORY_INSTANTBOW_ACTIONS, Permissions.INVENTORY_INSTANTBOW);
+
+ eatCheck = data.getBoolean(ConfPaths.INVENTORY_INSTANTEAT_CHECK);
+ eatActions = data.getActionList(ConfPaths.INVENTORY_INSTANTEAT_ACTIONS, Permissions.INVENTORY_INSTANTEAT);
+ }
+}