mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-02 13:57:49 +01:00
Class renamed to be more descriptive
This commit is contained in:
parent
b6154df02a
commit
6d9675cb6a
@ -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;
|
||||
|
@ -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<String> getActiveChecks(ConfigurationCacheStore cc) {
|
||||
LinkedList<String> s = new LinkedList<String>();
|
||||
|
||||
CCBlockBreak bb = BlockBreakCheck.getConfig(cc);
|
||||
BlockBreakConfig bb = BlockBreakCheck.getConfig(cc);
|
||||
|
||||
if(bb.check && bb.directionCheck)
|
||||
s.add("blockbreak.direction");
|
||||
|
@ -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);
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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<String> getActiveChecks(ConfigurationCacheStore cc) {
|
||||
LinkedList<String> s = new LinkedList<String>();
|
||||
|
||||
CCBlockPlace bp = BlockPlaceCheck.getConfig(cc);
|
||||
BlockPlaceConfig bp = BlockPlaceCheck.getConfig(cc);
|
||||
|
||||
if(bp.check && bp.reachCheck)
|
||||
s.add("blockplace.reach");
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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<String> getActiveChecks(ConfigurationCacheStore cc) {
|
||||
LinkedList<String> s = new LinkedList<String>();
|
||||
|
||||
CCChat c = ChatCheck.getConfig(cc);
|
||||
ChatConfig c = ChatCheck.getConfig(cc);
|
||||
if(c.check && c.spamCheck)
|
||||
s.add("chat.spam");
|
||||
if(c.check && c.colorCheck)
|
||||
|
@ -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);
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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<String> getActiveChecks(ConfigurationCacheStore cc) {
|
||||
LinkedList<String> s = new LinkedList<String>();
|
||||
|
||||
CCFight f = FightCheck.getConfig(cc);
|
||||
FightConfig f = FightCheck.getConfig(cc);
|
||||
|
||||
if(f.check && f.directionCheck)
|
||||
s.add("fight.direction");
|
||||
|
@ -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);
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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<String> getActiveChecks(ConfigurationCacheStore cc) {
|
||||
LinkedList<String> s = new LinkedList<String>();
|
||||
|
||||
CCInventory i = InventoryCheck.getConfig(cc);
|
||||
InventoryConfig i = InventoryCheck.getConfig(cc);
|
||||
if(i.check && i.dropCheck)
|
||||
s.add("inventory.dropCheck");
|
||||
return s;
|
||||
|
@ -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);
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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<String> getActiveChecks(ConfigurationCacheStore cc) {
|
||||
LinkedList<String> s = new LinkedList<String>();
|
||||
|
||||
CCMoving m = MovingCheck.getConfig(cc);
|
||||
MovingConfig m = MovingCheck.getConfig(cc);
|
||||
|
||||
if(m.check) {
|
||||
if(m.runflyCheck) {
|
||||
|
@ -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);
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user