diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheck.java index 5fd0765a..51c39af1 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheck.java @@ -14,9 +14,9 @@ public abstract class BlockBreakCheck extends Check { super(plugin, id, name, permission); } - public abstract boolean check(NoCheatPlayer player, BlockBreakData data, CCBlockBreak cc); + public abstract boolean check(NoCheatPlayer player, BlockBreakData data, BlockBreakConfig cc); - public abstract boolean isEnabled(CCBlockBreak cc); + public abstract boolean isEnabled(BlockBreakConfig cc); public static BlockBreakData getData(DataStore base) { BlockBreakData data = base.get(id); @@ -27,10 +27,10 @@ public abstract class BlockBreakCheck extends Check { return data; } - public static CCBlockBreak getConfig(ConfigurationCacheStore cache) { - CCBlockBreak config = cache.get(id); + public static BlockBreakConfig getConfig(ConfigurationCacheStore cache) { + BlockBreakConfig config = cache.get(id); if(config == null) { - config = new CCBlockBreak(cache.getConfiguration()); + config = new BlockBreakConfig(cache.getConfiguration()); cache.set(id, config); } return config; diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheckListener.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheckListener.java index 1b9969a2..3f9bc26f 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheckListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakCheckListener.java @@ -45,7 +45,7 @@ public class BlockBreakCheckListener implements Listener, EventManager { boolean cancelled = false; final NoCheatPlayer player = plugin.getPlayer(event.getPlayer()); - final CCBlockBreak cc = BlockBreakCheck.getConfig(player.getConfigurationStore()); + final BlockBreakConfig cc = BlockBreakCheck.getConfig(player.getConfigurationStore()); if(!cc.check || player.hasPermission(Permissions.BLOCKBREAK)) { return; @@ -63,6 +63,7 @@ public class BlockBreakCheckListener implements Listener, EventManager { return; } + // Go through all "blockbreak" checks for(BlockBreakCheck check : checks) { // If it should be executed, do it if(!cancelled && check.isEnabled(cc) && !player.hasPermission(check.getPermission())) { @@ -112,7 +113,7 @@ public class BlockBreakCheckListener implements Listener, EventManager { public List getActiveChecks(ConfigurationCacheStore cc) { LinkedList s = new LinkedList(); - CCBlockBreak bb = BlockBreakCheck.getConfig(cc); + BlockBreakConfig bb = BlockBreakCheck.getConfig(cc); if(bb.check && bb.directionCheck) s.add("blockbreak.direction"); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/CCBlockBreak.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakConfig.java similarity index 92% rename from src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/CCBlockBreak.java rename to src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakConfig.java index ca2f5410..6551db0d 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/CCBlockBreak.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/BlockBreakConfig.java @@ -9,7 +9,7 @@ import cc.co.evenprime.bukkit.nocheat.config.util.ActionList; * Every world gets one of these assigned to it. * */ -public class CCBlockBreak implements ConfigItem { +public class BlockBreakConfig implements ConfigItem { public final boolean check; public final boolean checkinstabreakblocks; @@ -23,7 +23,7 @@ public class CCBlockBreak implements ConfigItem { public final boolean noswingCheck; public final ActionList noswingActions; - public CCBlockBreak(Configuration data) { + public BlockBreakConfig(Configuration data) { check = data.getBoolean(Configuration.BLOCKBREAK_CHECK); reachCheck = data.getBoolean(Configuration.BLOCKBREAK_REACH_CHECK); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/DirectionCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/DirectionCheck.java index 7ba126da..9b0f5070 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/DirectionCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/DirectionCheck.java @@ -20,7 +20,7 @@ public class DirectionCheck extends BlockBreakCheck { super(plugin, "blockbreak.direction", Permissions.BLOCKBREAK_DIRECTION); } - public boolean check(final NoCheatPlayer player, final BlockBreakData data, final CCBlockBreak ccblockbreak) { + public boolean check(final NoCheatPlayer player, final BlockBreakData data, final BlockBreakConfig ccblockbreak) { final SimpleLocation brokenBlock = data.brokenBlockLocation; final boolean isInstaBreak = data.instaBrokenBlockLocation.equals(brokenBlock); @@ -72,7 +72,7 @@ public class DirectionCheck extends BlockBreakCheck { return cancel; } - public boolean isEnabled(CCBlockBreak cc) { + public boolean isEnabled(BlockBreakConfig cc) { return cc.directionCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/NoswingCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/NoswingCheck.java index 3ef2c0cd..2000136a 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/NoswingCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/NoswingCheck.java @@ -13,7 +13,7 @@ public class NoswingCheck extends BlockBreakCheck { super(plugin, "blockbreak.noswing", Permissions.BLOCKBREAK_NOSWING); } - public boolean check(NoCheatPlayer player, BlockBreakData data, CCBlockBreak cc) { + public boolean check(NoCheatPlayer player, BlockBreakData data, BlockBreakConfig cc) { boolean cancel = false; @@ -32,7 +32,7 @@ public class NoswingCheck extends BlockBreakCheck { return cancel; } - public boolean isEnabled(CCBlockBreak cc) { + public boolean isEnabled(BlockBreakConfig cc) { return cc.noswingCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/ReachCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/ReachCheck.java index 879d9c80..06b5c277 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/ReachCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockbreak/ReachCheck.java @@ -20,7 +20,7 @@ public class ReachCheck extends BlockBreakCheck { super(plugin, "blockbreak.reach", Permissions.BLOCKBREAK_REACH); } - public boolean check(NoCheatPlayer player, BlockBreakData data, CCBlockBreak cc) { + public boolean check(NoCheatPlayer player, BlockBreakData data, BlockBreakConfig cc) { boolean cancel = false; @@ -45,7 +45,7 @@ public class ReachCheck extends BlockBreakCheck { return cancel; } - public boolean isEnabled(CCBlockBreak cc) { + public boolean isEnabled(BlockBreakConfig cc) { return cc.reachCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheck.java index 3a22e649..c1e261fa 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheck.java @@ -20,9 +20,9 @@ public abstract class BlockPlaceCheck extends Check { super(plugin, id, name, permission); } - public abstract boolean check(NoCheatPlayer player, BlockPlaceData data, CCBlockPlace cc); + public abstract boolean check(NoCheatPlayer player, BlockPlaceData data, BlockPlaceConfig cc); - public abstract boolean isEnabled(CCBlockPlace cc); + public abstract boolean isEnabled(BlockPlaceConfig cc); @Override public String getParameter(ParameterName wildcard, NoCheatPlayer player) { @@ -57,10 +57,10 @@ public abstract class BlockPlaceCheck extends Check { return data; } - public static CCBlockPlace getConfig(ConfigurationCacheStore cache) { - CCBlockPlace config = cache.get(id); + public static BlockPlaceConfig getConfig(ConfigurationCacheStore cache) { + BlockPlaceConfig config = cache.get(id); if(config == null) { - config = new CCBlockPlace(cache.getConfiguration()); + config = new BlockPlaceConfig(cache.getConfiguration()); cache.set(id, config); } return config; diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheckListener.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheckListener.java index c00832eb..3bb98c99 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheckListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceCheckListener.java @@ -44,7 +44,7 @@ public class BlockPlaceCheckListener implements Listener, EventManager { boolean cancelled = false; final NoCheatPlayer player = plugin.getPlayer(event.getPlayer()); - final CCBlockPlace cc = BlockPlaceCheck.getConfig(player.getConfigurationStore()); + final BlockPlaceConfig cc = BlockPlaceCheck.getConfig(player.getConfigurationStore()); if(!cc.check || player.hasPermission(Permissions.BLOCKPLACE)) { return; @@ -69,7 +69,7 @@ public class BlockPlaceCheckListener implements Listener, EventManager { public List getActiveChecks(ConfigurationCacheStore cc) { LinkedList s = new LinkedList(); - CCBlockPlace bp = BlockPlaceCheck.getConfig(cc); + BlockPlaceConfig bp = BlockPlaceCheck.getConfig(cc); if(bp.check && bp.reachCheck) s.add("blockplace.reach"); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/CCBlockPlace.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceConfig.java similarity index 89% rename from src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/CCBlockPlace.java rename to src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceConfig.java index 3522ac1f..0c1013be 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/CCBlockPlace.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/BlockPlaceConfig.java @@ -7,7 +7,7 @@ import cc.co.evenprime.bukkit.nocheat.config.util.ActionList; /** * */ -public class CCBlockPlace implements ConfigItem { +public class BlockPlaceConfig implements ConfigItem { public final boolean check; @@ -20,7 +20,7 @@ public class CCBlockPlace implements ConfigItem { public final long directionPenaltyTime; public final double directionPrecision; - public CCBlockPlace(Configuration data) { + public BlockPlaceConfig(Configuration data) { check = data.getBoolean(Configuration.BLOCKPLACE_CHECK); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/DirectionCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/DirectionCheck.java index 8c619ea4..0d6861f7 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/DirectionCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/DirectionCheck.java @@ -15,7 +15,7 @@ public class DirectionCheck extends BlockPlaceCheck { super(plugin, "blockplace.direction", Permissions.BLOCKPLACE_DIRECTION); } - public boolean check(NoCheatPlayer player, BlockPlaceData data, CCBlockPlace cc) { + public boolean check(NoCheatPlayer player, BlockPlaceData data, BlockPlaceConfig cc) { boolean cancel = false; @@ -86,7 +86,7 @@ public class DirectionCheck extends BlockPlaceCheck { } @Override - public boolean isEnabled(CCBlockPlace cc) { + public boolean isEnabled(BlockPlaceConfig cc) { return cc.directionCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/ReachCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/ReachCheck.java index 6be7c31a..ca0779b5 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/ReachCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/blockplace/ReachCheck.java @@ -20,7 +20,7 @@ public class ReachCheck extends BlockPlaceCheck { super(plugin, "blockplace.reach", Permissions.BLOCKPLACE_REACH); } - public boolean check(NoCheatPlayer player, BlockPlaceData data, CCBlockPlace cc) { + public boolean check(NoCheatPlayer player, BlockPlaceData data, BlockPlaceConfig cc) { boolean cancel = false; @@ -46,7 +46,7 @@ public class ReachCheck extends BlockPlaceCheck { } @Override - public boolean isEnabled(CCBlockPlace cc) { + public boolean isEnabled(BlockPlaceConfig cc) { return cc.reachCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java index 50a04a9a..bfcae273 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java @@ -15,9 +15,9 @@ public abstract class ChatCheck extends Check { super(plugin, id, name, permission); } - public abstract boolean check(NoCheatPlayer player, ChatData data, CCChat cc); + public abstract boolean check(NoCheatPlayer player, ChatData data, ChatConfig cc); - public abstract boolean isEnabled(CCChat cc); + public abstract boolean isEnabled(ChatConfig cc); @Override public String getParameter(ParameterName wildcard, NoCheatPlayer player) { @@ -37,10 +37,10 @@ public abstract class ChatCheck extends Check { return data; } - public static CCChat getConfig(ConfigurationCacheStore cache) { - CCChat config = cache.get(id); + public static ChatConfig getConfig(ConfigurationCacheStore cache) { + ChatConfig config = cache.get(id); if(config == null) { - config = new CCChat(cache.getConfiguration()); + config = new ChatConfig(cache.getConfiguration()); cache.set(id, config); } return config; diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheckListener.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheckListener.java index b3c1cbac..da5f55a6 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheckListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheckListener.java @@ -42,7 +42,7 @@ public class ChatCheckListener implements Listener, EventManager { boolean cancelled = false; final NoCheatPlayer player = plugin.getPlayer(event.getPlayer()); - final CCChat cc = ChatCheck.getConfig(player.getConfigurationStore()); + final ChatConfig cc = ChatCheck.getConfig(player.getConfigurationStore()); if(!cc.check || player.hasPermission(Permissions.CHAT)) { return; @@ -70,7 +70,7 @@ public class ChatCheckListener implements Listener, EventManager { public List getActiveChecks(ConfigurationCacheStore cc) { LinkedList s = new LinkedList(); - CCChat c = ChatCheck.getConfig(cc); + ChatConfig c = ChatCheck.getConfig(cc); if(c.check && c.spamCheck) s.add("chat.spam"); if(c.check && c.colorCheck) diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/CCChat.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatConfig.java similarity index 91% rename from src/cc/co/evenprime/bukkit/nocheat/checks/chat/CCChat.java rename to src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatConfig.java index 311d3373..4a28997e 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/CCChat.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatConfig.java @@ -6,7 +6,7 @@ import cc.co.evenprime.bukkit.nocheat.ConfigItem; import cc.co.evenprime.bukkit.nocheat.config.Configuration; import cc.co.evenprime.bukkit.nocheat.config.util.ActionList; -public class CCChat implements ConfigItem { +public class ChatConfig implements ConfigItem { public final boolean check; public final boolean spamCheck; @@ -17,7 +17,7 @@ public class CCChat implements ConfigItem { public final boolean colorCheck; public final ActionList colorActions; - public CCChat(Configuration data) { + public ChatConfig(Configuration data) { check = data.getBoolean(Configuration.CHAT_CHECK); spamCheck = data.getBoolean(Configuration.CHAT_SPAM_CHECK); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java index 7a7d660a..976eac6f 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java @@ -12,7 +12,7 @@ public class ColorCheck extends ChatCheck { super(plugin, "chat.color", Permissions.CHAT_COLOR); } - public boolean check(NoCheatPlayer player, ChatData data, CCChat cc) { + public boolean check(NoCheatPlayer player, ChatData data, ChatConfig cc) { if(data.message.matches(".*\247.*")) { @@ -32,7 +32,7 @@ public class ColorCheck extends ChatCheck { } @Override - public boolean isEnabled(CCChat cc) { + public boolean isEnabled(ChatConfig cc) { return cc.colorCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/SpamCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/SpamCheck.java index 87eebac4..bd536b45 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/SpamCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/SpamCheck.java @@ -13,7 +13,7 @@ public class SpamCheck extends ChatCheck { super(plugin, "chat.spam", Permissions.CHAT_SPAM); } - public boolean check(NoCheatPlayer player, ChatData data, CCChat cc) { + public boolean check(NoCheatPlayer player, ChatData data, ChatConfig cc) { boolean cancel = false; // Maybe it's a command and on the whitelist @@ -50,7 +50,7 @@ public class SpamCheck extends ChatCheck { } @Override - public boolean isEnabled(CCChat cc) { + public boolean isEnabled(ChatConfig cc) { return cc.spamCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/DirectionCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/DirectionCheck.java index 1c67c15e..580e1677 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/DirectionCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/DirectionCheck.java @@ -18,7 +18,7 @@ public class DirectionCheck extends FightCheck { super(plugin, "fight.direction", Permissions.FIGHT_DIRECTION); } - public boolean check(NoCheatPlayer player, FightData data, CCFight cc) { + public boolean check(NoCheatPlayer player, FightData data, FightConfig cc) { boolean cancel = false; @@ -77,7 +77,7 @@ public class DirectionCheck extends FightCheck { } @Override - public boolean isEnabled(CCFight cc) { + public boolean isEnabled(FightConfig cc) { return cc.directionCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheck.java index d3e9dbbe..e4e34906 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheck.java @@ -18,9 +18,9 @@ public abstract class FightCheck extends Check { super(plugin, id, name, permission); } - public abstract boolean check(NoCheatPlayer player, FightData data, CCFight cc); + public abstract boolean check(NoCheatPlayer player, FightData data, FightConfig cc); - public abstract boolean isEnabled(CCFight cc); + public abstract boolean isEnabled(FightConfig cc); public static FightData getData(DataStore base) { FightData data = base.get(id); @@ -31,10 +31,10 @@ public abstract class FightCheck extends Check { return data; } - public static CCFight getConfig(ConfigurationCacheStore cache) { - CCFight config = cache.get(id); + public static FightConfig getConfig(ConfigurationCacheStore cache) { + FightConfig config = cache.get(id); if(config == null) { - config = new CCFight(cache.getConfiguration()); + config = new FightConfig(cache.getConfiguration()); cache.set(id, config); } return config; diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheckListener.java b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheckListener.java index 4ab8ea55..ef4abaa9 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheckListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightCheckListener.java @@ -49,7 +49,7 @@ public class FightCheckListener implements Listener, EventManager { final Player damager = (Player) event.getDamager(); final NoCheatPlayer player = plugin.getPlayer(damager); - final CCFight cc = FightCheck.getConfig(player.getConfigurationStore()); + final FightConfig cc = FightCheck.getConfig(player.getConfigurationStore()); if(!cc.check || player.hasPermission(Permissions.FIGHT)) { return; @@ -103,7 +103,7 @@ public class FightCheckListener implements Listener, EventManager { public List getActiveChecks(ConfigurationCacheStore cc) { LinkedList s = new LinkedList(); - CCFight f = FightCheck.getConfig(cc); + FightConfig f = FightCheck.getConfig(cc); if(f.check && f.directionCheck) s.add("fight.direction"); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/CCFight.java b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightConfig.java similarity index 90% rename from src/cc/co/evenprime/bukkit/nocheat/checks/fight/CCFight.java rename to src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightConfig.java index c2e2a005..83831bc3 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/CCFight.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/FightConfig.java @@ -4,7 +4,7 @@ import cc.co.evenprime.bukkit.nocheat.ConfigItem; import cc.co.evenprime.bukkit.nocheat.config.Configuration; import cc.co.evenprime.bukkit.nocheat.config.util.ActionList; -public class CCFight implements ConfigItem { +public class FightConfig implements ConfigItem { public final boolean check; public final boolean directionCheck; @@ -14,7 +14,7 @@ public class CCFight implements ConfigItem { public final boolean noswingCheck; public final ActionList noswingActions; - public CCFight(Configuration data) { + public FightConfig(Configuration data) { check = data.getBoolean(Configuration.FIGHT_CHECK); directionCheck = data.getBoolean(Configuration.FIGHT_DIRECTION_CHECK); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/NoswingCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/NoswingCheck.java index 1c1b6969..5c627842 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/fight/NoswingCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/fight/NoswingCheck.java @@ -13,7 +13,7 @@ public class NoswingCheck extends FightCheck { super(plugin, "fight.noswing", Permissions.FIGHT_NOSWING); } - public boolean check(NoCheatPlayer player, FightData data, CCFight cc) { + public boolean check(NoCheatPlayer player, FightData data, FightConfig cc) { boolean cancel = false; @@ -33,7 +33,7 @@ public class NoswingCheck extends FightCheck { } @Override - public boolean isEnabled(CCFight cc) { + public boolean isEnabled(FightConfig cc) { return cc.noswingCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/DropCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/DropCheck.java index db963f4d..3c112b0a 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/DropCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/DropCheck.java @@ -13,7 +13,7 @@ public class DropCheck extends InventoryCheck { } @Override - public boolean check(NoCheatPlayer player, InventoryData data, CCInventory cc) { + public boolean check(NoCheatPlayer player, InventoryData data, InventoryConfig cc) { boolean cancel = false; @@ -43,7 +43,7 @@ public class DropCheck extends InventoryCheck { } @Override - public boolean isEnabled(CCInventory cc) { + public boolean isEnabled(InventoryConfig cc) { return cc.dropCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheck.java index f17916a9..68cda0e4 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheck.java @@ -14,9 +14,9 @@ public abstract class InventoryCheck extends Check { super(plugin, id, name, permission); } - public abstract boolean check(NoCheatPlayer player, InventoryData data, CCInventory cc); + public abstract boolean check(NoCheatPlayer player, InventoryData data, InventoryConfig cc); - public abstract boolean isEnabled(CCInventory cc); + public abstract boolean isEnabled(InventoryConfig cc); public static InventoryData getData(DataStore base) { InventoryData data = base.get(id); @@ -27,10 +27,10 @@ public abstract class InventoryCheck extends Check { return data; } - public static CCInventory getConfig(ConfigurationCacheStore cache) { - CCInventory config = cache.get(id); + public static InventoryConfig getConfig(ConfigurationCacheStore cache) { + InventoryConfig config = cache.get(id); if(config == null) { - config = new CCInventory(cache.getConfiguration()); + config = new InventoryConfig(cache.getConfiguration()); cache.set(id, config); } return config; diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheckListener.java b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheckListener.java index 6ce9afc0..ae624128 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheckListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryCheckListener.java @@ -35,7 +35,7 @@ public class InventoryCheckListener implements Listener, EventManager { return; final NoCheatPlayer player = plugin.getPlayer(event.getPlayer()); - final CCInventory cc = InventoryCheck.getConfig(player.getConfigurationStore()); + final InventoryConfig cc = InventoryCheck.getConfig(player.getConfigurationStore()); if(!cc.check || player.hasPermission(Permissions.INVENTORY) || player.isDead()) { return; @@ -62,7 +62,7 @@ public class InventoryCheckListener implements Listener, EventManager { public List getActiveChecks(ConfigurationCacheStore cc) { LinkedList s = new LinkedList(); - CCInventory i = InventoryCheck.getConfig(cc); + InventoryConfig i = InventoryCheck.getConfig(cc); if(i.check && i.dropCheck) s.add("inventory.dropCheck"); return s; diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/CCInventory.java b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryConfig.java similarity index 86% rename from src/cc/co/evenprime/bukkit/nocheat/checks/inventory/CCInventory.java rename to src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryConfig.java index 129ab782..997adae8 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/CCInventory.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/inventory/InventoryConfig.java @@ -4,7 +4,7 @@ import cc.co.evenprime.bukkit.nocheat.ConfigItem; import cc.co.evenprime.bukkit.nocheat.config.Configuration; import cc.co.evenprime.bukkit.nocheat.config.util.ActionList; -public class CCInventory implements ConfigItem { +public class InventoryConfig implements ConfigItem { public final boolean check; @@ -13,7 +13,7 @@ public class CCInventory implements ConfigItem { public final int dropLimit; public final ActionList dropActions; - public CCInventory(Configuration data) { + public InventoryConfig(Configuration data) { check = data.getBoolean(Configuration.INVENTORY_CHECK); dropCheck = data.getBoolean(Configuration.INVENTORY_DROP_CHECK); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/FlyingCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/FlyingCheck.java index af09da31..33dc612b 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/FlyingCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/FlyingCheck.java @@ -21,7 +21,7 @@ public class FlyingCheck extends MovingCheck { private static final double creativeSpeed = 0.60D; - public PreciseLocation check(NoCheatPlayer player, MovingData data, CCMoving ccmoving) { + public PreciseLocation check(NoCheatPlayer player, MovingData data, MovingConfig ccmoving) { final PreciseLocation setBack = data.runflySetBackPoint; final PreciseLocation from = data.from; @@ -117,7 +117,7 @@ public class FlyingCheck extends MovingCheck { } @Override - public boolean isEnabled(CCMoving moving) { + public boolean isEnabled(MovingConfig moving) { return moving.allowFlying && moving.runflyCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MorePacketsCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MorePacketsCheck.java index 8127f0e3..1086d660 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MorePacketsCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MorePacketsCheck.java @@ -38,7 +38,7 @@ public class MorePacketsCheck extends MovingCheck { * 8. reset packetCounter, wait for next 20 ticks to pass by. * */ - public PreciseLocation check(NoCheatPlayer player, MovingData data, CCMoving cc) { + public PreciseLocation check(NoCheatPlayer player, MovingData data, MovingConfig cc) { PreciseLocation newToLocation = null; @@ -99,7 +99,7 @@ public class MorePacketsCheck extends MovingCheck { } @Override - public boolean isEnabled(CCMoving moving) { + public boolean isEnabled(MovingConfig moving) { return moving.morePacketsCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheck.java index c7530842..1ba7693e 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheck.java @@ -23,9 +23,9 @@ public abstract class MovingCheck extends Check { * @param event * @return */ - public abstract PreciseLocation check(final NoCheatPlayer player, MovingData data, CCMoving cc); + public abstract PreciseLocation check(final NoCheatPlayer player, MovingData data, MovingConfig cc); - public abstract boolean isEnabled(CCMoving moving); + public abstract boolean isEnabled(MovingConfig moving); @Override public String getParameter(ParameterName wildcard, NoCheatPlayer player) { @@ -54,10 +54,10 @@ public abstract class MovingCheck extends Check { return data; } - public static CCMoving getConfig(ConfigurationCacheStore cache) { - CCMoving config = cache.get(id); + public static MovingConfig getConfig(ConfigurationCacheStore cache) { + MovingConfig config = cache.get(id); if(config == null) { - config = new CCMoving(cache.getConfiguration()); + config = new MovingConfig(cache.getConfiguration()); cache.set(id, config); } return config; diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java index 9f289f58..4e60044c 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingCheckListener.java @@ -106,7 +106,7 @@ public class MovingCheckListener implements Listener, EventManager { return; } - final CCMoving cc = MovingCheck.getConfig(player.getConfigurationStore()); + final MovingConfig cc = MovingCheck.getConfig(player.getConfigurationStore()); final MovingData data = MovingCheck.getData(player.getDataStore()); @@ -196,7 +196,7 @@ public class MovingCheckListener implements Listener, EventManager { public List getActiveChecks(ConfigurationCacheStore cc) { LinkedList s = new LinkedList(); - CCMoving m = MovingCheck.getConfig(cc); + MovingConfig m = MovingCheck.getConfig(cc); if(m.check) { if(m.runflyCheck) { diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/CCMoving.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingConfig.java similarity index 95% rename from src/cc/co/evenprime/bukkit/nocheat/checks/moving/CCMoving.java rename to src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingConfig.java index 9b27f021..65bebba5 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/CCMoving.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingConfig.java @@ -9,7 +9,7 @@ import cc.co.evenprime.bukkit.nocheat.config.util.ActionList; * assigned to it. * */ -public class CCMoving implements ConfigItem { +public class MovingConfig implements ConfigItem { public final boolean check; @@ -38,7 +38,7 @@ public class CCMoving implements ConfigItem { public final double flyingHeightLimit; - public CCMoving(Configuration data) { + public MovingConfig(Configuration data) { check = data.getBoolean(Configuration.MOVING_CHECK); identifyCreativeMode = data.getBoolean(Configuration.MOVING_IDENTIFYCREATIVEMODE); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java index eb140c54..6c365f05 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java @@ -23,7 +23,7 @@ public class NoFallCheck extends MovingCheck { * Calculate if and how much the player "failed" this check. * */ - public PreciseLocation check(NoCheatPlayer player, MovingData data, CCMoving cc) { + public PreciseLocation check(NoCheatPlayer player, MovingData data, MovingConfig cc) { // If the player is serverside in creative mode, we have to stop here to // avoid hurting him when he switches back to "normal" mode @@ -104,7 +104,7 @@ public class NoFallCheck extends MovingCheck { } @Override - public boolean isEnabled(CCMoving moving) { + public boolean isEnabled(MovingConfig moving) { return moving.nofallCheck; } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunflyCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunflyCheck.java index 0b5f64d2..59c1c754 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunflyCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunflyCheck.java @@ -21,7 +21,7 @@ public class RunflyCheck extends MovingCheck { } @Override - public PreciseLocation check(NoCheatPlayer player, MovingData data, CCMoving cc) { + public PreciseLocation check(NoCheatPlayer player, MovingData data, MovingConfig cc) { if(player.hasPermission(Permissions.MOVING_RUNFLY)) { // If the player doesn't get checked for movement @@ -42,7 +42,7 @@ public class RunflyCheck extends MovingCheck { } @Override - public boolean isEnabled(CCMoving moving) { + public boolean isEnabled(MovingConfig moving) { return moving.runflyCheck; } } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunningCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunningCheck.java index 49eec812..c6923419 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunningCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/RunningCheck.java @@ -33,7 +33,7 @@ public class RunningCheck extends MovingCheck { this.noFallCheck = new NoFallCheck(plugin); } - public PreciseLocation check(NoCheatPlayer player, MovingData data, CCMoving cc) { + public PreciseLocation check(NoCheatPlayer player, MovingData data, MovingConfig cc) { // Some shortcuts: final PreciseLocation setBack = data.runflySetBackPoint; @@ -131,7 +131,7 @@ public class RunningCheck extends MovingCheck { * Calculate how much the player failed this check * */ - private double checkHorizontal(final NoCheatPlayer player, final MovingData data, final boolean isSwimming, final double totalDistance, final CCMoving cc) { + private double checkHorizontal(final NoCheatPlayer player, final MovingData data, final boolean isSwimming, final double totalDistance, final MovingConfig cc) { // How much further did the player move than expected?? double distanceAboveLimit = 0.0D; @@ -201,7 +201,7 @@ public class RunningCheck extends MovingCheck { * Calculate if and how much the player "failed" this check. * */ - private double checkVertical(final MovingData data, final boolean fromOnGround, final boolean toOnGround, final CCMoving cc) { + private double checkVertical(final MovingData data, final boolean fromOnGround, final boolean toOnGround, final MovingConfig cc) { // How much higher did the player move than expected?? double distanceAboveLimit = 0.0D; @@ -221,7 +221,7 @@ public class RunningCheck extends MovingCheck { } @Override - public boolean isEnabled(CCMoving moving) { + public boolean isEnabled(MovingConfig moving) { return moving.runflyCheck && !moving.allowFlying; }