mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-10-06 18:37:29 +02:00
Refactoring, code cleanup, moved executionHistories to "data"
This commit is contained in:
parent
0b04b7d43f
commit
a0024d0737
@ -12,6 +12,7 @@ import org.bukkit.permissions.Permission;
|
|||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.actions.ActionManager;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.ConfigurationManager;
|
import cc.co.evenprime.bukkit.nocheat.config.ConfigurationManager;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
@ -46,6 +47,7 @@ public class NoCheat extends JavaPlugin {
|
|||||||
private LogManager log;
|
private LogManager log;
|
||||||
private DataManager data;
|
private DataManager data;
|
||||||
private PerformanceManager performance;
|
private PerformanceManager performance;
|
||||||
|
private ActionManager action;
|
||||||
|
|
||||||
private final List<EventManager> eventManagers = new LinkedList<EventManager>();
|
private final List<EventManager> eventManagers = new LinkedList<EventManager>();
|
||||||
|
|
||||||
@ -89,6 +91,9 @@ public class NoCheat extends JavaPlugin {
|
|||||||
// Then set up the performance counters
|
// Then set up the performance counters
|
||||||
this.performance = new PerformanceManager();
|
this.performance = new PerformanceManager();
|
||||||
|
|
||||||
|
// Then set up the Action Manager
|
||||||
|
this.action = new ActionManager(this);
|
||||||
|
|
||||||
// Then set up the event listeners
|
// Then set up the event listeners
|
||||||
eventManagers.add(new PlayerMoveEventManager(this));
|
eventManagers.add(new PlayerMoveEventManager(this));
|
||||||
eventManagers.add(new PlayerTeleportEventManager(this));
|
eventManagers.add(new PlayerTeleportEventManager(this));
|
||||||
@ -114,7 +119,7 @@ public class NoCheat extends JavaPlugin {
|
|||||||
lastIngamesecondDuration = 1000;
|
lastIngamesecondDuration = 1000;
|
||||||
lastIngamesecondTime = time;
|
lastIngamesecondTime = time;
|
||||||
ingameseconds++;
|
ingameseconds++;
|
||||||
|
|
||||||
// Check if some data is outdated now and let it be removed
|
// Check if some data is outdated now and let it be removed
|
||||||
getDataManager().cleanDataMap();
|
getDataManager().cleanDataMap();
|
||||||
}
|
}
|
||||||
@ -144,6 +149,10 @@ public class NoCheat extends JavaPlugin {
|
|||||||
return performance;
|
return performance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionManager getActionManager() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
public int getIngameSeconds() {
|
public int getIngameSeconds() {
|
||||||
return ingameseconds;
|
return ingameseconds;
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.actions;
|
package cc.co.evenprime.bukkit.nocheat.actions;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.history.ActionHistory;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.Action;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.Action;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.ConsolecommandAction;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.ConsolecommandAction;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.LogAction;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.LogAction;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.SpecialAction;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.SpecialAction;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.data.ActionData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,34 +19,32 @@ import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|||||||
* @author Evenprime
|
* @author Evenprime
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ActionExecutor {
|
public class ActionManager {
|
||||||
|
|
||||||
private final Map<Player, ActionHistory> actionHistory = new HashMap<Player, ActionHistory>();
|
private final NoCheat plugin;
|
||||||
private final NoCheat plugin;
|
|
||||||
|
|
||||||
public ActionExecutor(NoCheat plugin) {
|
public ActionManager(NoCheat plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean executeActions(Player player, ActionList actions, int violationLevel, LogData data, ConfigurationCache cc) {
|
public boolean executeActions(Player player, ActionList actions, int violationLevel, LogData data, ActionData history, ConfigurationCache cc) {
|
||||||
|
|
||||||
boolean special = false;
|
boolean special = false;
|
||||||
|
|
||||||
// Always set this here "by hand"
|
// Always set this here "by hand"
|
||||||
data.violationLevel = violationLevel;
|
data.violationLevel = violationLevel;
|
||||||
|
|
||||||
long time = System.currentTimeMillis() / 1000;
|
final long time = System.currentTimeMillis() / 1000;
|
||||||
|
|
||||||
for(Action ac : actions.getActions(violationLevel)) {
|
for(Action ac : actions.getActions(violationLevel)) {
|
||||||
|
|
||||||
if(getHistory(player).executeAction(ac, time)) {
|
if(history.executeAction(ac, time)) {
|
||||||
if(ac instanceof LogAction) {
|
if(ac instanceof LogAction) {
|
||||||
LogAction l = (LogAction) ac;
|
executeLogAction((LogAction) ac, data, cc);
|
||||||
plugin.getLogManager().log(l.level, l.getMessage(data), cc);
|
|
||||||
} else if(ac instanceof SpecialAction) {
|
} else if(ac instanceof SpecialAction) {
|
||||||
special = true;
|
special = true;
|
||||||
} else if(ac instanceof ConsolecommandAction) {
|
} else if(ac instanceof ConsolecommandAction) {
|
||||||
executeConsoleCommand(((ConsolecommandAction) ac).getCommand(data));
|
executeConsoleCommand((ConsolecommandAction) ac, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,19 +52,12 @@ public class ActionExecutor {
|
|||||||
return special;
|
return special;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ActionHistory getHistory(Player player) {
|
private void executeLogAction(LogAction l, LogData data, ConfigurationCache cc) {
|
||||||
|
plugin.getLogManager().log(l.level, l.getMessage(data), cc);
|
||||||
ActionHistory history = actionHistory.get(player);
|
|
||||||
|
|
||||||
if(history == null) {
|
|
||||||
history = new ActionHistory();
|
|
||||||
actionHistory.put(player, history);
|
|
||||||
}
|
|
||||||
|
|
||||||
return history;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeConsoleCommand(String command) {
|
private void executeConsoleCommand(ConsolecommandAction action, LogData data) {
|
||||||
|
String command = action.getCommand(data);
|
||||||
try {
|
try {
|
||||||
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), command);
|
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), command);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
@ -12,13 +12,13 @@ import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
|||||||
public class LogAction extends ActionWithParameters {
|
public class LogAction extends ActionWithParameters {
|
||||||
|
|
||||||
public final LogLevel level;
|
public final LogLevel level;
|
||||||
|
|
||||||
public LogAction(String name, int delay, int repeat, LogLevel level, String message) {
|
public LogAction(String name, int delay, int repeat, LogLevel level, String message) {
|
||||||
super(name, delay, repeat, message);
|
super(name, delay, repeat, message);
|
||||||
|
|
||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessage(LogData ldata) {
|
public String getMessage(LogData ldata) {
|
||||||
return super.getMessage(ldata);
|
return super.getMessage(ldata);
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,9 @@ import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
|||||||
import cc.co.evenprime.bukkit.nocheat.data.BlockBreakData;
|
import cc.co.evenprime.bukkit.nocheat.data.BlockBreakData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main Check class for blockbreak event checking. It will decide which checks
|
* The main Check class for blockbreak event checking. It will decide which
|
||||||
* need to be executed and in which order. It will also precalculate some values
|
* checks need to be executed and in which order. It will also precalculate
|
||||||
* that are needed by multiple checks.
|
* some values that are needed by multiple checks.
|
||||||
*
|
*
|
||||||
* @author Evenprime
|
* @author Evenprime
|
||||||
*
|
*
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.checks.blockbreak;
|
package cc.co.evenprime.bukkit.nocheat.checks.blockbreak;
|
||||||
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.BlockBreakData;
|
import cc.co.evenprime.bukkit.nocheat.data.BlockBreakData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
@ -19,12 +18,10 @@ import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|||||||
*/
|
*/
|
||||||
public class DirectionCheck {
|
public class DirectionCheck {
|
||||||
|
|
||||||
private final ActionExecutor action;
|
private final NoCheat plugin;
|
||||||
private final NoCheat plugin;
|
|
||||||
|
|
||||||
public DirectionCheck(NoCheat plugin) {
|
public DirectionCheck(NoCheat plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean check(Player player, double factor, double x1, double y1, double z1, Block brokenBlock, BlockBreakData data, ConfigurationCache cc) {
|
public boolean check(Player player, double factor, double x1, double y1, double z1, Block brokenBlock, BlockBreakData data, ConfigurationCache cc) {
|
||||||
@ -33,9 +30,9 @@ public class DirectionCheck {
|
|||||||
if(!cc.blockbreak.checkinstabreakblocks && brokenBlock.getLocation().equals(data.instaBrokeBlockLocation)) {
|
if(!cc.blockbreak.checkinstabreakblocks && brokenBlock.getLocation().equals(data.instaBrokeBlockLocation)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean cancel = false;
|
boolean cancel = false;
|
||||||
|
|
||||||
Vector direction = player.getEyeLocation().getDirection();
|
Vector direction = player.getEyeLocation().getDirection();
|
||||||
final double x2 = x1 + 2;
|
final double x2 = x1 + 2;
|
||||||
final double y2 = y1 + 2;
|
final double y2 = y1 + 2;
|
||||||
@ -50,10 +47,10 @@ public class DirectionCheck {
|
|||||||
data.directionViolationLevel += 1;
|
data.directionViolationLevel += 1;
|
||||||
|
|
||||||
// Prepare some event-specific values for logging and custom actions
|
// Prepare some event-specific values for logging and custom actions
|
||||||
LogData ldata = plugin.getDataManager().getData( player).log;
|
LogData ldata = plugin.getDataManager().getData(player).log;
|
||||||
ldata.check = "blockbreak.direction";
|
ldata.check = "blockbreak.direction";
|
||||||
|
|
||||||
cancel = action.executeActions(player, cc.blockbreak.directionActions, (int) data.directionViolationLevel, ldata, cc);
|
cancel = plugin.getActionManager().executeActions(player, cc.blockbreak.directionActions, (int) data.directionViolationLevel, ldata, data.history, cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cancel;
|
return cancel;
|
||||||
|
@ -4,7 +4,6 @@ import org.bukkit.GameMode;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.BlockBreakData;
|
import cc.co.evenprime.bukkit.nocheat.data.BlockBreakData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
@ -18,12 +17,10 @@ import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|||||||
*/
|
*/
|
||||||
public class ReachCheck {
|
public class ReachCheck {
|
||||||
|
|
||||||
private final NoCheat plugin;
|
private final NoCheat plugin;
|
||||||
private final ActionExecutor action;
|
|
||||||
|
|
||||||
public ReachCheck(NoCheat plugin) {
|
public ReachCheck(NoCheat plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean check(Player player, double distance, BlockBreakData data, ConfigurationCache cc) {
|
public boolean check(Player player, double distance, BlockBreakData data, ConfigurationCache cc) {
|
||||||
@ -41,7 +38,7 @@ public class ReachCheck {
|
|||||||
|
|
||||||
ldata.check = "blockbreak.reach";
|
ldata.check = "blockbreak.reach";
|
||||||
ldata.reachdistance = distance;
|
ldata.reachdistance = distance;
|
||||||
cancel = action.executeActions(player, cc.blockbreak.reachActions, (int) data.reachViolationLevel, ldata, cc);
|
cancel = plugin.getActionManager().executeActions(player, cc.blockbreak.reachActions, (int) data.reachViolationLevel, ldata, data.history, cc);
|
||||||
} else {
|
} else {
|
||||||
data.reachViolationLevel *= 0.9D;
|
data.reachViolationLevel *= 0.9D;
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,11 @@ import cc.co.evenprime.bukkit.nocheat.data.BlockPlaceData;
|
|||||||
*/
|
*/
|
||||||
public class BlockPlaceCheck {
|
public class BlockPlaceCheck {
|
||||||
|
|
||||||
private final ReachCheck reachCheck;
|
private final ReachCheck reachCheck;
|
||||||
private final OnLiquidCheck onLiquidCheck;
|
private final OnLiquidCheck onLiquidCheck;
|
||||||
|
|
||||||
public BlockPlaceCheck(NoCheat plugin) {
|
public BlockPlaceCheck(NoCheat plugin) {
|
||||||
|
|
||||||
reachCheck = new ReachCheck(plugin);
|
reachCheck = new ReachCheck(plugin);
|
||||||
onLiquidCheck = new OnLiquidCheck(plugin);
|
onLiquidCheck = new OnLiquidCheck(plugin);
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ public class BlockPlaceCheck {
|
|||||||
if(!cancel && reach) {
|
if(!cancel && reach) {
|
||||||
cancel = reachCheck.check(player, blockPlaced, blockPlacedAgainst, data, cc);
|
cancel = reachCheck.check(player, blockPlaced, blockPlacedAgainst, data, cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!cancel && onliquid) {
|
if(!cancel && onliquid) {
|
||||||
cancel = onLiquidCheck.check(player, blockPlaced, blockPlacedAgainst, data, cc);
|
cancel = onLiquidCheck.check(player, blockPlaced, blockPlacedAgainst, data, cc);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import org.bukkit.block.BlockFace;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.BlockPlaceData;
|
import cc.co.evenprime.bukkit.nocheat.data.BlockPlaceData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
@ -18,12 +17,10 @@ import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|||||||
*/
|
*/
|
||||||
public class OnLiquidCheck {
|
public class OnLiquidCheck {
|
||||||
|
|
||||||
private final NoCheat plugin;
|
private final NoCheat plugin;
|
||||||
private final ActionExecutor action;
|
|
||||||
|
|
||||||
public OnLiquidCheck(NoCheat plugin) {
|
public OnLiquidCheck(NoCheat plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean check(Player player, Block blockPlaced, Block blockPlacedAgainst, BlockPlaceData data, ConfigurationCache cc) {
|
public boolean check(Player player, Block blockPlaced, Block blockPlacedAgainst, BlockPlaceData data, ConfigurationCache cc) {
|
||||||
@ -43,7 +40,7 @@ public class OnLiquidCheck {
|
|||||||
ldata.placed = blockPlaced;
|
ldata.placed = blockPlaced;
|
||||||
ldata.placedAgainst = blockPlacedAgainst;
|
ldata.placedAgainst = blockPlacedAgainst;
|
||||||
|
|
||||||
cancel = action.executeActions(player, cc.blockplace.onliquidActions, (int) data.onliquidViolationLevel, ldata, cc);
|
cancel = plugin.getActionManager().executeActions(player, cc.blockplace.onliquidActions, (int) data.onliquidViolationLevel, ldata, data.history, cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
data.onliquidViolationLevel *= 0.95D; // Reduce level over time
|
data.onliquidViolationLevel *= 0.95D; // Reduce level over time
|
||||||
|
@ -6,7 +6,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.BlockPlaceData;
|
import cc.co.evenprime.bukkit.nocheat.data.BlockPlaceData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
@ -20,12 +19,10 @@ import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|||||||
*/
|
*/
|
||||||
public class ReachCheck {
|
public class ReachCheck {
|
||||||
|
|
||||||
private final NoCheat plugin;
|
private final NoCheat plugin;
|
||||||
private final ActionExecutor action;
|
|
||||||
|
|
||||||
public ReachCheck(NoCheat plugin) {
|
public ReachCheck(NoCheat plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean check(Player player, Block blockPlaced, Block placedAgainstBlock, BlockPlaceData data, ConfigurationCache cc) {
|
public boolean check(Player player, Block blockPlaced, Block placedAgainstBlock, BlockPlaceData data, ConfigurationCache cc) {
|
||||||
@ -51,7 +48,7 @@ public class ReachCheck {
|
|||||||
ldata.check = "blockplace.reach";
|
ldata.check = "blockplace.reach";
|
||||||
ldata.reachdistance = distance;
|
ldata.reachdistance = distance;
|
||||||
|
|
||||||
cancel = action.executeActions(player, cc.blockplace.reachActions, (int) data.reachViolationLevel, ldata, cc);
|
cancel = plugin.getActionManager().executeActions(player, cc.blockplace.reachActions, (int) data.reachViolationLevel, ldata, data.history, cc);
|
||||||
} else {
|
} else {
|
||||||
data.reachViolationLevel *= 0.9D;
|
data.reachViolationLevel *= 0.9D;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package cc.co.evenprime.bukkit.nocheat.checks.chat;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.ChatData;
|
import cc.co.evenprime.bukkit.nocheat.data.ChatData;
|
||||||
@ -16,13 +15,11 @@ import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|||||||
*/
|
*/
|
||||||
public class ChatCheck {
|
public class ChatCheck {
|
||||||
|
|
||||||
private final ActionExecutor action;
|
private final NoCheat plugin;
|
||||||
private final NoCheat plugin;
|
|
||||||
|
|
||||||
public ChatCheck(NoCheat plugin) {
|
public ChatCheck(NoCheat plugin) {
|
||||||
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean check(Player player, String message, ChatData data, ConfigurationCache cc) {
|
public boolean check(Player player, String message, ChatData data, ConfigurationCache cc) {
|
||||||
@ -51,7 +48,7 @@ public class ChatCheck {
|
|||||||
ldata.check = "chat.spam";
|
ldata.check = "chat.spam";
|
||||||
ldata.text = message;
|
ldata.text = message;
|
||||||
|
|
||||||
cancel = action.executeActions(player, cc.chat.spamActions, data.messageCount - cc.chat.spamLimit, ldata, cc);
|
cancel = plugin.getActionManager().executeActions(player, cc.chat.spamActions, data.messageCount - cc.chat.spamLimit, ldata, data.history, cc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.FightData;
|
import cc.co.evenprime.bukkit.nocheat.data.FightData;
|
||||||
@ -19,13 +18,11 @@ import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|||||||
*/
|
*/
|
||||||
public class FightCheck {
|
public class FightCheck {
|
||||||
|
|
||||||
private final ActionExecutor action;
|
private final NoCheat plugin;
|
||||||
private final NoCheat plugin;
|
|
||||||
|
|
||||||
public FightCheck(NoCheat plugin) {
|
public FightCheck(NoCheat plugin) {
|
||||||
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean check(Player player, Entity damagee, FightData data, ConfigurationCache cc) {
|
public boolean check(Player player, Entity damagee, FightData data, ConfigurationCache cc) {
|
||||||
@ -35,7 +32,7 @@ public class FightCheck {
|
|||||||
boolean directionCheck = cc.fight.directionCheck && !player.hasPermission(Permissions.FIGHT_DIRECTION);
|
boolean directionCheck = cc.fight.directionCheck && !player.hasPermission(Permissions.FIGHT_DIRECTION);
|
||||||
|
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
|
|
||||||
if(directionCheck) {
|
if(directionCheck) {
|
||||||
|
|
||||||
Location eyes = player.getEyeLocation();
|
Location eyes = player.getEyeLocation();
|
||||||
@ -50,7 +47,8 @@ public class FightCheck {
|
|||||||
final double p = width / 2 + cc.fight.directionPrecision;
|
final double p = width / 2 + cc.fight.directionPrecision;
|
||||||
final double h = height / 2 + cc.fight.directionPrecision;
|
final double h = height / 2 + cc.fight.directionPrecision;
|
||||||
|
|
||||||
// TODO: Move this into a seperate class to recycle it throughout NoCheat
|
// TODO: Move this into a seperate class to recycle it throughout
|
||||||
|
// NoCheat
|
||||||
final double x1 = ((double) damagee.getLocation().getX()) - eyes.getX() - p;
|
final double x1 = ((double) damagee.getLocation().getX()) - eyes.getX() - p;
|
||||||
final double y1 = ((double) damagee.getLocation().getY()) - eyes.getY() - cc.fight.directionPrecision;
|
final double y1 = ((double) damagee.getLocation().getY()) - eyes.getY() - cc.fight.directionPrecision;
|
||||||
final double z1 = ((double) damagee.getLocation().getZ()) - eyes.getZ() - p;
|
final double z1 = ((double) damagee.getLocation().getZ()) - eyes.getZ() - p;
|
||||||
@ -77,7 +75,7 @@ public class FightCheck {
|
|||||||
LogData ldata = plugin.getDataManager().getData(player).log;
|
LogData ldata = plugin.getDataManager().getData(player).log;
|
||||||
ldata.check = "fight.direction";
|
ldata.check = "fight.direction";
|
||||||
|
|
||||||
cancel = action.executeActions(player, cc.fight.directionActions, (int) data.violationLevel, ldata, cc);
|
cancel = plugin.getActionManager().executeActions(player, cc.fight.directionActions, (int) data.violationLevel, ldata, data.history, cc);
|
||||||
|
|
||||||
if(cancel) {
|
if(cancel) {
|
||||||
// Needed to calculate penalty times
|
// Needed to calculate penalty times
|
||||||
|
@ -6,7 +6,6 @@ import org.bukkit.craftbukkit.entity.CraftPlayer;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
||||||
@ -21,14 +20,12 @@ import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
|||||||
*/
|
*/
|
||||||
public class FlyingCheck {
|
public class FlyingCheck {
|
||||||
|
|
||||||
private final NoCheat plugin;
|
private final NoCheat plugin;
|
||||||
private final ActionExecutor action;
|
|
||||||
|
|
||||||
private static final double creativeSpeed = 0.60D;
|
private static final double creativeSpeed = 0.60D;
|
||||||
|
|
||||||
public FlyingCheck(NoCheat plugin) {
|
public FlyingCheck(NoCheat plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location check(Player player, Location from, Location to, ConfigurationCache cc, MovingData data) {
|
public Location check(Player player, Location from, Location to, ConfigurationCache cc, MovingData data) {
|
||||||
@ -88,7 +85,7 @@ public class FlyingCheck {
|
|||||||
ldata.toLocation = to;
|
ldata.toLocation = to;
|
||||||
ldata.check = "flying/toofast";
|
ldata.check = "flying/toofast";
|
||||||
|
|
||||||
boolean cancel = action.executeActions(player, cc.moving.flyingActions, (int) data.runflyViolationLevel, ldata, cc);
|
boolean cancel = plugin.getActionManager().executeActions(player, cc.moving.flyingActions, (int) data.runflyViolationLevel, ldata, data.history, cc);
|
||||||
|
|
||||||
// Was one of the actions a cancel? Then really do it
|
// Was one of the actions a cancel? Then really do it
|
||||||
if(cancel) {
|
if(cancel) {
|
||||||
|
@ -4,7 +4,6 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
||||||
@ -23,14 +22,11 @@ import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
|||||||
*/
|
*/
|
||||||
public class MorePacketsCheck {
|
public class MorePacketsCheck {
|
||||||
|
|
||||||
private final ActionExecutor action;
|
private final static int packetsPerTimeframe = 22;
|
||||||
|
private final static int bufferLimit = 30;
|
||||||
private final static int packetsPerTimeframe = 22;
|
private final NoCheat plugin;
|
||||||
private final static int bufferLimit = 30;
|
|
||||||
private final NoCheat plugin;
|
|
||||||
|
|
||||||
public MorePacketsCheck(NoCheat plugin) {
|
public MorePacketsCheck(NoCheat plugin) {
|
||||||
this.action = new ActionExecutor(plugin);
|
|
||||||
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
@ -128,7 +124,7 @@ public class MorePacketsCheck {
|
|||||||
ldata.check = "moving/morepackets";
|
ldata.check = "moving/morepackets";
|
||||||
|
|
||||||
boolean cancel = false;
|
boolean cancel = false;
|
||||||
cancel = action.executeActions(player, cc.moving.morePacketsActions, (int) data.morePacketsViolationLevel, ldata, cc);
|
cancel = plugin.getActionManager().executeActions(player, cc.moving.morePacketsActions, (int) data.morePacketsViolationLevel, ldata, data.history, cc);
|
||||||
|
|
||||||
// Only do the cancel if the player didn't change worlds
|
// Only do the cancel if the player didn't change worlds
|
||||||
// inbetween
|
// inbetween
|
||||||
|
@ -15,20 +15,20 @@ import org.bukkit.World;
|
|||||||
*/
|
*/
|
||||||
public class MovingEventHelper {
|
public class MovingEventHelper {
|
||||||
|
|
||||||
private final static double magic = 0.45D;
|
private final static double magic = 0.45D;
|
||||||
private final static double magic2 = 0.55D;
|
private final static double magic2 = 0.55D;
|
||||||
|
|
||||||
// Block types that may need to be treated specially
|
// Block types that may need to be treated specially
|
||||||
private static final int NONSOLID = 1; // 0x00000001
|
private static final int NONSOLID = 1; // 0x00000001
|
||||||
private static final int SOLID = 2; // 0x00000010
|
private static final int SOLID = 2; // 0x00000010
|
||||||
private static final int LIQUID = 4 | NONSOLID; // 0x00000101
|
private static final int LIQUID = 4 | NONSOLID; // 0x00000101
|
||||||
private static final int LADDER = 8 | NONSOLID | SOLID; // 0x00001011
|
private static final int LADDER = 8 | NONSOLID | SOLID; // 0x00001011
|
||||||
private static final int FENCE = 16 | SOLID; // 0x00010000
|
private static final int FENCE = 16 | SOLID; // 0x00010000
|
||||||
private static final int INGROUND = 128;
|
private static final int INGROUND = 128;
|
||||||
private static final int ONGROUND = 256;
|
private static final int ONGROUND = 256;
|
||||||
// Until I can think of a better way to determine if a block is solid or
|
// Until I can think of a better way to determine if a block is solid or
|
||||||
// not, this is what I'll do
|
// not, this is what I'll do
|
||||||
public final int types[] = new int[256];
|
public final int types[] = new int[256];
|
||||||
|
|
||||||
public MovingEventHelper() {
|
public MovingEventHelper() {
|
||||||
// Find and define properties of all blocks
|
// Find and define properties of all blocks
|
||||||
|
@ -4,7 +4,6 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
||||||
@ -18,12 +17,10 @@ import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
|||||||
*/
|
*/
|
||||||
public class NoFallCheck {
|
public class NoFallCheck {
|
||||||
|
|
||||||
private final ActionExecutor action;
|
private final NoCheat plugin;
|
||||||
private final NoCheat plugin;
|
|
||||||
|
|
||||||
public NoFallCheck(NoCheat plugin) {
|
public NoFallCheck(NoCheat plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.action = new ActionExecutor(plugin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,59 +38,63 @@ public class NoFallCheck {
|
|||||||
data.fallDistance = 0F;
|
data.fallDistance = 0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we increased fall height before for no good reason, reduce now by the same amount
|
// If we increased fall height before for no good reason, reduce now by
|
||||||
|
// the same amount
|
||||||
if(player.getFallDistance() > data.lastAddedFallDistance) {
|
if(player.getFallDistance() > data.lastAddedFallDistance) {
|
||||||
player.setFallDistance(player.getFallDistance() - data.lastAddedFallDistance);
|
player.setFallDistance(player.getFallDistance() - data.lastAddedFallDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
data.lastAddedFallDistance = 0;
|
data.lastAddedFallDistance = 0;
|
||||||
|
|
||||||
// We want to know if the fallDistance recorded by the game is smaller
|
// We want to know if the fallDistance recorded by the game is smaller
|
||||||
// than the fall distance recorded by the plugin
|
// than the fall distance recorded by the plugin
|
||||||
float difference = data.fallDistance - player.getFallDistance();
|
float difference = data.fallDistance - player.getFallDistance();
|
||||||
|
|
||||||
if(difference > 1.0F && toOnOrInGround && data.fallDistance > 2.0F) {
|
if(difference > 1.0F && toOnOrInGround && data.fallDistance > 2.0F) {
|
||||||
data.nofallViolationLevel += difference;
|
data.nofallViolationLevel += difference;
|
||||||
|
|
||||||
// Prepare some event-specific values for logging and custom actions
|
// Prepare some event-specific values for logging and custom actions
|
||||||
LogData ldata = plugin.getDataManager().getData(player).log;
|
LogData ldata = plugin.getDataManager().getData(player).log;
|
||||||
ldata.falldistance = data.fallDistance;
|
ldata.falldistance = data.fallDistance;
|
||||||
ldata.check = "moving/nofall";
|
ldata.check = "moving/nofall";
|
||||||
|
|
||||||
boolean cancel = action.executeActions(player, cc.moving.nofallActions, (int) data.nofallViolationLevel, ldata, cc);
|
boolean cancel = plugin.getActionManager().executeActions(player, cc.moving.nofallActions, (int) data.nofallViolationLevel, ldata, data.history, cc);
|
||||||
|
|
||||||
// If "cancelled", the fall damage gets dealt in a way that's visible to other plugins
|
// If "cancelled", the fall damage gets dealt in a way that's
|
||||||
if(cancel) {
|
// visible to other plugins
|
||||||
|
if(cancel) {
|
||||||
// Increase the fall distance a bit :)
|
// Increase the fall distance a bit :)
|
||||||
float totalDistance = data.fallDistance + difference * (cc.moving.nofallMultiplier - 1.0F);
|
float totalDistance = data.fallDistance + difference * (cc.moving.nofallMultiplier - 1.0F);
|
||||||
|
|
||||||
player.setFallDistance(totalDistance);
|
player.setFallDistance(totalDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
data.fallDistance = 0F;
|
data.fallDistance = 0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Increase the fall distance that is recorded by the plugin, AND set the fall distance of the player
|
// Increase the fall distance that is recorded by the plugin, AND set
|
||||||
// to whatever he would get with this move event. This modifies Minecrafts fall damage calculation
|
// the fall distance of the player
|
||||||
// slightly, but that's still better than ignoring players that try to use "teleports" or "stepdown"
|
// to whatever he would get with this move event. This modifies
|
||||||
// to avoid falldamage. It is only added for big height differences anyway, as to avoid to much deviation
|
// Minecrafts fall damage calculation
|
||||||
|
// slightly, but that's still better than ignoring players that try to
|
||||||
|
// use "teleports" or "stepdown"
|
||||||
|
// to avoid falldamage. It is only added for big height differences
|
||||||
|
// anyway, as to avoid to much deviation
|
||||||
// from the original Minecraft feeling.
|
// from the original Minecraft feeling.
|
||||||
if(oldY > newY) {
|
if(oldY > newY) {
|
||||||
float dist = (float) (oldY - newY);
|
float dist = (float) (oldY - newY);
|
||||||
data.fallDistance += dist;
|
data.fallDistance += dist;
|
||||||
|
|
||||||
if(dist > 1.0F) {
|
if(dist > 1.0F) {
|
||||||
data.lastAddedFallDistance = dist;
|
data.lastAddedFallDistance = dist;
|
||||||
player.setFallDistance(player.getFallDistance() + dist);
|
player.setFallDistance(player.getFallDistance() + dist);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
data.lastAddedFallDistance = 0.0F;
|
data.lastAddedFallDistance = 0.0F;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
data.lastAddedFallDistance = 0.0F;
|
data.lastAddedFallDistance = 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce falldamage violation level
|
// Reduce falldamage violation level
|
||||||
data.nofallViolationLevel *= 0.99D;
|
data.nofallViolationLevel *= 0.99D;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.checks.moving;
|
package cc.co.evenprime.bukkit.nocheat.checks.moving;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
||||||
@ -22,20 +21,18 @@ import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
|||||||
*/
|
*/
|
||||||
public class RunningCheck {
|
public class RunningCheck {
|
||||||
|
|
||||||
private final static double maxBonus = 1D;
|
private final static double maxBonus = 1D;
|
||||||
|
|
||||||
// How many move events can a player have in air before he is expected to
|
// How many move events can a player have in air before he is expected to
|
||||||
// lose altitude (or eventually land somewhere)
|
// lose altitude (or eventually land somewhere)
|
||||||
private final static int jumpingLimit = 6;
|
private final static int jumpingLimit = 6;
|
||||||
|
|
||||||
private final ActionExecutor action;
|
private final NoCheat plugin;
|
||||||
private final NoCheat plugin;
|
|
||||||
|
|
||||||
private final NoFallCheck noFallCheck;
|
private final NoFallCheck noFallCheck;
|
||||||
|
|
||||||
public RunningCheck(NoCheat plugin, NoFallCheck noFallCheck) {
|
public RunningCheck(NoCheat plugin, NoFallCheck noFallCheck) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.action = new ActionExecutor(plugin);
|
|
||||||
this.noFallCheck = noFallCheck;
|
this.noFallCheck = noFallCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +83,7 @@ public class RunningCheck {
|
|||||||
else if(resultVert > 0)
|
else if(resultVert > 0)
|
||||||
ldata.check = "runfly/vertical";
|
ldata.check = "runfly/vertical";
|
||||||
|
|
||||||
boolean cancel = action.executeActions(player, cc.moving.actions, (int) data.runflyViolationLevel, ldata, cc);
|
boolean cancel = plugin.getActionManager().executeActions(player, cc.moving.actions, (int) data.runflyViolationLevel, ldata, data.history, cc);
|
||||||
|
|
||||||
// Was one of the actions a cancel? Then do it
|
// Was one of the actions a cancel? Then do it
|
||||||
if(cancel) {
|
if(cancel) {
|
||||||
|
@ -3,8 +3,9 @@ package cc.co.evenprime.bukkit.nocheat.config;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.OptionNode.DataType;
|
import cc.co.evenprime.bukkit.nocheat.config.util.OptionNode;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.OptionNode.DataType;
|
||||||
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,8 +101,6 @@ public abstract class Configuration {
|
|||||||
public static final OptionNode FIGHT_DIRECTION_PENALTYTIME = new OptionNode("penaltytime", FIGHT_DIRECTION, DataType.INTEGER);
|
public static final OptionNode FIGHT_DIRECTION_PENALTYTIME = new OptionNode("penaltytime", FIGHT_DIRECTION, DataType.INTEGER);
|
||||||
public final static OptionNode FIGHT_DIRECTION_ACTIONS = new OptionNode("actions", FIGHT_DIRECTION, DataType.ACTIONLIST);
|
public final static OptionNode FIGHT_DIRECTION_ACTIONS = new OptionNode("actions", FIGHT_DIRECTION, DataType.ACTIONLIST);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final Map<OptionNode, Object> values;
|
private final Map<OptionNode, Object> values;
|
||||||
private final Configuration defaults;
|
private final Configuration defaults;
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import java.util.logging.LogRecord;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Central location for everything that's described in the configuration file(s)
|
* Central location for everything that's described in the configuration file(s)
|
||||||
|
@ -5,7 +5,8 @@ import java.io.File;
|
|||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionMapper;
|
||||||
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,6 +3,8 @@ package cc.co.evenprime.bukkit.nocheat.config;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.OptionNode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Textual explainations of options, will be displayed in the gui tool and the
|
* Textual explainations of options, will be displayed in the gui tool and the
|
||||||
* descriptions.txt file.
|
* descriptions.txt file.
|
||||||
|
@ -12,6 +12,7 @@ import cc.co.evenprime.bukkit.nocheat.actions.types.Action;
|
|||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.ConsolecommandAction;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.ConsolecommandAction;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.LogAction;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.LogAction;
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.SpecialAction;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.SpecialAction;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionMapper;
|
||||||
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
||||||
|
|
||||||
public class FlatFileAction {
|
public class FlatFileAction {
|
||||||
|
@ -8,8 +8,10 @@ import java.io.FileWriter;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.types.Action;
|
import cc.co.evenprime.bukkit.nocheat.actions.types.Action;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionMapper;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.OptionNode;
|
||||||
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
||||||
|
|
||||||
public class FlatFileConfiguration extends Configuration {
|
public class FlatFileConfiguration extends Configuration {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configurations specific for the "BlockBreak" checks
|
* Configurations specific for the "BlockBreak" checks
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
|
||||||
public class CCChat {
|
public class CCChat {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
|
||||||
public class CCFight {
|
public class CCFight {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
||||||
|
import cc.co.evenprime.bukkit.nocheat.config.util.ActionList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configurations specific for the Move Checks. Every world gets one of these
|
* Configurations specific for the Move Checks. Every world gets one of these
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.actions;
|
package cc.co.evenprime.bukkit.nocheat.config.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -18,11 +18,11 @@ import cc.co.evenprime.bukkit.nocheat.actions.types.Action;
|
|||||||
public class ActionList {
|
public class ActionList {
|
||||||
|
|
||||||
public ActionList() {}
|
public ActionList() {}
|
||||||
|
|
||||||
private final static Action[] emptyArray = new Action[0];
|
|
||||||
|
|
||||||
private final Map<Integer, Action[]> actions = new HashMap<Integer, Action[]>();
|
private final static Action[] emptyArray = new Action[0];
|
||||||
private final List<Integer> tresholds = new ArrayList<Integer>();
|
|
||||||
|
private final Map<Integer, Action[]> actions = new HashMap<Integer, Action[]>();
|
||||||
|
private final List<Integer> tresholds = new ArrayList<Integer>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an entry to this actionList. The list will be sorted by tresholds
|
* Add an entry to this actionList. The list will be sorted by tresholds
|
||||||
@ -52,7 +52,7 @@ public class ActionList {
|
|||||||
public Action[] getActions(Integer vl) {
|
public Action[] getActions(Integer vl) {
|
||||||
|
|
||||||
Integer result = null;
|
Integer result = null;
|
||||||
|
|
||||||
for(Integer treshold : tresholds) {
|
for(Integer treshold : tresholds) {
|
||||||
if(treshold <= vl) {
|
if(treshold <= vl) {
|
||||||
result = treshold;
|
result = treshold;
|
@ -1,4 +1,4 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config;
|
package cc.co.evenprime.bukkit.nocheat.config.util;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -1,4 +1,4 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config;
|
package cc.co.evenprime.bukkit.nocheat.config.util;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,4 +1,4 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.actions.history;
|
package cc.co.evenprime.bukkit.nocheat.data;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -11,7 +11,7 @@ import cc.co.evenprime.bukkit.nocheat.actions.types.Action;
|
|||||||
* @author Evenprime
|
* @author Evenprime
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ActionHistory {
|
public class ActionData {
|
||||||
|
|
||||||
private static class ExecutionHistoryEntry {
|
private static class ExecutionHistoryEntry {
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ public class ActionHistory {
|
|||||||
clearTimes(lastClearedTime + 1, time - lastClearedTime);
|
clearTimes(lastClearedTime + 1, time - lastClearedTime);
|
||||||
lastClearedTime = time + 1;
|
lastClearedTime = time + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
executionTimes[(int) (time % executionTimes.length)]++;
|
executionTimes[(int) (time % executionTimes.length)]++;
|
||||||
totalEntries++;
|
totalEntries++;
|
||||||
}
|
}
|
||||||
@ -60,11 +60,11 @@ public class ActionHistory {
|
|||||||
if(j == executionTimes.length) {
|
if(j == executionTimes.length) {
|
||||||
j = 0;
|
j = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalEntries -= executionTimes[j];
|
totalEntries -= executionTimes[j];
|
||||||
executionTimes[j] = 0;
|
executionTimes[j] = 0;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,9 +83,11 @@ public class ActionHistory {
|
|||||||
|
|
||||||
// Store data between Events
|
// Store data between Events
|
||||||
// time + action + action-counter
|
// time + action + action-counter
|
||||||
private final Map<Action, ExecutionHistoryEntry> executionHistory = new HashMap<Action, ExecutionHistoryEntry>();
|
private final Map<Action, ExecutionHistoryEntry> executionHistory;
|
||||||
|
|
||||||
public ActionHistory() {}
|
public ActionData() {
|
||||||
|
executionHistory = new HashMap<Action, ExecutionHistoryEntry>();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true, if the action should be executed, because all time
|
* Returns true, if the action should be executed, because all time
|
||||||
@ -111,8 +113,8 @@ public class ActionHistory {
|
|||||||
entry.addCounter(time);
|
entry.addCounter(time);
|
||||||
|
|
||||||
if(entry.getCounter() > action.delay) {
|
if(entry.getCounter() > action.delay) {
|
||||||
// Execute action?
|
// Execute action?
|
||||||
if(entry.getLastExecution() <= time - action.repeat) {
|
if(entry.getLastExecution() <= time - action.repeat) {
|
||||||
// Execute action!
|
// Execute action!
|
||||||
entry.setLastExecution(time);
|
entry.setLastExecution(time);
|
||||||
return true;
|
return true;
|
@ -2,21 +2,19 @@ package cc.co.evenprime.bukkit.nocheat.data;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class BaseData extends Data {
|
||||||
public class BaseData {
|
|
||||||
|
|
||||||
public final BlockBreakData blockbreak;
|
public final BlockBreakData blockbreak;
|
||||||
public final BlockPlaceData blockplace;
|
public final BlockPlaceData blockplace;
|
||||||
public final ChatData chat;
|
public final ChatData chat;
|
||||||
public final LogData log;
|
public final LogData log;
|
||||||
public final MovingData moving;
|
public final MovingData moving;
|
||||||
public final FightData fight;
|
public final FightData fight;
|
||||||
|
|
||||||
private final Data[] data;
|
private final Data[] data;
|
||||||
|
|
||||||
private long removalTime;
|
private long removalTime;
|
||||||
|
|
||||||
|
|
||||||
public BaseData() {
|
public BaseData() {
|
||||||
this.blockbreak = new BlockBreakData();
|
this.blockbreak = new BlockBreakData();
|
||||||
this.blockplace = new BlockPlaceData();
|
this.blockplace = new BlockPlaceData();
|
||||||
@ -24,10 +22,11 @@ public class BaseData {
|
|||||||
this.log = new LogData();
|
this.log = new LogData();
|
||||||
this.moving = new MovingData();
|
this.moving = new MovingData();
|
||||||
this.fight = new FightData();
|
this.fight = new FightData();
|
||||||
|
|
||||||
this.removalTime = 0;
|
this.removalTime = 0;
|
||||||
|
|
||||||
data = new Data[] { this.blockbreak, this.blockplace, this.chat, this.log, this.moving, this.fight };
|
data = new Data[] {this.blockbreak, this.blockplace, this.chat,
|
||||||
|
this.log, this.moving, this.fight};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearCriticalData() {
|
public void clearCriticalData() {
|
||||||
@ -41,17 +40,17 @@ public class BaseData {
|
|||||||
d.initialize(player);
|
d.initialize(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void markForRemoval(boolean removal) {
|
public void markForRemoval(boolean removal) {
|
||||||
if(removal) {
|
if(removal) {
|
||||||
// 1 minute in the future
|
// 1 minute in the future
|
||||||
this.removalTime = System.currentTimeMillis() + 60000;
|
this.removalTime = System.currentTimeMillis() + 60000;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
this.removalTime = 0;
|
this.removalTime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean shouldBeRemoved() {
|
|
||||||
|
public boolean shouldBeRemoved() {
|
||||||
return removalTime != 0 && removalTime < System.currentTimeMillis();
|
return removalTime != 0 && removalTime < System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package cc.co.evenprime.bukkit.nocheat.data;
|
|||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Playerspecific data for the blockbreak check group
|
* Playerspecific data for the blockbreak check group
|
||||||
*
|
*
|
||||||
@ -10,9 +11,10 @@ import org.bukkit.Location;
|
|||||||
*/
|
*/
|
||||||
public class BlockBreakData extends Data {
|
public class BlockBreakData extends Data {
|
||||||
|
|
||||||
public double reachViolationLevel = 0.0D;
|
public double reachViolationLevel = 0.0D;
|
||||||
public double directionViolationLevel = 0.0D;
|
public double directionViolationLevel = 0.0D;
|
||||||
|
|
||||||
public Location instaBrokeBlockLocation = null;
|
public Location instaBrokeBlockLocation = null;
|
||||||
|
public final ActionData history = new ActionData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.data;
|
package cc.co.evenprime.bukkit.nocheat.data;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Evenprime
|
* @author Evenprime
|
||||||
@ -7,6 +8,7 @@ package cc.co.evenprime.bukkit.nocheat.data;
|
|||||||
*/
|
*/
|
||||||
public class BlockPlaceData extends Data {
|
public class BlockPlaceData extends Data {
|
||||||
|
|
||||||
public double onliquidViolationLevel = 0.0D;
|
public double onliquidViolationLevel = 0.0D;
|
||||||
public double reachViolationLevel = 0.0D;
|
public double reachViolationLevel = 0.0D;
|
||||||
|
public final ActionData history = new ActionData();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.data;
|
package cc.co.evenprime.bukkit.nocheat.data;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Evenprime
|
* @author Evenprime
|
||||||
@ -7,7 +8,8 @@ package cc.co.evenprime.bukkit.nocheat.data;
|
|||||||
*/
|
*/
|
||||||
public class ChatData extends Data {
|
public class ChatData extends Data {
|
||||||
|
|
||||||
public int messageCount = 0;
|
public int messageCount = 0;
|
||||||
public int spamLasttime = 0;
|
public int spamLasttime = 0;
|
||||||
|
public final ActionData history = new ActionData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,15 +7,15 @@ import org.bukkit.entity.Player;
|
|||||||
* Every class that is extending this has to implement an empty Constructor()
|
* Every class that is extending this has to implement an empty Constructor()
|
||||||
*
|
*
|
||||||
* @author Evenprime
|
* @author Evenprime
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class Data {
|
public abstract class Data {
|
||||||
|
|
||||||
public void initialize(Player player) {
|
public void initialize(Player player) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearCriticalData() {
|
public void clearCriticalData() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.data;
|
package cc.co.evenprime.bukkit.nocheat.data;
|
||||||
|
|
||||||
|
|
||||||
public class FightData extends Data {
|
public class FightData extends Data {
|
||||||
|
|
||||||
public double violationLevel = 0;
|
public double violationLevel = 0;
|
||||||
public long directionLastViolationTime = 0;
|
public long directionLastViolationTime = 0;
|
||||||
|
public final ActionData history = new ActionData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class LogData extends Data {
|
|||||||
|
|
||||||
public void initialize(Player player) {
|
public void initialize(Player player) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
check = "";
|
this.check = "";
|
||||||
toLocation = player.getLocation();
|
this.toLocation = player.getLocation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,38 +3,41 @@ package cc.co.evenprime.bukkit.nocheat.data;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Player specific data for the moving check group
|
* Player specific data for the moving check group
|
||||||
*/
|
*/
|
||||||
public class MovingData extends Data {
|
public class MovingData extends Data {
|
||||||
|
|
||||||
public int jumpPhase;
|
public int jumpPhase;
|
||||||
|
|
||||||
public Location runflySetBackPoint;
|
public Location runflySetBackPoint;
|
||||||
|
|
||||||
public double runflyViolationLevel;
|
public double runflyViolationLevel;
|
||||||
|
|
||||||
public double vertFreedom;
|
public double vertFreedom;
|
||||||
public double vertVelocity;
|
public double vertVelocity;
|
||||||
public int vertVelocityCounter;
|
public int vertVelocityCounter;
|
||||||
public double horizFreedom;
|
public double horizFreedom;
|
||||||
public int horizVelocityCounter;
|
public int horizVelocityCounter;
|
||||||
|
|
||||||
public double nofallViolationLevel;
|
public double nofallViolationLevel;
|
||||||
public float fallDistance;
|
public float fallDistance;
|
||||||
public float lastAddedFallDistance;
|
public float lastAddedFallDistance;
|
||||||
|
|
||||||
public double horizontalBuffer;
|
public double horizontalBuffer;
|
||||||
public int bunnyhopdelay;
|
public int bunnyhopdelay;
|
||||||
|
|
||||||
public int morePacketsCounter;
|
public int morePacketsCounter;
|
||||||
public int morePacketsBuffer;
|
public int morePacketsBuffer;
|
||||||
public Location morePacketsSetbackPoint;
|
public Location morePacketsSetbackPoint;
|
||||||
public double morePacketsViolationLevel;
|
public double morePacketsViolationLevel;
|
||||||
|
|
||||||
public Location teleportTo;
|
public Location teleportTo;
|
||||||
|
|
||||||
public int lastElapsedIngameSeconds;
|
public int lastElapsedIngameSeconds;
|
||||||
|
|
||||||
|
public final ActionData history = new ActionData();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(Player player) {
|
public void initialize(Player player) {
|
||||||
|
Loading…
Reference in New Issue
Block a user