From fec027d41dfcd1e745e1f609a43418b1148af815 Mon Sep 17 00:00:00 2001 From: asofold Date: Sat, 11 Jun 2016 19:21:01 +0200 Subject: [PATCH] Comments. --- .../nocheatplus/checks/moving/player/Passable.java | 12 +++++------- .../utilities/collision/BlockPositionContainer.java | 8 +++++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/player/Passable.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/player/Passable.java index 2545f59c..8a91ec07 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/player/Passable.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/player/Passable.java @@ -37,16 +37,14 @@ public class Passable extends Check { /** TESTING RATHER. */ - // TODO: Make this configurable once a working set of settings has been found. - // TODO: Once made configurable... intense testing... and test cases. + // TODO: Configuration. + // TODO: Test cases. private static boolean rt_legacy = false; // TODO: rt_xzFactor = 1.0; // Problems: Doors, fences. private static double rt_xzFactor = 0.98; // TODO: Test bumping head into things. private static double rt_heightFactor = 1.0; - // TODO: Option to ignore initially colliding blocks in general? (Alternative: interpret ignoreFirst as such.) - /** * Convenience for player moving, to keep a better overview. * @@ -76,9 +74,9 @@ public class Passable extends Check { String tags = ""; // Block distances (sum, max) for from-to (not for loc!). final int manhattan = from.manhattan(to); - + if (rt_legacy) { - // Skip moves inside of ignored blocks right away [works as long as we only check between foot-locations]. + // Skip moves inside of ignored blocks right away [works as long as we only check between foot-locations]. if (manhattan <= 1 && BlockProperties.isPassable(from.getTypeId())) { // TODO: Monitor: BlockProperties.isPassable checks slightly different than before. if (manhattan == 0){ @@ -91,7 +89,7 @@ public class Passable extends Check { } } } - + boolean toPassable = to.isPassable(); // General condition check for using ray-tracing. if ((!rt_legacy || toPassable) && cc.passableRayTracingCheck diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java index f2174a4c..355cfae4 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java @@ -11,8 +11,10 @@ import fr.neatmonster.nocheatplus.components.location.IGetBlockPosition; * A kept-simple container for block positions, meant to provide fast adding and * fast contains checks (and fast clear). Intended use is to add blocks first, * then query if blocks are contained with advancing coordinates like with - * ray-tracing or axis-tracing. Currently adding blocks twice is not meant to - * happen, and we assume blocks to be few. + * ray-tracing or axis-tracing. + *
+ * Currently adding blocks twice is not meant to happen, and we assume blocks to + * be few, in fact the size is assumed to be 0 most of the time. * * @author asofold * @@ -22,7 +24,7 @@ public class BlockPositionContainer implements IAddBlockPosition, IContainBlockP // TODO: Not sure where to put this. // TODO: Future use / interfacing could involve collecting cuboids from block positions (mining/activity/areas). - // TODO: Consider switching to HashSet or CoordMap. + // TODO: Consider switching to a HashSet or an ArrayList. private final LinkedList blocks = new LinkedList(); private int minX, minY, minZ, maxX, maxY, maxZ;