4367 Commits
Author SHA1 Message Date
Lysandr0 61d329edc5 Slowly getting back a bit…
* Do register 1.21 blocks - 1.21.5 blocks are still missing TBD;
* Sweep old/legacy isVelocityJumpPhase field - no longer needed with the upcoming velocity rework;
* Naming conventions, cleanup;
* Attempt to guess/brute-force when the 0.2 climbable speed should be applied when in powder snow.
* Remove redundant collision checking for bubble columns
2025-06-01 09:40:41 +02:00
Lysandr0 457284858e Complete the supporting block mechanic sketch; misc changes.
* Clarify and clean-up javadocs; add comments.
* RichBoundsLocation:
   - getTypeId/Above() -> getBlockType/Above().
   - getAABBCopy() -> getBoundingBox().
   - Align collision checkers to the other ones (do not check in a top-down way)
* Magic: move envelope methods to PhysicsEnvelope.
* PlayerEnvelopes -> PhysicsEnvelope.
* Remove unneeded method in TrigUtil.
* BlockProperties:
   - getBlockFrictionFactor() -> getHorizontalFrictionFactor().
   - Attempt to handle powder snow behaviour within the on ground judgement.
   - Remove unused World argument in isOnGround().
* DataManager: add getPlayerDataForEntity().
* PlayerMoveData: differentiate jumping from just pressing the space bar.
* AxisAlignedBBUtils:
   - Rename creation methods.
   - When converting a BoundingBox object to a double array, check it is null and create an "empty" box of all 0.0 if so.
* SurvivalFly:
   - Correct minor oversight with the gravity-reiteration fix.
2025-03-14 13:41:14 +01:00
Lysandr0 059727e2bd [Incomplete][Broken] Some refactoring.
* 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.
2025-02-05 20:53:39 +01:00
Lysandr0 0694419f52 Ops…
Move out BlocksMC1.21 from special…
2025-01-30 10:14:06 +01:00
Lysandr0 6089ec3f7b More tweaks on powder snow collision.
* 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
2025-01-30 09:55:22 +01:00
Lysandr0 2d51e4f8cb Add support for "weaving" effect, remove old explosion flags. 2025-01-28 14:53:01 +01:00
Lysandr0 3b60ae8aa9 Bump to 1.21.4, slight revision on powder snow collision (rich bounds), fix/adjust javadocs.
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).
2025-01-27 23:01:06 +01:00
Xaw3ep 1e75c342c7 Partly velocity processor rework 2025-01-27 05:45:10 +07:00
Lysandr0 4f9a3fb605 Sketch push effect for entities (horizontal speed).
+ random change to how h-offsets are calculated.
2024-12-11 10:09:11 +01:00
Xaw3ep 33a2b1c7fe Adjustment on legacy clients 2024-11-26 11:16:19 +07:00
Lysandr0 b173710280 More clean up and clarification of docs. 2024-11-23 14:41:45 +01:00
Lysandr0 04d8e6ccde More changes.
* Suppress some warnings
* Changed my mind: keep everything in one class for legacy input calculations.
* Remove inLiquid condition for levitation in the MovingListener.
* Add inLiquid condition for the jumping envelope.

Prediction for both vertical and horizontal seems to be broken for versions below 1.12. Still investigating why… Too tired to continue right now.
2024-11-12 18:54:31 +01:00
Lysandr0 0e802ca9de It's the actual distance, not the allowed one here :) 2024-11-08 08:56:31 +01:00
Lysandr0 26a053d6cf Make use of player#getCurrentInput(), fix a bunch of errors encountered on 1.8. 2024-11-07 21:52:21 +01:00
Xaw3ep a1f11aa32a Tweak on v_exiting_liquid 2024-11-07 22:45:19 +07:00
Xaw3ep f5ed107e2b Somewhat runnable 2024-11-07 14:56:28 +07:00
Xaw3ep 8b98ac72b9 An attempt to fix old unit tests
I have no idea why it still throw java.lang.NullPointerException although the build return success?
2024-11-01 00:01:10 +07:00
Lysandr0 80dc6bb8e0 Ops. 2024-10-30 08:39:27 +01:00
Lysandr0 3bfb217896 Attempt to track the obstruction flag with the past-move tracking system.
A really hacky way to do so. Since we need the Entity instance, we cannot use RichBoundsLocation.
2024-10-30 08:31:58 +01:00
Lysandr0 2e73401803 Move some classes around
Use the compat.bukkit pacakge for Bridge classes that have the specific purpose of solving API breakages between versions.
2024-10-30 08:09:45 +01:00
Lysandr0 d1a88dbc23 No spigot dependency here. 2024-10-29 14:04:42 +01:00
Lysandr0 0a56ded6d3 Adapt to 1.21.3 changes. 2024-10-29 13:33:39 +01:00
Lysandr0 f01bcefa58 Merge branch 'hspeed' of https://github.com/Updated-NoCheatPlus/NoCheatPlus into hspeed 2024-10-27 19:43:35 +01:00
Lysandr0 c0a66a56ee Touch-ups here and there. 2024-10-27 19:17:55 +01:00
Xaw3ep 05f9b9f1de [Bleeding] Correct vertical liquid prediction 2024-10-27 23:36:03 +07:00
Lysandr0 32edebf3ba Ops. 2024-10-12 08:44:11 +02:00
Lysandr0 6c73899fa9 Throw more utility methods in AxisAlignedBBUtils 2024-10-12 08:36:24 +02:00
Lysandr0 9a9f195d03 Update several methods to 1.21 changes (collide(), maybeBackOffFromEdges()) 2024-10-04 14:27:38 +02:00
Lysandr0 e0fa64c213 Finish implementing modern attributes (+ more cleanup). 2024-10-04 13:59:09 +02:00
Lysandr0 a310b9ebef Implement (most of the) 1.20.5/1.21 attributes, continue working on the vertical liquid speed prediction, better documentation for some methods.
Attribute implementation is still missing for legacy modules… TBD at a later time.
2024-09-22 14:35:21 +02:00
Lysandr0 f8502fe8e6 [Broken] Sketch an inside-liquid vertical prediction.
Lots of issues still remain (this is mostly a starting point).
Namely:
1) I can't seem to find how the game handles gravity in liquid (descending; not pressing the space bar);
2) It still doesn't account for all version-dependent nuances (i.e.: 1.12 and below clients not being able to swim up to the surface), because it is a major pain in the ass to: 1. download all NMS sources 2. research and note down what changed across versions… So, what we(I?)'ll do is to just account for 1.8 clients, since that is the most used (and relevant) legacy version (at least for publishing a beta in master);
3) Vertical medium-checking order is (currently) wrong: Minecraft checks for water first, then for lava, then gliding, and finally, it falls back to air (Source: EntityLiving.java -> travel() method).
For vertical predictions, NCP check for climbing first (odd one out, because we still use a limit-based implementation for it), then gliding, and then it falls back to vdistrel, which unifies air and liquids.
I chose to trade NMS logic for code readability within NCP. Having two, almost-identical vdistrel methods (one for liquid, one for air) would be extremely ugly.
Still, it'd be best to (pedantically) follow what NMS does.
This could be solved by unifying vertical and horizontal predictions. But… Willpower, I guess? :)

