This is a quick go with little testing, roughly up to level 60. Above
that there may be more false positives, also "no jumping" is not
enforced there.
A suggestion for the future could be to just use/part-calculate an array
for all the typical effects.
Used to be 0.0625 for a while, but intentions are to cover ground-loss
as lostground workarounds. Later switch to calculate the distance to
ground (with a given max-distance).
For efficiency (several?) other cases will be removable, once we model
the per-move ground/medium properties more accurately also for the past
move(s). At least lostground_pyramid should be removed then.
Can't implement "dumb" access order, because we will have to move
entries to the front with setting and altering data, but we don't want
the data to be changed every time get is called, e.g. with piston
tracking.
Efficiency could be increased, using the entry as reference instead of
duplicate calls with coordinates.
Splits CoordMap into interface, abstract hash map, implementations.
Sketch Linked version, hinting at access order, e.g. with
tracking piston effects with timeouts.
Missing:
* Implementation of a linked version.
Cancelling redundant packets has to big problems:
* The normal case is to not run in the primary thread.
* For legit players a missed micro move could mean that survivalfly can
not detect ground properly.
Better approaches could be:
* Cancel asynchronous packets if they match the last sent one (only
simple hacks).
* Check for moves passing block borders, request block shapes and such
from the main thread.
* Detect actual cheating or unusual patterns instead.
* Queue packets for processing in the main thread.
Missing:
* Actually detect ACK packets for previous outgoing teleports.
* Do something upon detecting illegal coordinates (asynchronous
disconnect? queue kicking, config).
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).
Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
* Group selected classes into sub-packages of moving.
* Rename classes.
* Must use LinkedList for velocity entries.
* Prepare SimpleAxisVelocity + entry for use-once accounting.
(Might not be the final naming.)
* Use BlockProperties.collides to use the actual bounds of blocks.
* Don't test for sfLowJump to set allowHop.
* Set head bump margin to match 2-high spots and to prevent lowjump fps.
* Tighten conditions for actual hop.
* Don't x > 1.314 * x.
* Add height, eyeHeight, isHeadObstructed to PlayerLocation.
* lowjump detection: from is higher than to, test both locations.
* Remove bunny reset within lowjump detection (defeated flying bunny).
* Check isHeadObstructed directly in the bunnyHop method.
Issues remaining:
* Moderate acceleration ground to ground, after having landed (+1st).
* Possibly transitions between 2-high and other.
* More edge cases with slowness potion.
Using profiles:
* Profile "minimal" will build by default, excluding all dedicated cb
dependencies, making it easier to quickly test stuff.
* Set the property 'cbdedicated' to true, in order to build all, using
the profile "all".
* The properties BUILD_NUMBER and BUILD_SERIES don't seem to set to
defaults anymore, so they have to be set manually (BUILD_NUMBER does get
set on jenkins).