* Split tracing stuff into more sub-packages (distinguish ray-tracing from axis-tracing);
* Move InventoryUtil to entity package.
* Begin sketching the supporting block mechanic introduced in 1.20 (correctly, this time); incomplete. Haven't implemented it yet into the prediction system.
* Correct an oversight in PlayerEnvelopes (jumpPhase for jump motion checking).
* One more tweak for powder snow collision (use BlockProperties.collidesBlock() directly, instead of collides()).
* Naming convention: Velocity -> VelocityAdapter.
* Powder snow doesn't exist on 1.16 and below, so make sure the isInsideBlock check returns false in that case (ViaVersion maps it to regular snow which has a solid collision box, which will be a problem with wall collision: NCP will see the abrupt deceleration without knowing that it was caused by the client seeing powder snow as a solid block.)
* Attempt to adjust the collision checking: ensure that we only check the exact block the player is currently inside.
* Check for shift key toggles within the block-shape definition.
Bonus:
* Align naming convention for velocity flags.
* More comments
Side note: need to study how bundles work exactly, and evaluate cheating potential for this gameplay mechanic (namely, fast-clicking and inventory manipulation. FastClick may need to be updated).
* Rename methods in ClientVersion for less verbosity.
* Add convenience methods to ClientVersion.
* Add method to get either the player's or the entity's version in GenericVersion (and make use of it in RichEntityLocation).
* New Class: AxisAlignedBBUtils. To contain all utility methods related to bounding boxes.
* Remove unused code in MathUtils and MovingUtil.
* Move some methods around classes (Visible, CollisionUtil, MathUtils…).
* Do cross-version checking for bouncy blocks in RichEntityLocation.
* More conditions for checking the legitimacy of toggle sprint.
* Check for client version in the maybeElytraBoost method.
* Attempt to fix bunnyhopping in low-ceiling areas (isVerticallyConstricted…)
Speed factor methods will now use LivingEntity instead of Player signatures, because they'll be used in the future for vehicles as well.
isSolidFace is untested.
Instead of proactively calculating speed with thisMove#touchedGroundWorkaround, let lost-ground be treated as an "after failure" check: if the player fails the horizontal prediction and a lost-ground case happened, force-set the ground flag and re-calculate (effect on performance needs be evaluated).
Same thing applies for vertical motion with the PlayerEnvelopes#isTouchDownMove thing.
More:
* At last, get rid of bunnyfly: with a stricter vertical monitoring this should not be needed anymore.
* On respawning: let the player decide if sneaking/sprinting should be reset.
* Clarify some stuff here and there.
* Unbind lost-ground from toIsValid check in AirWorkarounds (move validity is already checked in lost-ground)
* Do still register item-use events/adapters from 1.12 up to 1.17
Properly set the sneaking status with player-poses, instead of shift key presses (see comment in CombinedListener. Could be worthy of a ticket to Spigot).
1.14 sneaking mechanics have been refined, for the most part. There's still one nasty issue that I couldn't manage to fix: trying to jump in 1.5 blocks-high areas… Jump is seemingly undetectable, so we may have to brute-force speed there….
More:
*AirWorkarounds: tighten up touch-down workaround; test for the most frequent workarounds earlier.
* Adjust things (and jump definition) to take crawling into account.
* Just to be sure: seek for literal "releaseUsingItem" name as well when reflectively calling the method.
After… 12 or so years, Bukkit finally has a method to know if the player is using an item (not just blocking(!)), thus, the adapter is not needed anymore.
(How have we not noticed it this whole time!?)
Also move the resetActiveItem stuff as a service in PlayerData.
Works somewhat okay but it still throws false positives, will need more iterations.
More:
* "Properly" handle wall collision. Implementation is not necessarily the most elegant, but it is the most robust and exploit-free, judging from some testings (couldn't reproduce any more false positive with it).
* Adjust jump definition in PlayerEnvelopes.
* Formatting and adjustements for AirWorkarounds (add rule for wrong split move etc...).
* Confine stepdown-from to not having slowfall.
* Get rid of legacy riptide implementation with CreativeFly.
* Check for client-version in the getLookingDirection method (apparently 1.12 and below have a slightly different equation).
* Add a temporary non-vanilla friction library for vDistLiquid only in BlockProperties, which still uses the old style implementation.
* Comments, clarify docs, clarify debug format and style for movement (should be a bit more readable).
* Get rid of Critical's config. options.
* Move elytra gliding consistency checks in the CombinedListener.
* Throw in legacy liquid collision methods (especially for lava's, which is quite inconsistent throughout recent versions).
* Zero drip leaf's AABB if unstable (workaround, needs to be tested)
* Use Spigot's new PlayerSignOpenEvent to handle AutoSign with 1.20 signs.
* Prepare / sketch a first SurvivalFly-based prediction with the elytra.
* Properly return -1 if could not get the firework boost power (BridgeMisc).
* Update ClientVersion up to 1.20.2.
* Bridge 1.13: test if a server may have a built-in raytracing implementation (Bukkit did introduce it in 1.13.2)
* Get rid of jump-phase check.
* Open: use SurvivalFly's prediction to know if the inventory needs to be closed
* Target Spigot's 1.20.2 from now on (poms)
* Adjust stepping, jumping and bunnyhopping definitions to lost ground.
* Simplify AirWorkarounds (get rid of most of them, favouring a more coherent class).
* Re-add some lost ground cases; distinguish lost ground for vertical VS for horizontal motion (some cases won't apply to vertical but for horizontal and viceversa, see the "missedGroundCollision" comment) and format for much easier debugging (or at least look).
* Get rid of minJumpHeight method in LiftOffEnv.
* Move hasAttackSlowDown flag to the CombinedListener.
* Get rid of -now- unused sfZerovdistrepeat flag.
* Set sneaking, sprinting and use item status in PlayerData. See comments in the CombinedListener class as for why.
* CollisionUtil:
- Some methods to get entities around players.
* RichEntityLocation:
- As a bonus: selectively add cross-version compatibility with multi-protocol plugins in several places (honey blocks, berry bushes, levitation [...]).
- Properly handle on-ground judgement with powder snow.
- Implement a proper isSlidingDown method.
* RichBoundsLocation:
- Format, order, remove redundant contraction of the bounding box with liquid checking (+ 0.001), fix bubble column collision and lastly, revert a change brought by @xaw3ep with the bounding box setting: using fullWidth / 2f is imprecise and will lead the isHeadObstructed method to return true when moving alongside walls, for now, the fix has been reverted to the old resolution of Math.round((fullWidth * 500.0) / 1000).
* MovingListener:
- Check for sneaking directly in the envelope method for bouncing and get rid of old stairs workaround.
* InventoryUtil:
- Move the hasArrow method to the InventoryUtil class (+ some formatting).
* SurvivalFly:
- Get rid of the now useless LIMIT_NEAR_GROUND envelope.
- Adjust use of head obstruction checking.
- Rough handling of slimce bounce mechanic; will need some adjustments down the road...
- Somehow handle powder snow climbing.
- Attempt to handle "unknown" horizontal movements: if we can't find a match (= a predicted speed having an offset smaller than 0.0001), set in this move the closest predicted speed to the actual one and adjust it through some kind of workaround.
Overall, we're reaching (and probably already stretching) NCP's infrastructure limitations.
This is especially noticeable with the on-ground judgment and collisions in general, which are the two main things that are preventing us from merging the branch in master (at least as a beta version).
Usually, NCP’s on-ground system is enough to get by even with more complex scenarios (i.e.: stepping), however the amount of edge cases to manage is (starting to be-) overwhelming: with predictions, we not only have to deal with lost ground -which already is a huge pain in the ass per se- but we also have to deal with the same issue on the opposite spectrum, or in other words, with “excessive ground” cases.
Just take a look at the LostGround class, PlayerEnvelopes.isJump()/Step() and all comments in AirWorkarounds.
Missing:
Vertical:
- In water/lava -> in air transitions
- Jumping in waterlogged blocks
- Implement the correct collision logic for 1.20 players (richentitylocation).
- Fix insidePowderSnow checking (see notes in RichBoundsLoc).
- Fix split move messing up when jumping in honey blocks.
- Jumping on the very edge of chest lost ground case (completely misses the ground collision, player is seen as having 0.42 motion in air... Is it a shape issue rather?).
- Wobbling up on slime blocks/beds (still need some adaptations to it. Getting sporadic false positives).
Horizontal:
- Still false positives when moving against walls…
- Lost ground still messing with prediction in general…
- Still false positives when getting pushed…
- Still missing that maybeBackOffFromEdge method…
IMPORTANT:
- We need to port / code / workaround Mojang’s new logic for moving along the edges of blocks with nothing else underneath (block properties are now properly applied even on the very edge)
Move hard-coded magic into its own package (envelope); move checks.moving.magic class to the moving utilities package; split envelopes methods into its own class (PlayerEnvelopes); BounceUtil -> BounceHandler and to the envelope class; BounceType -> to the checks.moving.model package.
* Renamed Folia class to "SchedulerHelper" (name is up to debate, feel free to add)
* Gutenberg won't check for availability anymore. The event was introduced in 1.5 and NCP doesn't support versions lower than that anymore.
* Move "honeyBlockSidewayCollision" method to PlayerEnvelopes.
* Fix compilation errors in RichBoundsLocation and get rid of unused method.
* Get rid of the "split move" flag: too internal of an option and should never be disabled anyway.
* Clarify docs
* LiftOffEnvelope:
-Get rid of min/max jump distinction.
-Decrease normal jump height down to 1.26.
* SurvivalFly: various adjustments... Key change are:
-The riddance of vAcc. Useless with the upcoming vDistRel rework;
-Unbind to the horizontal-push-speed mechanic from hard-coded magic. (Please Asofold for the love God why did you not document this kind of stuff... Why was it needed);
-Merge vDistWeb, vDistLevitation, vDistBush into vDistRel, climbables and powder snow are still handled in their respective methods because we are restricted by NCP's current infrastructure and we cannot predict those two (powder snow in particular)
-Move honeyBlock collision to richboundslocation.
* RichEntityLocation:
-Force legacy players to have vines attached to a solid block to climb up.
-Check for client version for fullHeight setting as well.
-Move liquid pushing stuff to RuchEntityLocation
Workarounds are just too stratified and convoluted to keep up with them.
Just to debug one of them might take a week or more; so, except for oddSlope, oddGravity and vEnvHacks, all the other ones have been removed.
Changes:
* Get rid of the now unused isDownStream() and isInOrAboveSouldSand() methods.
* Move InputDirection class to the model package.
* Lift off envelope: web jump speed is 0.021
* Check for client version in NoFall, as well as reset data upon sliding on a honey block inside the checking method (not in the collision method in movingutil).
* Prepare a velocity flags to distinguish real velocity from fake entries.
* Implement legacy liquid pushing (not tested).
* Friction/speed factors getting is ignored if flying or gliding (vanilla)
* Integrate FastConsume as an ordinary check (1.5 and above servers have the consume event, no need to test for availability anymore)
* If protocol-hack plugins are not present but protocol lib is, do still set the client version.
* Attempt to catch ominisprint if speed is (apparently) legit.
* Display at least 6 digits when debugging speed h/v (with the speed prediction, this is much needed)
* Revert accidental formatting change to GodMode
*The band-aid "lowjump post" subcheck has been removed as well, because the vDistRel rework will (soon) catch those as well. But first, we need to patch the first-move-after-landing false positive.
* Also get rid of bunnyslope, once and for all.
Missing:
vDistRel: handling of: leaving liquids, noob-towering up, landing-back-on-ground, medium transitions...
vDistPowderSnow: incomplete, due to not knowing how the game handles ascending motion here.
vDistLevitation: works fine with lower levels, but breaks with higher ones (above 20 or so) for whatever reason.
(Was meant to be split into different commits, but I fucked up a bunch of things. Oh well)
* Further clarify docs and comments, cleanup.
* Reoder some event-listeners (especially in the movinglistener).
* Net checks: also request a setback on flyingfrequency violations (should prevent server-sided freeze [...]).
* Do still interpret packets for outgoing positions if flyingfrequency is disabled.
* Fix false positives with ImpossibleHit.
* Remove legacy boolean flag for 1.5 inventory tweaks (fastclick).
* Don't allow players to stand on tilted drip leaves (onGround judgement).
* SurvivalFly: reset bunnyhop delay on slopes and stairs, tweak slowfalling handling (only apply slowfall gravity if the player is actually falling [not coming from ground etc...]).
* Remove experimental Improbable feeding with VL frequency hook.
* Rework inventorymove:
Instead of checking during InventoryClickEvent(s), we check players on PlayerMoveEvents and if the inventory is open when it shouldn't be possible, it will be forcibly (and silently) closed, without generating any violation or alert .
This makes the check functionally identical to Open, so it has been merged in it.
Not 100% done. Still needs the speed prediction to function, in order to determine friction speeds.
* Set all config values to build 154 from now on.
* LostGround:
- Swap edgedesc with pyramid and put edgedesc as a special case in vAcc;
- Confine all Edgeasc cases by having a minimum speed of 0.0001;
- Confine noobtower by jumPhase between 1 and 7 inclusive;
- Confine couldstep by speed <= estimatedSpeed * 1.1;
- Edgeasc2 won't be applied on split move (following asofold's note here);
- All edgeasc cases won't be applied if a lost ground case was applied with the move before;
- Update Improbable if a lost ground case is applied;
These have not been tested.
They are rather the most plausible confining conditions that I can think of currently; aim is to prevent to easy abuse with NoFall disabled to accumulate fall distance.
* SurvivalFly:
- Sharpen bunnyhop conditions;
- Remove omnisprint for the moment;
- Increase the inaccuracy margin with levitation;
- Possibly fix bunnyhopping on soul sand and blocking speed in 1.8;
- Reduce the complexity of split moves workarounds with stuck-speed, courtesy of @xaw3ep 's rework on the mechanic;
- Lower head obstruction margin for low-jumping;
- Sharpen levitation handling;
- Roughly make vAcc work with slowfall.
* Fix NSM errors with some packet listeners;
* Comments, formatting, clarify comments
* Improbable:
- Increase thresholds for firing violations, since it gets fed by a lot more inputs now;
(Probably forgot some other stuff... Oh well. Happy new year)
* Move Bridge1_17 stuff into BridgeMisc;
* Add a "hasGravity" method;
* Patch potential 1-block step bypass with lowvdistsb;
* Fix (for the most part) closing a shulker box while standing on top of it;
* Fix up a bit bubble columns handling;
* Fix false positives when exiting a bush or web from below;
* Cleanup and reduce signature for AirWorkarounds;
* Catch another trapfence lost ground case;
* Remove reminders of the old bunnyfly mechanic: all early-bunnyfly-reset cases can be omitted because those rely on the old condition "if (bunnyfly > 0 && hDistance > hAllowedDistanceBase)".
However with the current implementation, air / bunnyfly distance is already estimated and included;
* Use getLastJoinTime for Net_Moving and Net_KeepAliveFrequency, getting rid of the old listener workaround;
* Keep confining workarounds:
-W_M_SF_ODDGRAVITY_3: one time use
-W_M_SF_ODDLIQUID_13: one time use
-W_M_SF_ODDLIQUID_7: one time use
-W_M_SF_ODDLIQUID_5: 4 times use max
-W_M_SF_ODDLIQUID_6: water-bound
-W_M_SF_ODDLIQUID_12: one time use.
* Don’t ignore PVP and block-move velocity when in bushes and powder snow;
* Distinguish vertical friction factor by media (air, water, lava) and block (stuck-in-block);
* Slowfall:
- Add workarounds for vDistRel where needed. - Adapt checking methods to it (modelling might be a little rough still).
- Handle honey slide + slowfall.
- Skip NoFall and fall damage with slowfall.
- Handle with the BCT breaking blocks below with slowfall (false positives).
- Skip vAcc: temporary. Needs a proper adaptation.
* Levitation:
- Add checking method;
- Add velocity when the effect wears off;
- Skip NoFall;
Missing:
* InstantBow apparently always triggers with the first crossbow shot (why is it even enabled at all?);
* Major: players can stand on top of tilted drip leaves (!)(to avoid latency-based false positive, we might use the block change tracker system here)
* False positives when falling and breaking a block below with Efficiency enchant: issue with the server not keeping up with the client, might mitigate with the BCT [Does not seem to fix the issue, will need a ghost-block system fix];
* Bubble streams adjacent to each other drag/push: push prevails even if the box is in the column by pixels. Problem: we don’t get told if the column can also push the player;
* vAcc velocity downwards (old TODO);
* vAcc with snowfall (don’t skip, adapt rather);
* Still low-jump false positives when closing a shulker, with slowfall in particular;
* Low-jump false positive after jumping out of water and onto a water lily;
* Liquid modeling with slowfall is still quite rough;
* Levitation will need a refine later;
* Bubble columns ascend -> refine;
Lots of changes:
* [Bleeding] Add Net_toggleFrequency on packet level (needs to be tsted and adjusted, currently does not discern action types);
* [Bleeding] Add a quick check for no gravity when in webs;
* Formatting;
* Fix vDistBush + stepping;
* Fix Net_keepAliveFrequency/AttackFrequency/Moving not checking for the respective bypass permission;
* Fix Net_Moving always checking players, even if disabled;
* Fix Extreme_Move only running with CreativeFly;
* Fix low-jump detection not accounting for velocity;
* Fix a disabled Net_FlyingFrequency from crippling all other flying-packet checks;
* Remove redundant WrongTurn adapter;
* Remove legacy Fight_Speed check and keep AttackFrequency only (This means that servers older than 1.6.4 won't have attacking speed protection anymore. We need to put a halt on legacy-versions support at some point 😛);
* Remove legacy and unneeded mechanics: lost-sprint, assume sprint, slowness sprint hack, ground hop;
* Remove bubble-stream-horizontal-velocity workaround;
* Remove unimplemented FlyingFrequencyRedundant config;
* Rename compatibility dev module to -> NCPCompatSpigotCB1_12, since 1.12 is the last version to have a native module on its own;
* Rename NoSlow adapter to UseItemAdapter;
* Adjustments to vDistWeb and vDistBush;
Very heterogeneous commit.
Key changes:
* Comment out LostGround_Step: not too sure about this one however why is it even considered a lost-ground case if the player did touch the ground (to.isOnGround())?
* Remove LostGround_EdgeAsc7: duplicate code;
* Remove LostrGround_Pyramid: doesn't seem to cause any issue with vertical motion and with the new hSpeed rework, momentum ticks don't exist anymore.
* Remove LostGround_MiniStep: not needed. Jumping around flower pots is fine even without the workaround.
* Remove LostGround_vCollide: again, doesn't seem to be needed anymore.
* Confine LostGround_Micro by head obstruction due to a lantern or currently respawning;
* Better on-ground support for bunnyfly: account for block-change activity where possible;
* Skip block-speed check if the player is in water or in bubble-stream (NMS);
* Implement getMovementSpeed;
* Get rid of hAllowedDistanceBase (not needed anymore) [Might return for later uses i.e.: getting the allowed speed before applying friction];
* Rename methods and get rid of VanillaMath (changed my mind, keep everything in TrigUtil and MathUtil :p)
* Correct a typo in Inventoryutil.
* Fix a rather embarrassing typo (Ground-seeking distance for getBlockFrictionFactor is 0.5000001, not 5000001 :) )
* Support bukkit's /walkspeed command;
* Random clean-up for old checks.
- Note: The 0.1 magic value can be found in Abilities.java (walkingspeed)
Moving some stuff in remote.
* Rework horizontal friction system;
* Cleanup code: remove unused and/or unneeded variables, remove old bunnyhop mechanic;
* Throw in a sketch of the predictive horizontal speed handling [broken, will not compile due to some stuff still missing]
Missing:
* 3d Movement direction handling
* Test everything I guess
* getMovementSpeed stripped only of sprinting speed
* Correct stuff that is going to be inevitably wrong :)
* InAirRules: confine specific workaround to Normal env;
* Readability: iusingitem -> isUsingItem(...) | F_COBWEB2 -> F_BERRY_BUSH | typo | Order in MCAccessBukkitModern;
* Do prevent players from faking critical hits in media where they can be faked;
* Open check: test on player sleep and death;
* Sharpen stepAcc;
* Slopes: skip on jump potions, let lowjump catch the reset;
* Bunny: on slope-jumping, demand distance higher than the y on ground, at least;
* Remove legacy bullshit (awkward snowfix);
* Demand yDistance greater than minimum gravity for maxphase.
* Remove left-overs from previous bunnyhop-related commits (simply increasing speed on slope-jumping should suffice).
* Fix 1.8 chests with ice underneath.
Changes:
* Fix a minor derp in FightListener: Improbable was being fed even with fight.speed disabled;
* isOnBouncyBlock environmental property, accounting for beds too;
* SurvivalFly:
- Increase hAcc limit for headobstr
with ice;
- Move honey block collision to
MovingUtil;
- Fix head obstructed + bunny with
lower block;
- Reset hAcc in ediblebunny as well
if head is obstructed;
* Add wasOnIceRecently method. Uses past move tracking;
* Move Extreme_move subcheck for flying packets into its own check. Also (potentially) fix some false positives;
* Remove WrongPacket. Useless;
* Only feed Improbable in Impossiblehit (no check);
* Tweaks for default config.