Commit Graph

3295 Commits

Author SHA1 Message Date
asofold
bfaa71fa5b Use a common method for judging if gliding with elytra is valid. 2017-05-06 17:30:20 +02:00
asofold
c59b4ac11a Hot fix: allow minecraft fall damage in lava. 2017-05-06 15:15:39 +02:00
asofold
7c11fcda9c Comments / format. 2017-05-05 09:35:22 +02:00
asofold
2f66eab079 Reach doesn't need to use the flyingQueue. 2017-05-05 09:24:44 +02:00
asofold
4522bc0cb8 Registration for 'itself' - log as such. 2017-05-04 15:39:46 +02:00
asofold
b62f310717 Work around "server-side-only blocking after respawn". 2017-05-04 15:14:04 +02:00
asofold
6584398d21 Re-check with alternate axis order on collision.
This will not check all possibilities, if default=YXZ fails:
* X or Z collision: test YZX as alternative.
* Y collision: test XZY then ZXY as alternatives.

Would need to check client code, possible of multiple client versions,
considering widespread use of protocol support plugins.
2017-05-04 13:19:56 +02:00
asofold
b38cb4da99 Passable: Prepare fixes. Remove legacy code and options.
New
* Define a couple of default lists for axis order.
* Allow setting axis order via a list.

Removed
* Configuration option to disable ray-tracing.
* Configuration option 'blockchangeonly' - there may be an equivalent
later on, where checking accounts for the entire bounding box(es).
* Legacy code option (things have stabilized and axis order switching
should fix false positives).

Random
* Accidentally commit FastConsume (whitespace).
2017-05-04 13:17:36 +02:00
asofold
e5f6370705 Integrate current look into flying queue checking. Include invalidation. 2017-05-03 15:42:12 +02:00
asofold
54f9d42ca1 Use unified actions for block reach/direction checks, use constants. 2017-05-03 14:59:56 +02:00
asofold
b9a73ae801 Fix blockplace.against. Confine isInteractBlock by tick as well.
(+ Pass tick fetched in listener to other checks as well.)
2017-05-03 13:46:05 +02:00
asofold
e852fb03d2 Fix elytra model not being used when in creative mode.
Levitation will now apply when a player is in creative but not flying -
trial and error!
2017-05-03 11:44:25 +02:00
asofold
73f420527c [BREAKING] Unify block (interact/place/break) direction checks.
Might break configurations.
2017-05-03 00:40:37 +02:00
asofold
2cca81f39a CreativeFly: Test if the player is gliding with elytra not just wearing.
While i can't use the elytra while in creative mode, others might be
able to do so with a plugin.
2017-05-02 21:50:47 +02:00
asofold
bd370ba633 Skip redundant checks within BlockBreak and BlockPlace.
Reach and Direction are near-identical to the variants in BlockInteract
and will be
replaced by implementing an abstract class.
2017-05-02 21:10:18 +02:00
asofold
3ff207d487 Debug log relation with BlockInteract.
Currently typically blockbreak.direction will fail, if blockinteract
used a (the first) flying packet.

Other oddities: Block damage followed a cancelled interact event.
2017-05-02 14:29:17 +02:00
asofold
e5458465ac Attempt to patch up VehicleEnvelope (in-air, boat).
* Issues remain with "moved too quickly" interfering (TP loop with
waterfall/alternating, possible to escape).
* Not sure the previous modeling makes sense at all with allowing
friction now.
2017-05-02 13:41:24 +02:00
asofold
442634793c Keep track of moving event count. Re-introduce morepackets-set-back-age.
Configurable, default to 40 moving events for now. Later to be adjusted
~ e.g. with force-fall set-back policy.
2017-05-02 01:28:39 +02:00
asofold
90d6ab97c5 Change to individual methods to override event resolution. Shuffle. 2017-05-01 13:14:38 +02:00
asofold
c21f1075c9 Re-trigger against only if the last run failed.
This probably is too much of a special case (place without interact?),
might rather hit plugin features. Apart from that, consequently, other
checks should test for this too?
2017-05-01 13:01:57 +02:00
asofold
01b311bcd3 [BLEEDING] Typo.
[BLEEDING] just to note blockinteract changes may alter things.

