Commit Graph

911 Commits

Author SHA1 Message Date
asofold
de49f6dbe8 Initialize missing counters. 2016-04-11 02:14:09 +02:00
asofold
0b6f5b456e Add workaround counters to oddSlope. 2016-03-28 21:36:57 +02:00
asofold
a00b6a53b5 Fix issues with respawning ender dragons (block place reqach+distance). 2016-03-26 02:42:35 +01:00
asofold
c138d972f8 Cover MagicAir.venvHacks with workaround counters.
* Several more to go :p.
* A command for logging global/per player/checktype!? is still missing.
2016-03-26 01:23:39 +01:00
asofold
81b0c9441a Log just used workarounds on debug. 2016-03-26 01:01:44 +01:00
asofold
752e130640 Adjustments for elytra and creativefly default model configs.
* Allow moderate ascending with elytra.
* Let ground be true by default.
* Disable some stuff for spectator mode by default.
* Alter logging.
2016-03-26 00:19:20 +01:00
asofold
8a82b23b99 Confine cobweb workaround by set-back distance. 2016-03-25 17:43:47 +01:00
asofold
60ab3c9717 Better naming for sfZerovDist (+Repeat), don't restrict by hDist. 2016-03-25 16:14:24 +01:00
asofold
677622ac66 [BLEEDING] Use 1.9 API to detect actually using elytra. 2016-03-23 22:35:09 +01:00
asofold
8353bdbfbe Quick and dirty: noob tower. (Might still need review for exploits.) 2016-03-22 19:19:56 +01:00
asofold
336b518082 "Quickly" add lostground and a few specific workarounds to creativefly.
Later the ordinary envelope should be checked by survivalfly, possibly
adding exceptions for specific side conditions, e.g. elytra is worn.