The code is starting to get harder to read too, so perhaps it’s time to merge vertical and horizontal predictions to reduce redundancy anyway.
2024-08-07 21:54:28 +02:00
Lysandr0 89643cc734 Streamline code, much better documentation for several parts of code, refactor ray-tracing/axis-tracing code to an extra package.
* 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…)
2024-08-06 13:40:39 +02:00
Lysandr0 676dedb199 [Bleeding] Support wind charges. 2024-08-03 11:03:49 +02:00
Lysandr0 aa45920d88 Merge branch 'master' into hspeed 2024-08-03 09:12:42 +02:00
Lysandr0 6bb5820e3a Review usage of player#isSneaking() throughout the code. 2024-07-11 23:18:19 +02:00
Lysandr0 39dca7f8b8 Mark "dirty phase" (and related code) as deprecated.
Dirty phase = an air phase affected by velocity.
Very old code that will soon be phased out once we make vDistLiquid predictive as well.
2024-07-11 21:50:42 +02:00
Lysandr0 2e3c7244f7 One more iteration for crouching VS shift key press. 2024-07-11 21:25:21 +02:00
Xaw3ep 867a5b66b4 [Bleeding] Adjustments on snow blocks 2024-07-11 23:49:56 +07:00
Lysandr0 804d5964d6 Make use of findSupportingBlock method for grabbing the correct block-friction.
Also, fix an opsie with the sprinting detection :)
2024-07-11 13:32:17 +02:00
Lysandr0 0dfb553965 [blind] attempt to patch up maybeBackOffFromEdge()
As a bonus: keep track of negligible horizontal collisions; check for Improbable on fake-bed leave packets and do check for enough impulse for sprinting (apparently the game does have such condition).
2024-07-10 16:11:45 +02:00
Xaw3ep 814b48cc3c More adjustments 2024-07-10 19:40:22 +07:00
Lysandr0 dfe93bd98a Several movement-related fixes. 2024-07-10 07:33:07 +02:00
Lysandr0 07f7eba2f4 Further clarify crouching VS sneaking.
Fix some typos
2024-07-09 16:25:39 +02:00
Lysandr0 cceb7cfd30 Patch up vertical bouncing.
Also fix a compilation error.
2024-07-07 13:57:40 +02:00
Lysandr0 0cddcd1ff1 Merge branch 'hspeed' of https://github.com/Updated-NoCheatPlus/NoCheatPlus into hspeed 2024-07-07 09:21:12 +02:00
Lysandr0 7cbd79789e Demote ImpossibleHit to boolean config options, cleanup VIII, fix some issues with Folia and teleportation. 2024-07-07 09:17:32 +02:00
Xaw3ep ea24fa1c57 Fix most horizontal movement calculation errors 2024-07-07 05:39:07 +07:00
Xaw3ep 71252d72cf Working on 1.21
Last version of NCP 3? Too many bugs can't be handle on current codebase. Will now focus on rework.
Changes:
+ Fix fall damage bug with folia on change world
+ Compatible with wind charge
2024-07-04 15:34:32 +07:00
Lysandr0 4a9bccd205 Merge pull request #352 from CMSMortal-chen/patch-1
Fix "Exception with AutoListener"(Maybe)
2024-06-15 23:12:32 +02:00
Mortal_chen 894f3b4779 Fix typo
zombeified_piglin to zombified_piglin
2024-06-01 23:09:16 +08:00