Currently it looks like only blockplace.against is using the last move
of BlockInteractData - later other checks are intended to use that too,
in terms of a data source.
2017-05-01 12:54:01 +02:00
asofold
c07b1fb8a3 Fix exceptions with the teleport confirm packet (also log cause). 2017-05-01 12:46:37 +02:00
asofold
d8ab00dfb0 More details for last block. Consumed checks. Don't skip item use.
* Store complete event result state for interact.
* Store consumed checks as well.
* Still run the speed check, if only using the item in hand is allowed.
2017-05-01 02:03:00 +02:00
asofold
51d24d1a39 Add option to debug log command actions. 2017-04-30 20:20:42 +02:00
asofold
9f1f3d1525 Add a simplified logOnce method. 2017-04-30 20:14:05 +02:00
asofold
8bf207c112 Log to counters where look came from (current, first/other flying). 2017-04-29 15:19:42 +02:00
asofold
4ab4ebd331 Extend by convenience methods. 2017-04-29 15:18:38 +02:00
asofold
e6cc1bad05 Store passed checks with the last block. 2017-04-29 14:40:44 +02:00
asofold
9f3c10951d The last block is now private.
* Add methods for checking/testing vs. last block.
* TrigUtil.isSameBlock for a block.
* Reset last block on cancel.
2017-04-29 14:27:22 +02:00
asofold
adf8c2b949 Supress this warning. 2017-04-29 14:23:08 +02:00
asofold
e8c4c11bb2 Also activate with ProtocolSupport being present. Adjust message. 2017-04-29 12:19:40 +02:00
asofold
bdf5e7aa71 Extend functionality by adding conditions and allow set to AND/OR. 2017-04-29 12:19:08 +02:00
asofold
d670d8066c Add protocol support plugins, NTAC and PNCP to the related plugins.
Shouldn't have to ask back all the time...
2017-04-29 12:17:38 +02:00
asofold
4c3a9f6378 Suppressed a warning. 2017-04-29 11:54:08 +02:00
asofold
6d16bcea00 Prepare having more of the kind. 2017-04-29 11:22:46 +02:00
asofold
04d5253732 [BLIND] Add a patch for WATER_LILY activating with ViaVersion. 2017-04-29 10:55:15 +02:00
asofold
8cecf92eff [BREAKING] Move Activation to the registry.activation sub-package. 2017-04-29 10:29:46 +02:00
asofold
9d4b88d96a Convenience method added. 2017-04-29 10:24:36 +02:00
asofold
c7d72101c2 Make cancelling flying/waiting packets configurable. 2017-04-29 10:12:18 +02:00
asofold
de0cabd1b8 Set structure void block to instantly breakable and air-like. 2017-04-28 21:53:01 +02:00
asofold
5a901e0f66 Add logDebugS. 2017-04-28 21:46:52 +02:00
asofold
53f534b3c6 Split off logOnce to StaticLog. 2017-04-28 21:44:17 +02:00
asofold
180cf8a3c3 Let blockinteract.direction check queued packets. Unify loop (visible).
* Add a class to loop the flying queue with a block as target (look
only).
* Pass the flyingHandle to sub checks (doesn't necessarily make sense
with reach - should probably re-check reach with the used flying queue
state, but that's more complicated due to the possibility of split pos
vs. look).
* Use the loop class both for visible and direction (not reach).

Likely similar has to be done with BlockPlace and BlockBreak - would be
good to find a skipping heuristic for blockbreak.direction etc., so we
know we have successfully checked that block from that exact position
for this player and nothing has happened between (and so on, or a more
relaxed heuristic).
2017-04-28 19:03:10 +02:00
asofold
970ed6b126 Remove ominous count - all that remainded from the original was...
skipping redundant checking (limiting the number of visited packets
doesn't work - instead 'good candidated' for packet inversion with dig
packets should be stored together, so it's easy to just check vs. the
first/last stored one).
2017-04-28 17:20:24 +02:00
asofold
956c7ca803 Pass a handle for the flying queue to sub checks of blockinteract.
To be done:
* Use yaw and pitch of past packjets for Direction and Reach.
* If block break mathes the last interacted block (+ moving sequence
indicates no change), skip some checks like direction and reach there,
possibly keep track if those were run at all.
2017-04-28 00:27:36 +02:00
asofold
1655a90b2b [BLEEDING] Make use of the 'confirm teleport' packet. Cancel WAITING.
If the teleport confirm packet is available, flying packets with
AckResolution.WAITING will be cancelled.

This is real bleeding edge and might need other adjustments not to
freeze players for to be discovered edge cases. The TeleportQueue
already does contain a timeout mechanism and should return
AckResolution.IDLE after some time.
2017-04-27 12:53:47 +02:00
asofold
6ea30131ca Reduce (player) morepackets data on confirmed set back teleport.
Distantly related: Often an extra flying packet is sent to confirm a
teleport.
Here: Reduce effect of set-back loops with morepackets involved.
2017-04-27 10:34:41 +02:00
asofold
64c347f801 Don't hesitate: make use of the primaryThread flag. 2017-04-26 18:49:21 +02:00
asofold
7d7a0bf010 Add method to pass thread-indicator via an extra argument. 2017-04-26 18:45:28 +02:00
asofold
65fc88f41a Use Bukkit.isPrimaryThread and log inconsistencies. 2017-04-26 18:41:43 +02:00