Could lead to unifying cf + sf some day, rather using different kind of
sub-check methods, depending on side conditions (flying, allow flying,
elytra, ...).
2016-03-21 18:13:25 +01:00
asofold
206c985a08 Split off checking for glide envelope with horizontal gain to magic. 2016-03-21 15:54:25 +01:00
asofold
395de51ddb Indentation, visibility. 2016-03-21 00:03:32 +01:00
asofold
b131750bc7 Move lost ground code to magic.LostGround. 2016-03-20 23:48:21 +01:00
asofold
27abbfc25f WTF elytra + end rod.
(Remove wrong pre condition for elytra: have end rod somewhere.)
(Prepare using survivalfly for elytra, not sure if will do so.)
2016-03-20 22:20:57 +01:00
asofold
48bf891bb4 Tackle some of the issues with Elytra but without end rod (unfinished).
Missing:
* More testing and adjusting.
* Other cases found, but not yet done. E.g. multiple 0-ydistchange.
* Jumping with oddd gain (2x 3.8 instead 0.42 + 0.33333).
* Lost ground and all the cases apply here (use only sf or refactor).
2016-03-20 15:20:09 +01:00
asofold
2c46f5240a Remove modsprint from levitation, since modifiers set to false does. 2016-03-20 12:08:40 +01:00
asofold
1b85e918dd Move default yOnGround constants to Magic. 2016-03-20 12:01:34 +01:00
asofold
56f217c9f2 Log in survivalfly, if the player is wearing elytra, but no end rod. 2016-03-20 11:42:16 +01:00
asofold
ff12a15c97 Increase default login ticks to 60 for hover. 2016-03-20 11:34:31 +01:00
asofold
26766095fe [NOTEWORTHY] Fix player instances being stored, though shouldn't.
The static stuff might need a cleanup (removal).
2016-03-20 01:34:08 +01:00
asofold
bc30368f1c [BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.

This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 13:29:21 +01:00
asofold
1e01ad8678 [BREAKING] Change creative model config paths. Rename ModelFlying.xy. 2016-03-18 15:15:27 +01:00
asofold
de5533a1bd Support adding more complex definitions of moved config paths. 2016-03-18 14:31:19 +01:00
asofold
3b1260bf57 Add missing check to.isOnGround() to creativefly step_up. 2016-03-18 12:37:15 +01:00
asofold
5629bfe009 Get rid of creativeFlyPreviousRefused. Only reduce vl if no violation. 2016-03-18 12:29:57 +01:00
asofold
9c784cc6a1 Make logging in creativefly more similar to survivalfly. 2016-03-18 12:24:13 +01:00
asofold
1bf61815f3 Increase the horizontal speed limit for elytra.
Since sprint mod doesn't apply, 400 has been even lower than the maximum
spectator mode speed. Likely the old config paths will be deprecated
soon.
2016-03-18 12:18:47 +01:00
asofold
51885cdc56 First version of sweep attack compatibility. 2016-03-18 10:28:33 +01:00
asofold
bbf3baa9ff Fight: more debug logging, confine thorns workaround. 2016-03-18 10:11:58 +01:00
asofold
f3d4941a6f Force disable FastHeal on Minecraft 1.9 and later.
Assume player ticking changes covering this.
2016-03-15 23:57:23 +01:00
asofold
0be4373310 Allow step up. 2016-03-12 22:52:39 +01:00
asofold
c5bda06745 Prioritize flying over elytra. 2016-03-12 22:52:17 +01:00
asofold
ca71865589 Attempt to catch https://github.com/NoCheatPlus/Issues/issues/94.
Couldn't reproduce, set more lenient margin on a workaround.
2016-03-12 16:52:53 +01:00
asofold
8c1b21a96c Move code between classes of magic. More on splash moves.
Move/split:
* Generic/general/multipurpose stays in ...moving.magic.Magic.
* vDistAir -> MagicAir.
* vDistLiquid -> MagicLiquid.

Workarounds:
* Splash moves up/down (higher speeds).
* Other adjustments (in-water near-zero inversion thing).
2016-03-12 16:42:11 +01:00
asofold
8b6d1324a3 More splash moves. 2016-03-11 01:36:47 +01:00
asofold
783b89649f Delegate some rare checking to methods. 2016-03-10 23:08:54 +01:00
asofold
b0caec08d2 Ensure a set-back is set in the MovingListener with one method.
Unifies treatment of cf+sf after data reset or certain issues after
join/respawn.
2016-03-10 22:31:01 +01:00
asofold
7dcbe3df6b [BREAKING] Create a common interface for per-player debug messages.
Breaking, because it alters Check, CheckListener and BaseAdapter. Not
really meant/possible to be used by external plugins, though.
2016-03-10 22:24:31 +01:00
asofold
8d43b0abc5 Keep track of ModelFlying in MoveData. 2016-03-10 20:00:23 +01:00
asofold
ca8cbdaf05 Allow ProtocolLib 3.7.0 as well. Move method code to GenericVersion. 2016-03-10 19:39:38 +01:00
asofold
cb50f2cc61 [BLEEDING] Remove pvp-knockback workaround with 1.9 (read on).
If false positives with players receiving knockback from pvp hits
increase, setting checks.fight.pvp.knockbackvelocity to true instead of
default will force-activate the workaround.

Debug logging would reveal if this works or not. If the velocity events
fire correctly, the horizontal components will be clearly greater than
zero most of the time with pvp hits. [Can't test this right now.]
2016-03-09 11:57:02 +01:00
asofold
81c74441da Fix rush auto suggestion. 2016-03-07 22:54:48 +01:00
asofold
d34679371d [BLEEDING][INSTABLE] First rough levitation + elytra support (read on).
Very coarse modeling, players likely are able to abuse this and there
are verly likely more false positives.

Especially elytra will have issues:
* Players can fly very fast.
* Elytra will make players fly even faster than the set limit, resulting
in false positives at some point. Setting the allowed speed that high
will yield the problem of players being able to abuse even worse. Thus
limiting to the speed of spectator mode. Modeling will be changed  to
accomodate for gain vs. max. distance and other.
2016-03-06 14:46:45 +01:00
asofold
e58b334911 Correctly note '1.9' blocks. Fixes Issue #109. 2016-03-05 13:07:36 +01:00
asofold
65c4815f14 Add rough values for 1.9 blocks. 2016-03-04 21:44:51 +01:00
asofold
c22126449b [BLEEDING] Dedicated MCAccess for 1.9.
This won't cover all effects of internal changes, some blocks might be
interpreted wrongly still, some shapes may have changed in an
incompatible way (e.g. skulls).
2016-03-03 20:11:46 +01:00
asofold
c800b55d62 Prepare detecting other flying methods. Accidental import organize. 2016-03-03 16:48:55 +01:00
asofold
7d2c1ce1f8 Re-enable split move handling for MC 1.9. 2016-03-03 15:45:48 +01:00
asofold
9be2cd2400 [BLEEDING] Allow ProtocolLib 3.7 and disable SoundDistance on MC 1.9. 2016-03-02 19:49:02 +01:00
asofold
3c3ae4b351 Quick workaround for split moves (disable handling).
https://hub.spigotmc.org/jira/browse/SPIGOT-1646
2016-03-02 18:53:20 +01:00
asofold
bb6672630e Delegate testing for presence and level to generic methods. 2016-02-28 22:10:30 +01:00
asofold
557373ad0e Fix NPE with time running backwards. 2016-02-18 10:03:51 +01:00
asofold
5f41715fe2 [BLEEDING] Add early check for extreme moves (sub check of sf/cf). 2016-02-16 12:18:02 +01:00
asofold
10a1d1ffed Allow using blocks with boat in hand. 2016-02-16 12:07:44 +01:00
asofold
4599194eb0 Clarify javadocs. 2016-02-16 10:46:42 +01:00
asofold
e958e6ef7a Add Check.executeActions with IPenaltyList as extra argument. 2016-02-14 13:35:19 +01:00
asofold
0915acdee6 Use a provided interface to fill in input-specific penalties.
This seems to be more appropriate, for the case of multiple checks
triggering, but also for better performance, in case the check doesn't
even support input-specific penalties.
2016-02-12 00:51:18 +01:00
asofold
851203edb9 [BREAKING][BLEEDING] Adjust the API to the upcoming penalty framework.
This is a first step in, which doesn't change the default behavior,
however it might break plugins that rely on certain internals.

PenaltyAction allows to do something with probabilities to consider,
including the possibility to select the first applicable penalty or
applying several penalties. There will be player-specific penalties,
which are applied during ViolationData.executeActions always, and there
will be input-specific penalties, e.g. for applying within the event
listener.

Potentially breaking:
* Return value of executeActions is now void for Action + ViolationData.
* Return value of Check.executeActions is ViolationData now.
* CancelAction is now extending PenaltyAction.
* CancelPenalty may cancel, but might not, due to probability.
* IViolationInfo.hasCancel -> deprecated, now returns willCancel().
* IViolationInfo.willCancel is now used, applicable penalties are
estimated on creation of ViolationData.
* Custom actions can no longer be used to cause cancel. Only penalties
can do so now (due to the return type change). CancelAction is still
there to keep a simple action for canceling.

Not yet:
* InputSpecificPenalty support for fight checks and using them in the
default actions.
* Configuration for penalties (currently only a plugin could override
the action factories, later penalties may have a probability to apply,
reference each other, allow first match, apply several at once).
2016-02-10 00:28:57 +01:00
asofold
8d6b930166 isHeadObstructed: Throw an IllegalArgumentException on margin < 0.
(Shouldn't fix anything.)
2016-02-09 14:46:07 +01:00
asofold
14e4620b76 Fix violation being added twice for display. 2016-02-08 20:36:16 +01:00
asofold
5e1c71b451 Just start small (Bukkit.getServer() fails on tests). 2016-02-08 01:53:40 +01:00
asofold
302b1ec824 PlayerPortalEvent: add to debug log, don't reset data if to is null. 2016-02-08 01:10:34 +01:00
asofold
f6a004015d [BLEEDING] Prepare 'data removal light' for time running backwards.
Introduce an interface to indicate if a CheckDataFactory or IRemoveData
instance can do something better than removing all data, in case the
system time ran backwards. An extra method in data manager is used
instead of clearAllData, which will test for implementation of that
interface. Concerns CheckDataFactory instances accessible via CheckType 
and IRemoveData instances registered with DataManager (via
NoCheatPlusAPI or directly).

Implementation details and related changes:
* TickTask: Let ActionFrequency handle time running backwards (spikes).
* NetData/Factory: Use HashMapLOW. Selectively clear/adjust.
* MovingData: Keep past move tracking (and some other).
2016-02-08 01:03:27 +01:00
asofold
7360e33930 Set version to 3.13.7-RC for release.
Just to have something above the too old releases.
2016-01-31 17:15:19 +01:00
asofold
cc68a52ac4 Use one generic instance for Random. 2016-01-30 14:32:28 +01:00
asofold
f87870b1a8 Adjust things for a low ceiling. 2016-01-29 00:06:08 +01:00
asofold
9aabb113e0 Change all protected visibility to private for now. 2016-01-28 12:33:04 +01:00
asofold
27e30ce29a Javadocs/comments. 2016-01-28 10:26:32 +01:00
asofold
f057f39fde Can't increase to 0. 2016-01-27 10:14:43 +01:00
asofold
f22bf88824 Adjust checking for 'head obstructed'.
Remove ambigue method, apply a different default margin, up to the next
block in steps of 0.25, if within 0.35 reach.

Default methods use this correction now, so some places might check with
too high a margin now.
2016-01-27 00:34:12 +01:00
asofold
36c018bc3c Use the bounds coordinates as intended. 2016-01-26 23:51:01 +01:00
asofold
c20d593d42 Fix stepping onto boats. 2016-01-26 21:36:37 +01:00
asofold
8985b67668 [BLEEDING] Reduce fp with blockinteract.visible using ProtocolLib.
Not entirely sure this will still protect from anything, shortish:
* Remove cancelling due to coarse pre-checks.
* Rather correct the end location back onto the end block somehow.
* Retry ray-tracing with the pitch and yaw of past flying packets.
* Let the direction check handle the off-too-far part and let people
blame that one for remaining amounts of false positives.

Missing:
* Should confine by distance to last move, perhaps.
2016-01-26 01:53:40 +01:00
asofold
e278e01a3c Replace ( and ) by ~ in /ncp version. Just BLOCKSMC1_4, no (base).
Doesn't look better ingame/console, but might on GitHub.
2016-01-25 21:49:06 +01:00
asofold
0a32d55039 Swap player name and check type for standard format. 2016-01-25 21:23:30 +01:00
asofold
d62ff6754a Move moving specific logging methods back to the moving listener.
* Make them private methods.
* Use standard log message prefix (add a method for that to CheckUtils).
2016-01-25 21:10:42 +01:00
asofold
f6dfa51efe Alter tags in blockinteract.visible. 2016-01-25 20:40:05 +01:00
asofold
544e1ad14e Switch debug messages to a standard format.
Use check-specific debug methods for convenience.
Add to: Check, CheckListener, BaseAdapter.
Relay to: CheckUtils.

Side effects:
* Remove constructor: CheckListener().
2016-01-25 20:35:43 +01:00
asofold
9118aa023a Enable hooks to test for presence of applicable log actions.
This is half a guess on base of a request. Hooks can now check if there
are any log actions, or cast IViolationInfo to ViolationData and query
if anything would be logged to a certain stream.

Alterations pending (allow query for multiple streams or just get
streams/configs, what to have in the official API in IViolationInfo).
2016-01-25 11:00:20 +01:00
asofold
6282a9afbe Add isOptimized() test to Action, GenericLogAction.
This allows testing if the there will be lookups of configuration values
for GenericLogAction instances.
2016-01-25 10:19:51 +01:00
asofold
822cb90410 Allow friction based horizontal distance in creativefly. 2016-01-19 00:20:00 +01:00
asofold
57378a1f11 Make one method for all the oddXYZ stuff. 2016-01-18 18:12:50 +01:00
asofold
2e216c4ada Exclude violation on clearly accepted envelopes early. 2016-01-18 16:17:34 +01:00
asofold
02137600b7 [BLEEDING] Make use of workarounds for a specific case, test-wise. 2016-01-18 00:40:51 +01:00
asofold
567ef1b971 Rough sketch of workaround confinement and statistics support.
Untested, unused. Intentions are:
* Be able to count any use of workarounds.
* Confine workarounds to side conditions, such as 'use once until
conditions are reset' and/or 'only use once conditions are set'.
* Have per-player objects and (attached) global counters.
* (Might think of: disable workarounds by configuration.)
2016-01-17 02:12:00 +01:00
asofold
027079320e Too fast +-. 2016-01-14 23:52:04 +01:00
asofold
88c204dd40 Log the stack trace (once) for improper API access. 2016-01-14 23:47:51 +01:00
asofold
3bcfeffdbf Reset fall distance and NoFall data on a fly-nofly transition. 2016-01-12 00:06:27 +01:00
asofold
3f4cd1008f Cherry pick from pr https://github.com/NoCheatPlus/NoCheatPlus/pull/37
(@Samistine).

Slight deviations:
* Random formatting changes.
* Use a linked list for changedCommands at first.
* Use list.clear after iteration, instead of calling remove repeatedly.
* descendingIterator instead of ListIterator + (has+) previous.
2016-01-07 10:54:33 +01:00
asofold
222a983e34 More margin for falling after data reset. 2016-01-06 23:32:40 +01:00
asofold
6b1277e981 Fix various cases with velocity around lava (swimup, vdistrel). 2016-01-06 10:33:22 +01:00
asofold
1c580c1b08 Attempt to fix bounce with carpet above slime block. 2016-01-06 00:44:47 +01:00
asofold
e54d7a207e Move some code into a method. 2016-01-03 12:41:02 +01:00
asofold
5bbd22db38 [BLIND] Fix after-data-reset workaround (skip_paper): bypass vdistrel
* Add mightBeMultipleMoves to MoveData.
* Use a utility method to test for skip_paper, both on setting
vAllowedDistance for vdistrel and in vdistsb.
* Set the skip_paper tag during setting vAllowedDistance for vdistrel,
as that is always run.
2016-01-03 12:34:43 +01:00
asofold
dcc0ac354b Add oddFriction case (near zero yDistance). 2016-01-02 00:48:35 +01:00
asofold
56666bc8b3 Move most static stuff from SurvivalFly to a Magic class. 2016-01-01 23:38:53 +01:00
asofold
856e723908 Change the 'step' detection.
Catch yDistance between step height and minimum jump gain, let vdistrel
and vdistsb catch the rest. Use the more precise flags of data.thisMove.
2016-01-01 21:02:08 +01:00
asofold
2bb605a497 Add special case using two past moves (rare). 2016-01-01 19:58:58 +01:00
asofold
37c35cd271 vDistLiquid: Extend workaround for second in-medium move (swimdown). 2016-01-01 19:13:55 +01:00
asofold
9e3e1b9774 Add oddGravity case (slightly too small decrease, moving up, velocity). 2016-01-01 18:41:33 +01:00
asofold
daf6ab78d6 Adjust oddLiquid case (moving out of water with velocity). 2016-01-01 18:30:12 +01:00
asofold
6110e9301f [BLEEDING] Split teleport handling to using multiple priorities.
* Cancel/alter on lowest.
* Override cancel on set-back on highest.
* Adjust data on monitor.

Partly simplify, e.g. by just cancelling the event (nothing should
happen) - can't recall if there has been a reason to setTo(setBack)
instead of event.setCancelled(true).
2016-01-01 00:51:22 +01:00
asofold
99598b9490 onPlayerTeleport: Only use ref locally, where needed. 2015-12-30 21:57:04 +01:00
asofold
539294c599 Further simplify onPlayerTeleport (early return). 2015-12-30 21:22:21 +01:00
asofold
65e655a989 vDistAir: Fix envelope for missing/reset past move data. 2015-12-30 20:26:38 +01:00
asofold
6c797f8561 Make 'related plugins' a headline in the 'ncp version' command. 2015-12-28 22:41:48 +01:00
asofold
1dad595faa Reset positions with extra properties, also set medium properties.
* Call both most of the time.
* A convenience measure to have last move ground set, at the cost of
setting it 'too often' (players might not get checked by survivalfly at
all).
* Wrap calls with one PlayerLocation instance, for efficiency.
2015-12-28 22:11:10 +01:00
asofold
67071b3fad [BLEEDING] Add/move typical flags to past move tracking.
Move location-dependent properties from MovingData and MoveData to
LocationData.

Rough list of related Changes:
* Represent from and to positions as LocationData inside of MoveData.
* Have flags for onGround, inLiquid and the like in LocationData.
* Change noFallAssumeGround to touchedGroundWorkaround within MoveData.
* Add touchedGround to MoveData (to|from|workaround).
* (Remove involved properties from MovingData and use MoveData.from/to
instead.)
* Use MoveData and LocationData flags instead of PlayerLocation methods
in more places.
* Adjust various special case pre-conditions, based on past move data.

Other changes made on the fly:
* Allow maximum of jump gain and step height for ground -> ground.
* Add envelopes for vDistAir after teleport/join/respawn.
* Add cases for vdistrel.
* Extend logging on teleport (add cause, log set-back too).
* Reorder/fix vdistsb workaround checking.
* Reorder teleport handling.
* Remove small-range workaround for teleport [uncertain effect].

Immediate future follow ups:
* Attempt to only accept PlayerLocation for various setPositions methods
in MovingData (ensure to set MoveData with extra properties +
simplify/cleanup (public) methods with MoveData/LocationData).
* Relate to past move tracking for more workarounds, either to confine
pre-conditions more (inLiquid instead of toWasReset~somehow), or just to
be able to track a false positive at all (thisMove + 2 past moves
needed).
* (Fixes, etc.)

Distant future follow-up:
* Somehow merge with PlayerLocation, e.g. using LocationData inside
PlayerLocation internally, which means changing raw types to Object
versions, just like it's done inside of PlayerLocation right now.
* Possibly PlayerLocation is transformed to static methods with
BlockCache and LocationData as input.

Expected trouble:
* New/old false positives, due to replacing the fromWasReset and
toWasReset by more distinct flags from past move tracking.
 * A workaround may have prevented other false positives
unintentionally, e.g. had been intended for liquid, but the
to/fromWasReset flags previously did include ground/noFallAssumeGround,
thus the workaround will not cover that case anymore, after the change. 
 * Forgetting something like checking touchedGround and to/from.onGround
or similar as a replacement for xyWasReset.
* Mixing up thisMove and lastMove for touchedGround.
* Mixing up touchedGround and touchedGroundWorkaround in MoveData.
2015-12-28 15:46:31 +01:00
asofold
73cdef5b56 Collect block flags on adjustMediumProperties. 2015-12-26 00:09:22 +01:00
asofold
7be8a9c053 Add convenience methods. 2015-12-25 13:55:03 +01:00
asofold
9b71b25191 Invalidate past move data on leave. 2015-12-25 13:20:24 +01:00
asofold
4730b35c17 Add cncp and ProtocolLib versions to 'ncp version' output. 2015-12-25 00:58:23 +01:00
asofold
b2aae768b6 Support (wildcard) exemption by meta data 'nocheat.exempt'.
This is a first version without any safeguards and without any settings.
A player who has any meta data for 'nocheat.exempt' is regarded exempt
from all checks. Suggestion is a boolean value (true), but setting
anything will do for the moment. Later String values or List<String>
might be supported to allow some kind of generic categories for
exemption (to be discussed with skill plugin developers).

 This is not meant for permanent marking, but rather for "extra" events
like area damage with entity.damage(amount, damagerPlayer). The plugin
setting the metadata should also remove the metadata. In order not to
remove all protection by NoCheatPlus, plugins should fire extra events
or cancel events on a higher priority level than EventPriority.LOWEST.
2015-12-21 22:52:09 +01:00
asofold
d3778bb67c Check for base allowed distance instead of actual in some places. 2015-12-20 22:29:02 +01:00
asofold
ea9198c6fe Set thisMove.flyCheck as early as possible. 2015-12-20 00:45:44 +01:00
asofold
b7af1be275 Store allowed base + actual hDistanceS in MoveData, use on bunny.
To be continued: 
* Relating to the 'allowed base distance' for horizontal moving allows
to judge speed without taking friction or bunny-hopping into account.
* Make use in bunny hop (seems to make 2-high ceiling + sprint jump a
little better).
* Later more workarounds should be confined to a minimum, using
MoveData.
2015-12-19 22:32:11 +01:00
asofold
aaa7f635ab Move more properties to MoveData.
* Namely walkSpeed, downStream.
* SurvivalFly: Alter method signatures to use thisMove rather.
* MoveData: Only initialize the necessary minimum.
* Add MoveData.alwaysInvalidated, to indicate random future purpose.
2015-12-19 19:37:38 +01:00
asofold
3cfa6cfb06 Invalidate currently processed move, if a teleport happened.
Should only be possible to happen, if an actions entry doesn't use 'ncp
delay ...' for teleporting, or if a hook teleports the player (both
discouraged).
2015-12-16 18:39:36 +01:00
asofold
16a1e08f57 [BREAKING] Use MoveData for more 'last123'-type properties.
Does break use of MovingData for last coordinates and distances (not
officially exposed API).

Other changes:
* Position resetting on teleport events has been altered.
* Some blocks/methods are guarded by checking for lastMove.toIsValid.
* Possibly other.
2015-12-16 18:08:22 +01:00
asofold
2145a6a0d3 Don't allow item use on blockinteract.speed violations. 2015-12-15 21:12:33 +01:00
asofold
dab3229066 Add hack for slowness + sprint.
Still needs adjustments to only allow this speed on jumping.
2015-12-15 20:50:49 +01:00
asofold
98df033a7c Store if head is obstructed for past moves and make use of it.
Also:
* Rename the walkSpeed constant to WALK_SPEED (nuisance to mix up).
* Alter conditions slightly in some places by using
thisMove/lastMove.headObstructed.

Issues remaining:
* Moderate speed increase with yDist 0 and hDist like 0.35 -> 0.45.
* Transitions head blocked -> not, can trigger hspeed violations.
2015-12-13 23:19:29 +01:00
asofold
cfc2db97f3 Store past moves as MoveData (raw sketch, no change on logic). 2015-12-13 18:48:42 +01:00
asofold
742877dd6d Adjust use of isHeadObstructed.
* Remove extra conditions for from.isHeadObstructed in vDistAir.
* Account for yDistance in more places. Use the maximum of the default
margin and yDistance.
* Add a tag for not setting low jump, due to the head being obstructed.

Fixes:
* Issues with 2-high ceiling with normal ground.

Issues remaining:
* Ice floor + 2-high ceiling.
* Jump/bunny with head blocked, moving to where the head is not blocked.
2015-12-13 16:39:42 +01:00
asofold
acc3376106 Expect an outgoing teleport for cancelled PlayerMoveEventS.
There is a small chance that other plugin cancel these events. Since the
server ignores event.setFrom for cancelled events and also won't fire a
teleport event, this remains a problematic case.
2015-12-12 15:58:02 +01:00
asofold
bd9f471102 More oddLiquid cases (moving down out of water). 2015-12-12 15:41:19 +01:00
asofold
9dbd721d12 Fight auto-indent. 2015-12-12 14:14:44 +01:00
asofold
71abb63641 Don't add a new entry after merging. 2015-12-12 14:03:31 +01:00
asofold
b0dd8b18ed Update time for stored entries, in case time ran backwards. 2015-12-12 14:02:58 +01:00
asofold
f9f04feee0 Extend margin for PaperSpigot workaround, confine by split move 1.
Add a tag.
2015-12-09 22:14:37 +01:00
asofold
4e0b617bea Add missing return value. 2015-12-09 11:55:25 +01:00
asofold
7db75f4d79 Faster return for packets missing position or look data. 2015-12-09 11:49:19 +01:00
asofold
0fe398c233 Confine PaperSpigot workaround by jumpphase instead of hDistance. 2015-12-09 10:38:04 +01:00
asofold
0ccfe9699f Increase default max age. 2015-12-08 19:24:40 +01:00
asofold
2ac4bc7939 Less comma. 2015-12-08 19:23:00 +01:00
asofold
e82a989119 Use a real queue for TeleportQueue.
Main purpose is to prevent FlyingFrequency false positives with teleport
loops/excess (typically server or NCP set-backs).
2015-12-08 19:18:56 +01:00
asofold
61d58406f7 [BLIND] Add special case to skip vdistsb to prevent a set-back loop.
~ Observed on PaperSpigot 1.7.10
2015-12-08 13:29:29 +01:00
asofold
794fb99d99 Prefer not to use DebugUtil.debug for non-temporary use. 2015-12-07 08:21:23 +01:00
asofold
b2b3ca8dcc Other special cases for water. 2015-12-07 08:18:13 +01:00
asofold
eb3a86857f Sketch block change tracking (incomplete, deactivated by default).
Represents the first "simplistic" approach to block change tracking,
only attempting to make vertical push/pull work.

It seems that we need to add on-ground checking accounting for piston
moves as well, otherwise anything with pistons retracting will lead to
survivalfly violations. Pistons extending and retracting may also
randomly move around players, including dragging them into the piston
block with the bounding box (not center of player).

In order to make on-ground work, we might need to check in another
place, possibly check where resetFrom an resetTo are set. Performance
questions might remain, there might also be a slight redesign necessary,
in order to run some sub-routines more side-effect free, to check
several branches, including after-failure checking.
2015-12-07 07:44:00 +01:00
asofold
dfcc30aed9 Adjust liquid height, fixes jumping on fence with water above. 2015-12-07 07:35:40 +01:00
asofold
4d3ee38881 Remove the strapackets cancel part, only skip FlyingFrequency on ACK. 2015-12-06 23:53:50 +01:00
asofold
067d6298d9 Do move AttackFrequency to NCPCore. 2015-12-06 17:25:34 +01:00
asofold
1d8d2f66c7 Set ignorestance to true on 1.8 and later. 2015-12-05 21:38:52 +01:00
asofold
1053c21e56 [BLEEDING] Partly fix up bunny hop conditions.
Conditions have been warped for some time. Could lead to more false
positives on hdist.
2015-11-29 14:54:24 +01:00
asofold
2e11cdac0b Confine the bunnyhop envelopy by y-Distance further.
* Below 1.7 allow ground-to-ground hop with moderate speed. Might be
there is more speed possible, shortly tested on 1.6.4.
* From 1.7.10 on, hitting the jump envelope or having the head
obstructed is demanded.
2015-11-29 13:04:22 +01:00
asofold
567647fd12 Remove some commented out parts. 2015-11-29 12:36:57 +01:00
asofold
1c07adef1a Account for GROUND_HEIGHT in isPassableWorkaround. Fix end portal frame.
* The GROUND_HEIGHT flag indicates, that players are on ground (and can
walk on) from getGroundMinHeight on, once a block collides. Thus an
extra case for isPassableWorkaround is necessary.
* Set GROUND_HEIGHT for ENDER_PORTAL_FRAME, return the minimal height of
the ENDER_PORTAL_FRAME block for getGroundMinHeight. (Also add XZ100,
just to be sure.)
2015-11-29 09:51:12 +01:00
asofold
7057f8f984 Log getGroundMinHeight, where it differs from maxY. 2015-11-29 09:19:40 +01:00