Commit Graph

1217 Commits

Author SHA1 Message Date
asofold
6f1b97c932 Add a simplified method to add custom (fake) block changes.
Internally, the tick is stored with a change id, so we can reuse a
changeId, if the tick is still the same, preserving rough order, as the
changeId should at least increase with the tick.
2017-02-03 23:49:26 +01:00
asofold
6f51fc531b isRedundant: Do check for null before calling equals.
(So far intended use always has an IBlockCacheInstance set.)
2017-02-03 22:58:47 +01:00
asofold
e129b58a6f Expire entries based on interval of validity, if set.
If a position has many entries, the oldest valid state deserves being
accounted for.
2017-02-03 22:07:29 +01:00
asofold
4cc747d8f4 Provide a public method to add custom/fake block change entries.
This isn't the last word on a public API, there likely will be the
following additions.
* One more simplified method with a minimal signature for simple
(non-push) entries (worldId, x, y, z, previousState).
* Optimized methods for adding multiple entries at once. Likely for
adding multiple entries of the same type/data/shape. Plus perhaps
simplified signatures to do without changeId and tick.

(Not sure if there will be need for a method allowing for a collection
of a to be defined class combining x+y+z+previousState.)

This will evolve based on feedback from GitHub issues.
2017-02-03 21:36:41 +01:00
asofold
a4596ede1a Don't skip processing if blocks are there (...). 2017-02-01 17:53:23 +01:00
asofold
72b454bbab [BLEEDING] Elytra boost: Who tested the other version!? 2017-01-29 19:20:47 +01:00
asofold
c2449ac08a [BLEEDING] Elytra boost: track and allow ascend.
Lots of issues remain with elytra, with and without boost. Selection:
* maxheight will trigger with the rocket feature, naturally. Mendable by
increasing it via configuration
(checks.moving.creativelfly.model.elytra.vertical.maxheight). Not sure
we'll just increase the limit or alter how it's dealt with (e.g. also
for sf: lock to a max / high slope value, independently of the set-back
and world height, alter as necessary).
* All sorts of transitions, e.g. onto ground, into water.
* Loss of boost right after adding (not sure if already fixed).
* What with hover, actually?
* Is the flight duration infinite with power 127?
* Issues with ascending after descending, even without boost?
2017-01-29 19:00:52 +01:00
asofold
8237fbca57 Fix NoFall issues on Spigot/MC 1.7.10.
Changes contain:
* MCAccess.dealFallDamageFiresAnEvent -> true
* Always log basic data on (handled) fall damage events.
* Add a tag for the cancel reason with NoFall. Alter the default alert
message.
* Move 3.0 to Magic.
* Set the skipping flag correctly on allowFlight being set.
2017-01-22 23:36:55 +01:00
asofold
5b0807847f Don't give silent permissions as child permissions by default. 2017-01-17 01:03:55 +01:00
asofold
272aaf3063 Don't test block change activity before the extreme move check runs.
(+ only test activity, if the extreme move check was passed.)
2017-01-08 16:17:21 +01:00
asofold
6bcaef9057 Disambiguate + fix redundant method call. 2017-01-08 16:08:21 +01:00
asofold
f560e756f5 isSameShape: with early return on either parameter being null. 2016-12-30 19:16:24 +01:00
asofold
cf04ee5a5d Track the current world name in ChatData for now. 2016-12-29 14:43:10 +01:00
asofold
b6ae8049b7 [BLEEDING] Ignore Minecraft fall distance if it's greater than tracked.
Fall damage is adjusted or cancelled, if the Minecraft fall distance is
greater than the distance(s) tracked by NCP (per move diffs, maximum y).
Intention is to prevent (speeding by) self damage by abusing Minecraft
dealing fall for untracked moves.
Issue: https://github.com/NoCheatPlus/Issues/issues/338
2016-12-29 00:19:55 +01:00
asofold
d85ee35d99 8465c40d93 (commitcomment-20312231) 2016-12-28 21:52:15 +01:00
asofold
8465c40d93 Register .silent check permission in postEnable.
Issue: https://github.com/NoCheatPlus/Issues/issues/353)
2016-12-28 10:37:34 +01:00
asofold
1ba300f3af [BREAKING] Move matchBlockFace to MapUtil.
(Likely no one is using this by now.)
2016-12-27 15:33:36 +01:00
asofold
b406204ce2 [BREAKING] Move isBadCoordinate to LocUtil. 2016-12-27 15:30:51 +01:00
asofold
68eec44f14 [BREAKING] Move LocUtil to utilities.location 2016-12-27 15:28:36 +01:00
asofold
d69dc0b44d [BLEEDING] Double trouble potential: NaN, infinity.
+ random Formatting + random fix (same angle checked twice in TrigUtil).
2016-12-27 15:26:26 +01:00
asofold
17db0bdcfe Comment: More work needed towards null world compatibility. 2016-12-27 15:04:28 +01:00
asofold
9d01191bcd cleanup: null checks. 2016-12-19 07:42:50 +01:00
asofold
dcfdec79e2 Intercept UnsupportedOperationException in getWorldConfig.
TemporaryPlayer issue: https://github.com/NoCheatPlus/Issues/issues/335
2016-12-19 00:11:22 +01:00
asofold
0ea8d379d0 Fix magic not used correctly. Indicate stuff. 2016-12-18 15:11:04 +01:00
asofold
1c024c072c [BLEEDING] First version of horizontal push.
New issue:
* Horizontal push can lead to vdistrel violations with yDistance = 1,
even with air blocks next to the foot position.
2016-12-18 00:33:13 +01:00
asofold
7646476993 Fix nested vehicle check on vehicle enter. 2016-12-17 19:44:40 +01:00
asofold
c9a744a7d3 [BLEEDING][BREAKING] Next step on past bounce with pistons.
Steps done:
* Add more velocity with less preconditions.
* Handle push with the player being just above the block where a slime
block is pushed to.
* Exception for vdistrel.
* Breaking:Move verVelUsed from MovingData to PlayerMoveData.

Gameplay issues remaining:
* Still too often fall damage is dealt.
* Friction envelope gets hidden with past-ground being set too often
(vdistsb).
* Potential for more edge cases.

Missing abuse prevention:
* Reinstate invalidation of past entries (currently turned off to
progress at all, will need another iteration).
* More confined preconditions.
* More/better invalidation conditions for velocity set for bounce
effects.
2016-12-17 15:39:54 +01:00
asofold
cf3ea4a1e2 [BLEEDING] One more step on slimes with pistons.
* Less fall damage.
* Flag all velocity added due to slime bouncing appropriately.
* Experimental concept for splitting up velocity, likely to be altered /
removed.
* Add a flag for (faked) pvp velocity.

NOTE: Invalidation of past entries has been deactivated to progress on detecting the stupid past bouncing at all. This will need another iteration.
2016-12-17 15:02:26 +01:00
asofold
6d28354f11 [BLEEDING] Consider an NPE fixed.
(Assume this doesn't result in an endless loop.)
2016-12-12 20:30:42 +01:00
asofold
6de231ac54 [BLEEDING][BREAKING] Shift entry points for past state bounce.
Lots of issues remain, but vertical push/bounce with pistons is much
improved. Still there are show stoppers (false positives remain, as well
as occasional fall damage).

Use same/similar entry points, like static/classic bounce checking in
MovingListener. SurvivalFly still keeps one exception with the
after-failure Y_POS block move check.

Also check: https://github.com/NoCheatPlus/Issues/issues/5
2016-12-10 21:49:57 +01:00
asofold
9dca93e650 Don't add bluntly redundant block change entries.
Match vs. the last entry of existing entries for those coordinates.
Seems to be better with piston retract events.
2016-12-07 22:18:53 +01:00
asofold
9a6a370f1d [BLEEDING] Adjustments + more slime+piston support (incomplete).
There are typical cases to cover:
* Extra falling height.
* Fall damage where a slime block had been.

Thus adding a specialized method for bounce (just foot position) instead
of using the full bounds would be better, preferably just check within
the MovingListener (set bounce / adjust velocity there).
2016-12-07 22:10:04 +01:00
asofold
06c2cadf7f Add skipping conditions for redstone current change. 2016-12-07 21:18:29 +01:00
asofold
ef9492b0bc Use the activation flag(s). Comments. 2016-12-07 10:12:52 +01:00
asofold
5afcfdea96 Add access methods for getting a BlockChangeEntry matching flags.
(Slime blocks ahead, somehow.)
2016-12-07 00:34:40 +01:00
asofold
0cd07d2f2a COmments- 2016-12-06 15:21:33 +01:00
asofold
602abfe55b Fix margin not being used for hasActivity. Distinguish shuffle.
(+ Set useBlockChangeTracker before testing for bounce.)
2016-12-06 14:26:21 +01:00
asofold
068a523833 [BLEEDING] Cover blocks changed by entities for a change. 2016-12-06 14:11:17 +01:00
asofold
e6673de09e [BLEEDING] Sketch one approach for on-ground with past states.
Still incomplete, could contain bugs (endless loops, perhaps).
Invalidation
mechanics may need to be refined.

Not covered:
* Exemption for moves resulting from horizontal push/pull.

*
2016-12-06 13:28:37 +01:00
asofold
3cd7625516 [BREAKING] Make an extra package for block change tracking.
* Split off the BlockChangeReference, BlockChangeListener.
2016-12-05 14:29:57 +01:00
asofold
da01ac1a48 Not AVR. 2016-12-01 13:09:17 +01:00
asofold
cc52581437 Missing check for null. 2016-11-30 12:42:05 +01:00
asofold
f5396e5d91 Split off lazy expiration from getBlockChangeEntry. 2016-11-30 11:32:48 +01:00
asofold
8e3c4d3b8c Tick should be int for now. 2016-11-30 11:13:22 +01:00
asofold
4e58ff980c Random/ alter on-ground logic (might fix fences+some abuse).
* In case of non-full bounds + variable, allow ground to be found
underneath. Can concern fences (tested on 1.11).
* There has been a probably misplaced/leftover check assuming the block
above to be passable, without checking for it (iMaxY). Since the
access.getMaxBlockY() has already been checked, this part appears to be
not of use, thus iMaxY has been removed from the signature together with
this exception.

If this causes something, please provide debug logs / circumstances :).
2016-11-30 00:35:08 +01:00
asofold
3a6c0a4945 Add block changes via redstone events for door/gate like blocks.
This is unfinished, but gives an outlook on what we may be able to do
with this.
* Double doors are not covered (upper/lower half are).
* Interaction with levers / directly with doors is not covered.
* Only doors + gates (not sure what else there is).
* More fine grained configurability is missing (+ only register
listeners if needed).
* Possibly other things.

Tracking BlockRedstone seems to be more promising than BlockPhysics, as
long as we don't have to inspect neighbour blocks to check for door like
blocks at all.
2016-11-29 15:18:45 +01:00
asofold
26b4c7a376 Prepare adding block changes without direction. 2016-11-29 14:01:57 +01:00
asofold
65777e0e32 Debug log the timing window for the BlockChangeTracker, Adjust comments.
Currently the oldest available entries are used, as if the player had
the maximum allowed latency always. Later on, at least attempting to hit
a global latency estimate (+window) should be attempted.

We'll still have a (moderate) fast-forward implementation to see what
opportunistic checking can do on live servers (elevators, doors etc.).
2016-11-29 13:20:38 +01:00
asofold
00b4dc5545 Format, adapt getCorrectedBounds to use a node. 2016-11-28 23:14:40 +01:00
asofold
380ed8a185 Log resetting of fastconsume data for the obvious spots. 2016-11-28 22:24:51 +01:00
asofold
e926f34963 [BLEEDING][BREAKING] Rework internals to use IBlockCacheNode (rough).
Intention is to work towards passing stored IBlockCacheNode instances to
methods in BlockProperties, i.e. to have
isOnGroundInAnOverlyOpportunisticWay implemented.

If you need one of the old BlockProperties signatures (or a more
simplified one), just open a GitHub issue.

This is a slightly peculiar change.
* Passing node and nodeAbove is a little bit odd, despite seemingly
efficient at present.
* Later we might need a BlockCache instance that busies about past
states (currently too complicated to implement).
* Uncertain impact (could perform better, could perform worse).
* Possibly left out a couple of places.
* Might have introduced bugs (fast forward).

On the other hand there may be a lot of other types of changes, if we
ever go for a less opportunistic implementation, which can not be
estimated simply, so this may be about the best that can be done, to get
a quick step in.
2016-11-28 14:30:57 +01:00
asofold
21505cf4fa Use the appropriate variable here.
Wondering about Double.MAX_VALUE...
2016-11-28 10:14:17 +01:00
asofold
c80ca6c8a6 Split off the per-block logic in isOnGround.
Already have the signature use IBlockCacheNode for node+nodeAbove, like
it will be done with other methods like collidesBlock.

This will allow calling this with past block states, once other methods
have been adapted as well.
2016-11-28 00:07:43 +01:00
asofold
511bcfd4ad More useful method naming and behavior for getting IBlockCacheNodeS. 2016-11-28 00:04:30 +01:00
asofold
4fdca46ccb Cap the message letter count (128 length), to allow 1.11 messages. 2016-11-27 12:14:46 +01:00
asofold
a97ae0171c It's vertical here. 2016-11-26 23:42:18 +01:00
asofold
baf09380f7 Check activity before using the BlockChangeTracker. 2016-11-26 22:57:28 +01:00
asofold
d96abe9a3e Keep track of cuboids of block change activity (resolution of 32). 2016-11-26 22:38:00 +01:00
asofold
c26c3cb0c6 Maintain a validity interval (ticks) of an entry in an efficient way. 2016-11-26 15:55:50 +01:00
asofold
371afd91d0 Need to call updateFinal within MovingListener.
Necessary with multiple checks updating the BlockChangeReference/span.
2016-11-26 14:41:22 +01:00
asofold
5939e1e206 Add per-path build numbers. Activate BlockChangeTRacker by default. 2016-11-26 14:16:08 +01:00
asofold
206d627e9b Skip the legacy bull shit.
(Let's hope this doesn't enable anything unwaynted :p.)
2016-11-25 23:08:49 +01:00
asofold
dec6ef1412 Opportunistic passable checking. 2016-11-25 23:06:06 +01:00
asofold
93b71bb316 Clarify. 2016-11-25 21:29:47 +01:00
asofold
9abe1ae3d2 Move + rename updateBlockChangeRef. 2016-11-25 21:18:20 +01:00
asofold
30979935ce Ensure not to update with an older block change entry. +comments. 2016-11-25 21:08:01 +01:00
asofold
c477f1af72 More neutral naming (rather blockMove than push). 2016-11-25 19:11:47 +01:00
asofold
574390f90d Add 1.11 blocks. Add/alter comments. 2016-11-25 11:32:26 +01:00
asofold
0a834624ac Comment on height150 (with axis tracing). 2016-11-24 16:19:18 +01:00
asofold
ae44be5740 Allow sub classes to query for ignored blocks. 2016-11-24 16:18:31 +01:00
asofold
f372d76272 Suggest removal of world name tracking. 2016-11-24 11:18:21 +01:00
asofold
d01951a10e Use an IBLockCacheNode for passing a node + private constants.
Within BlockProperties BlockCache and IBlockCacheNode ("read only") get
passed, removing id/data/shape from arguments. If a property is not set
in the node, it'll be fetched from the block cache, but the node is not
updated from outside the BlockCache. For subsequent calls, the node
would be updated by the block cache, if it isn't a node stored by the
BlockChangeTracker from an earlier time, and similar.

This way, opportunistic passable checking can be implemented, by
switching to cached nodes instead of id/data/shape arguments with lazy
fetching from BlockCache.

The name IBlockCacheNode seems to be appropriate, since we'll pass it
alongside with a BlockCache anyway.
2016-11-23 23:51:11 +01:00
asofold
85460d5cca Comments (simplify/complement some, add headers). 2016-11-23 21:07:53 +01:00
asofold
bb5afe0d2e Add retention policy etc. to MethodOrder. 2016-11-22 19:09:03 +01:00
asofold
2cf064b3a9 Detect 1.11 horse types.
We do have increased issues on layered snow, possibly due to lost-ground
or bounding box. At least other horse types can be used somehow at all.
2016-11-22 12:35:27 +01:00
asofold
da40bd06e2 Keep track of past block states within BlockChangeTracker.
We only have pistons for now, previous states of blocks are not yet used
for anything with this commit.
2016-11-21 01:09:37 +01:00
asofold
67a500ede9 Implement getBlockCacheNode correctly (no interface). 2016-11-20 23:39:15 +01:00
asofold
cc538ee5a5 First BlockCache implementation using nodes.
(USe bounds instead of shape for the nodes as well.)
2016-11-20 20:36:50 +01:00
asofold
62455f4504 Start sketching out BlockCacheNode use. 2016-11-20 15:11:54 +01:00
asofold
24b45ae5d9 Rename BlockChangeReference.entry to lastUsedEntry, comments. 2016-11-20 14:51:08 +01:00
asofold
7fb1da6dc5 FORMAT +comments +fibbity. 2016-11-19 14:26:03 +01:00
asofold
ba15cfc267 [BLIND] Keep track of the position a player teleports to the end from.
Cross-world teleport to the end issue: set back hard, if the player
moves to the position they set off from the last world, which seems to
be a bug with some server types/versions at present (!?).
2016-11-06 20:04:59 +01:00
asofold
f3eb4f22ff Debug log hacc as well. 2016-11-06 18:48:46 +01:00
asofold
5e2e11dd10 Keep track of the world name in NetData, for use with CatchAllAdapter.
Some packets arrive with a null world for a player, possibly sent by
plugins - thus attempt to use a stored world name.

This is just a hot fix attempt.
2016-11-05 21:13:43 +01:00
asofold
b8746efcb7 Include the entire MC 1.10.x range with ProtocolLib 4.1 and later. 2016-11-02 19:10:46 +01:00
asofold
cad500edc7 Adjust hacc limit for liquid to 1.8.8 clients for now. 2016-11-02 09:50:46 +01:00
asofold
bea35e610a Ensure resetting hacc only happens with head obstructed. 2016-11-02 09:35:19 +01:00
asofold
518f2f08da More block flags: HEIGHT8_1 and ALLOW_LOWJUMP (see description below).
Attempt to enable workarounds for lily pads with servers that support
multiple client versions. Add to the configuration at
compatibility.blocks.overrideflags:
WATER_LILY: default+ign_passable+ground_height+height8_1

HEIGHT8_1 just means 1/8 height (0.125).

The ALLOW_LOWJUMP flag was intended to be used in case of
ground_height+height100 or the like leading to issues with
sprint-jumping due to the low jump detection, however other special
casing checks for bunny hopping let this still fail (less than before,
but still), thus this flag might get removed. Keeping it for now, to
provide some kind of toolkit.
2016-11-01 13:42:05 +01:00
asofold
3d141f3125 [BLEEDING][INSTABLE] Attempt to know when the bloody bunny can't fly.
Technically, tracking actual speed / base speed seems promising, done
here via using the liftOffEnvelope that is maintained anyway, adding a
counter and sum value. [Base speed is something like the allowed speed,
without accounting for specialties like bunny hopping.]

Limits are checked for moving in ground+air or water+air and are
currently hard-coded. This simplistic first-step-in may easily yield all
sorts of false positives and other random issues, handle with care.
2016-11-01 00:40:34 +01:00
asofold
7023fdb2af Fix passable fp with 2-high ceiling.
Can't judge side effects, concerning other passable like tests telling
the head to be inside a block by the micro margin, while passable allows
such a move now.
2016-10-31 22:00:52 +01:00
asofold
48a7e9c0e1 Run passable ignoring sneaking. Adjust box height for REL. 2016-08-07 15:18:45 +02:00
asofold
cec7927850 Allow friction on ladders anyway (not only with velocity set). 2016-08-07 15:18:18 +02:00
asofold
7243ab7538 Quick fix attempt for placed material issues with off-hand. 2016-07-20 10:03:17 +02:00
asofold
514877e1d1 Another reason for dynamic check type registration. 2016-06-27 06:52:33 +02:00
asofold
fc24fe529c [BLEEDING] Overall packet spam check for pre-1.9.
Not sure if this really pays, if most people use protocol-support
plugins that limit packets anyway. There could be some future use, e.g.
generic rate limiting with configurable implementation.

Other:
* New methods for RawConfigFile+ConfigManager to check for
AlmostBooleanS.
* Add all net check permissions to plugin.yml.
2016-06-26 22:18:43 +02:00
asofold
b420f34f23 Add a method to test activation via AlmostBoolean for all configs. 2016-06-26 14:37:03 +02:00
asofold
2623a1ae5c Add a sequence count to DataPacketFlying.
Set with adding to the flyingQueue.
2016-06-25 10:57:43 +02:00
asofold
cce7e76211 The idea of choosing a simple implementation was to skip debugging. 2016-06-24 23:38:27 +02:00
asofold
889d21c1d5 Add convenience method to set the AABB. 2016-06-24 20:54:08 +02:00
asofold
050760afd2 Complete initial draft for ICollideRayVsAABB.
(Blind/untested.)
2016-06-24 20:38:43 +02:00
asofold
a38e63d4a9 Let DataLocation extend IGetPositionWithLook.
(+Implement DataLocation.hashCode.)
2016-06-24 19:15:14 +02:00
asofold
3bdb5414ae Simple and incomplete implementation for ICollideRayVsAABB. 2016-06-24 19:04:44 +02:00
asofold
de2db16d08 Correction/clarify. 2016-06-24 10:09:43 +02:00
asofold
7df0f74d5d vehicle.envelope: Minecarts.
The envelope check will need more adaption for false positives, e.g. for
skipped moves with boats.
2016-06-24 09:55:55 +02:00
asofold
67e7b95901 Allow walking on soil at the reported height (~1.10.2). 2016-06-23 22:41:18 +02:00
asofold
99df1f65da Let's have different climb speed thresholds for ascend and descend.
Configurability ... later.
2016-06-23 20:23:18 +02:00
asofold
c9efd7b76c Add locking against changes to generic registrations.
Let default implementation use registration nodes.
2016-06-22 23:04:44 +02:00
asofold
97129c13d6 Watching football yields... 2016-06-22 18:59:49 +02:00
asofold
f32f4f6080 [BREAKING] Rename ICollide to ICollideBlocks. Add interface.
* ICollideBlocks matches the interface better. If we ever need ICollide
for something common (e.g. set(ICollisionSetup) allows to fetch
information about start conditions and run generic tests !? not really
sure if such will happen...)
* Add ICollideRayVsAABB, to prepare other types of direction/visible
checking (enable more precision, but also configurable leniency).
2016-06-21 10:58:16 +02:00
asofold
863b89763d [BREAKING] Move more classes around.
This time the focus is on the utilities package.

Possibly used, but not really official API:
* Move block cache to a 'map' sub-package.
* Move RichBounds/RichEntity/Player-Location and TrigUtil to a location
sub-package.

Not really official API, likely not used:
* Move AttribUtil to compat, since it belongs there.
* Split off direction check methods to collision.CollisionUtil.
* Move static BlockCache methods to map.MapUtil.
* Move food related methods from CheckUtils to InventoryUtil.
* Move vehicle/passenger related methods from CheckUtils to
PassengerUtil.

Not breaking:
* Move IdUtil to commons.
2016-06-21 09:56:50 +02:00
asofold
2c614cce91 Prepare a more strict fight.direction check. 2016-06-20 22:56:43 +02:00
asofold
d8e8ecdeb0 One more header. 2016-06-20 22:32:21 +02:00
asofold
7130fed017 Add a minimized interface for the odd width and height getting. 2016-06-20 22:21:34 +02:00
asofold
bfc6422115 Move entity last position and look access to another package. 2016-06-20 22:14:35 +02:00
asofold
4653b46579 Quickly add box margins to LocationTrace/ITraceElement.
* Remove SharedContext.
2016-06-20 22:07:53 +02:00
asofold
65525f3c14 [BREAKING] Move interfaces that don't auto register outside of feature.
registry.feature is rather meant for stuff that registers automatically
with adding as a component to the NoCheatPlus API.

Package organization isn't done in a very consistent way, this is just
taking a step into looking at how it would/could look like.

Likely that kind of separation can't be kept, so things will in the end
be organized by their main topic perhaps, and a registry implementation
will have to state what will be registered in what way, and possibly
have a method to allow checking what's possible to register.
2016-06-20 18:51:07 +02:00
asofold
fc90c7ef20 More headers. 2016-06-19 17:27:07 +02:00
asofold
b6088c3e3a [BLEEDING][BREAKING] Registry changes concerning MCAccess.
Main objective is to get rid of too complex setMCAccess methods and to
be able to store handles rather permanently instead.

* Remove MCAccessHolder.
* Add/refine interfaces and implementations.
* Change constructors.
2016-06-19 16:55:44 +02:00
asofold
92252a9dc4 [BREAKING] Rename the new DisableListener to IDisableListener.
(Plus call in reverse order of registration.)
2016-06-19 12:29:53 +02:00
asofold
d4acad924a Change order in onDisable (DisableListener, exemption, hooks).
The idea is to change internals towards having a 'default'
DisableListener executing onDisable before the data removal of checks
and DataManager have been called, thus plugins or even checks might
still access all sorts data with disabling the plugin.
2016-06-19 12:01:37 +02:00
asofold
bb8c8f4156 Add missing GPLv3 headers + accidentally add useless javadoc comments. 2016-06-18 17:57:16 +02:00
asofold
9c9210e411 Make illegal move kick messages configurable. 2016-06-18 17:39:45 +02:00
asofold
307374254b Fixes for handling illegal vehicle coordinates.
* Only load chunks, if there is no illegal coordinates.
* If there is no valid set-back on receiving illegal coordinates,
attempt to recover from past move / current (bug), or kick.
2016-06-18 17:28:50 +02:00
asofold
2bf3e14ab9 More on GenericInstanceRegistry.
* Add a way to stay updated about the latest registration state for a
class.
* Add a class for the registry.
* Let the registry log all registrations.
* Make super interfaces for LogManager (simple logging of
String/Throwable).

Missing:
* More streams (REGISTRY, PLAYER/CHECK_STATUS/EVENTS or just CHECKS at
least). Make status rather the plugin status. Registry could have an
extra file.
* More efficient IGenericInstanceHandle use (wrap + reference counting).
2016-06-16 22:23:54 +02:00
asofold
0868e30994 Allow to detect delegate players for some contexts. Other fix(es).
Attempt to treat fake players less Concept is subject to change, might
want fall-back methods or skipping native access in general where it's
not needed (thus not need to check for native entities).

Other
* Don't insert dataMan into disableListeners twice.
2016-06-16 01:30:19 +02:00
asofold
d5b45e53f9 Add support for IPostRegisterRunnable.
Allows to register with the generic instance registry for another class,
after component registration, with implementing this method.
2016-06-16 00:04:46 +02:00
asofold
77465b09e3 [BREAKING] Move (registry) interfaces to sub-packages.
This is neither complete nor final. Intentions are to group interfaces
better, rather organizing packages in a flat way.

At some point there will be other major move-arounds, but that'll
hopefully be a point where we have a better idea of where to put what
(...). For now the approach is to move interfaces/things rather where
it's not interfering with profane exemption API use, preferably neither
taking down the top level API layer
(NoCheatPlusAPI). 

Added deprecated interfaces to prevent cncp to break too quickly.

Outlook:
* Classes that are rather only expected to be used internally for setup
will likely get moved around freely.
* Classes that have been added since last release might also get moved
around freely.
2016-06-15 16:13:59 +02:00
asofold
87d3e5149b Notes. 2016-06-15 14:40:15 +02:00
asofold
48bc795fd5 Make limiting parameters for block change tracking accessible.
(Not yet in use by default.
2016-06-15 13:51:36 +02:00
asofold
c7f19bdbe6 Add PISTON_MOVING_PIECE as a default exception for now. 2016-06-15 13:50:48 +02:00
asofold
e8ff907f45 Implement peekFlyingQueue. 2016-06-15 01:03:32 +02:00
asofold
f87307562b Make the maximum for the horizontal buffer configurable (sf). 2016-06-15 00:44:22 +02:00
asofold
acca3244a8 Also detect v123.5 for plugin versions. 2016-06-14 10:17:01 +02:00
asofold
b6fa205508 Allow some friction upwards on climbable for now.
Seems to mostly concern receiving velocity when on ground, though.

Issues remain with vdistrel when moving off climbable.
2016-06-14 00:18:41 +02:00
asofold
8aced9d116 Use a class for version checking with ProtocolLib. 2016-06-14 00:16:30 +02:00
asofold
637f94f579 Food level is ignored for sprinting with getAllowFlight returning true. 2016-06-13 14:22:04 +02:00
asofold
e543d905dd Extend debug logging for blockinteract (rate limited). 2016-06-13 13:44:21 +02:00
asofold
d948357b46 Destructive hot fix for item duplication via end portals.
Configurable. Falling blocks, piston, end portal, roughly. Destructive:
the entity is removed.

(In addition some of the feature tags are added regardless activation
flags, because 'ncp reload' could change things anyway.)

Feel free to suggest alternatives/variations...
2016-06-13 00:14:15 +02:00
asofold
5e15dc8c9b [BLEEDING] Load chunks for vehicles too. 2016-06-12 20:23:05 +02:00
asofold
245f5389a0 [BLEEDING] Add the capability to load chunks on moving and teleporting.
Except with join/respawn, the methods will not load chunks if close by
past moves have extra properties set, assuming the chunks are already
loaded then.
2016-06-12 20:07:01 +02:00
asofold
3bfd3a7aff Use a getter for the xz-margin at the used resolution. 2016-06-12 16:55:24 +02:00
asofold
da8b056a69 Decouple legacy code.
Easier to make configurable, easier to remove.
2016-06-11 20:23:36 +02:00
asofold
fec027d41d Comments. 2016-06-11 20:04:38 +02:00
asofold
bd68362197 Implement equals and hashCode for BlockPositionGet. 2016-06-11 19:09:25 +02:00
asofold
6269ca9cb4 Fix standing on TRAP_DOOR (and the like). 2016-06-11 16:38:14 +02:00
asofold
ed10330657 [BREAKING] Remove ignorepassable config support. 2016-06-11 16:37:34 +02:00
asofold
2ff0076e69 [BLEEDING] Switch implementation for moving.passable.
Switch to AxisTracing instead of RayTracing. This means most workarounds
are removed, including some (legacy) performance saving tweaks.
2016-06-11 15:49:49 +02:00
asofold
ec333fb432 Implement ignoreInitiallyColliding for (Passable) AxisTracing.
Not really adding general purpose implementations for
BlockPositionContainer, likely good enough for what we need for the time
being.
2016-06-11 13:50:28 +02:00
asofold
b2d7c29814 [BLEEDING] Alter 'ignoreFirst' mechanics with collision checking.
Change to 'ignoreInitiallyColliding' and only ignore the first block, if
it really is colliding right now. The flag is not resetting with
set(...) anymore.
2016-06-11 12:39:25 +02:00
asofold
720386a0e2 Patch up ascending with minecarts. 2016-06-10 15:12:00 +02:00
asofold
f1ffb23686 Elaborate on ray-tracing with and/or passable.
* Add capability to cut margins opposite to the moving direction for
AxisTracing (extend interface(s)).
2016-06-10 13:36:04 +02:00
asofold
5d0d5d411d Meanwhile ... passable and ray-racing... and fixes.
* Increase precision of debug logging.
* Fix iteration conditions for the axes.
* Fix margins for collidesFence (method + THICK_FENCE workaround
parameter).
2016-06-10 11:29:25 +02:00
asofold
181502cdd4 More on Passable/RayTracing.
* Prepare more debugging.
* Move collides flag into RayTracing.
2016-06-10 08:46:09 +02:00
asofold
19312bdbfa [BREAKING] More on passable and ray tracing.
* Make RayTracing and PassableRayTracing implement interfaces. (rough,
not used in tests yet etc.).
* Optimize ray tracing use in BlockProperties.
* Add an axis-wise implementation (buggy, hardly tested, thus not used
yet).
2016-06-10 00:23:56 +02:00
asofold
765383834b [BREAKING] Generic instance based attribute access.
MCAccess will be split into smaller providers with time, so do expect
more breaking changes of this type. If this is an issue, please contact
us, so we can see how to smoothen things. E.g. we could still make
MCAccess an aggregate, that just delegates to the more fine grained
providers, or we could provide other 
(default) aggregates.

This also adds a Bukkit-based provider for future updates.
2016-06-09 20:14:39 +02:00
asofold
8ba1f2cf74 Minimize code for one generic instance factory instance. 2016-06-09 18:22:23 +02:00
asofold
3cdfa4b971 [BLIND] Add block-info for MC 1.10. 2016-06-09 13:27:43 +02:00
asofold
f2d0123ee0 [BLEEDING] Pigs can climb.
Known false positives:
* Transition to air / blocks above (Step up / other).
2016-06-08 18:52:23 +02:00
asofold
b35805adc8 [BLEEDING] Evolution has made pigs both wider and reach down farther. 2016-06-08 00:10:32 +02:00
asofold
6ff2578653 Fix trap door on top side above ladder.
(Typical last-minute addition over-doing workaround confinement.)
2016-06-07 13:42:18 +02:00
asofold
129733a32f Add groundMinHeight value for THICK_FENCE (1.0). 2016-06-07 13:10:53 +02:00
asofold
ce315664bc Fix block flags set to same values (fences/gates). 2016-06-07 13:04:58 +02:00
asofold
a664686c83 [BLEEDING] Envelope checks for more than boats.
Simplistic in-air treatment and very short testing for false positives.

Unfinished, likely lots of edge cases and issues are yet to be mended.
2016-06-06 22:48:57 +02:00
asofold
2aa14a6d86 Use PlayerMoveData instead of PlayerLocation rather.
More or less random places, where it is easy to overview.
2016-06-06 18:46:27 +02:00
asofold
100d3c8917 1.9.x special case: climbable trap doors. 2016-06-06 17:14:04 +02:00
asofold
785fe554e0 Change config default for 'ingoreallowflight' to true.
Should favor fixing issues with transitions between fly-nofly or
allow-flight-whatever rather.
2016-06-06 11:39:20 +02:00
asofold
016d5894de Add the 'ncp stopwatch' command.
Taken from CG/customplg.
2016-06-03 21:43:08 +02:00
asofold
6e688cc3ff Make boatsanywhere configurable. 2016-06-03 08:59:10 +02:00
asofold
4e91a9d5fc Ready for UEFA EC: GPLv3 headers.
Might need more training still.
2016-06-02 20:33:21 +02:00
asofold
b212440b97 Call removeInvalid more. (+ Use addFirst.)
* Call removeInvalid if many elements are queued on add (cheat not
sending moving events, player takes damage), and on clear, in order to
allow detection of unused velocity with not sending moves.
* Add get+set for unusedActive.
2016-06-02 19:25:40 +02:00
asofold
bc3948cd11 [BLEEDING][BLIND] Debug only: unused vertical velocity.
Simplistic unused vertical velocity tracking for starters. Only
activates with debugging set.
Needs on-the-fly debugging (all) or at least debug set for moving
(config: checks.moving.debug: true), and needs debug set for fight to
check on damage/attack (config: checks.fight.debug).

Method is simple, roughly: Keep track when the player has last been on
ground, or when their head had been blocked. Based on that, we can
attempt to judge if invalidated velocity entries might be cheating. 

There is more aspects to cover, and this is not a check, it just will
debug information to the log file. Would appreciate feedback on if/what
this will log with noknockback cheats on :) (false positives are most
welcome as well).
2016-06-02 11:25:43 +02:00
asofold
6290eb85c6 Remove deprecated default (location trace).
We'll add something that makes sense later on.
2016-06-01 21:23:33 +02:00
asofold
68c4ab2bf2 Review dual wielding.
* Account for off hand in more places.
* Use bridge methods to get rid of warnings for now.
* Adds utility methods to CheckUtils.
* Do not allow left click on off hand (knockback).
2016-06-01 20:00:37 +02:00
asofold
241ff08d47 FastConsume: account for off-hand on cancel. 2016-05-31 08:27:42 +02:00
asofold
5a4f93c1ed Use AuxMoving instead of storing a XyMoveInfo instance. 2016-05-31 08:14:52 +02:00
asofold
184662bb04 Refactor to split off EntityDamageByEntityEvent handler. 2016-05-31 07:36:40 +02:00
asofold
7f2bfe10f4 If there is one thing about contributing that is EASY TO DO IT IS
FINDING BUGS LIKE THIS EVEN SERVER OWNERS FIND THEM WITHOUT LOOKING AT
THE CODE. Then again perhaps, who's in charge of the QR for this
plugin??
2016-05-30 22:48:25 +02:00
asofold
a02c328f33 Simplify (I)TraceEntry: remove lastDistSq. 2016-05-29 20:08:16 +02:00
asofold
2ade022179 Change implementation of LocationTrace. No merging based on distance.
Since merging by distance only creates false positives (one would have
to increase the bounding box for an entry, but the angles would never be
100% right), we never merge, instead we don't add a new entry if the
position is the same, the time value is not updated in this case. For
validity of an entry you always have to consider the time span until the
previous (younger) entry or until now for the latest entry.

Rough changes:
* Use an interface for accessing trace entries.
* Use a linked structure for the actual trace.
* Use maximum age and size to limit the number of stored entries.
* Use a pool to somewhat limit object creation (size may need
configuration or scaling with number of players).
* Since the trace starts empty, have the field be final.
* Keep trace elements if settings are changed, cut size if necessary.
* Remove obsolete tests.

Potentially missing:
* Usage of LocationTrace has not been checked if we need to account for
the time of the latest entry not necessarily being updated (!).
* New tests, e.g. accounting for the expiration of entries.

Follow ups:
* (Extend fight/loop checks to a latency window mechanism.)
2016-05-29 19:35:52 +02:00
asofold
75aa1b500b Use an interface for trace entries: ITraceEntry
Upcoming changes will roughly be:
* Change implementation to a double linked structure.
* Implement/use something like ListIterator.
* Never merge entries, instead use some pool and time/extre-n as limits.
* A basic latency window implementation just for the LocationTrace for
preliminary experiments. [Track hit/miss all time + recent so and so
seconds, some extra cancelling/invalidation mechanics, allow to test
complement 0->window start and possibly window-end-> max latency for
some cases, cancelling mechanics may contain a buffer or a mixture of a
buffer relating to average miss rate]
2016-05-29 15:02:28 +02:00
asofold
2abb502a60 Add configurability for exemption settings. 2016-05-29 13:34:09 +02:00
asofold
22072a2175 SetExemptionSettings has to be a static method. 2016-05-29 13:09:45 +02:00
asofold
fb687970f7 Scrolling to the right. 2016-05-29 12:36:42 +02:00
asofold
347d4d3795 ExemptionSettings: meta data and npcs (no config yet).
Wild card exempt NPCs by default, encapsulate meta data checks here (if
exempted, if is NPC).

With these default settings Citizens NPCs should be exempted by default,
also all custom Player implementations that extend the Bukkit interface
NPC (not sure if such still exists).

Follow ups:
* Configurability.
* Exemption tickets to prevent others overriding your exemptions
(later).
2016-05-29 12:30:30 +02:00
asofold
a161609f14 Ensure we're not the idiots, this time. 2016-05-29 11:25:11 +02:00
asofold
51893791d6 Account for off-hand item in FightListener.
Affects:
* Assumptions about knock back.
* Illegal items check (despite probably obsolete/outdated).
2016-05-27 14:22:45 +02:00
asofold
8cb046a1b3 Cover higher levels of the levitation effect.
Hard-coded-ish.
2016-05-26 12:57:28 +02:00
asofold
ba91842122 Fix dealing damage if getAllowFlight returns true. Keep configurable.
Kept configurable to enable increasing difficulty for fly plugins use,
e.g. to allow players to fly within certain regions, but still deal fall
damage on falling.
2016-05-25 18:55:45 +02:00
asofold
0c6617d636 Player moving: Debug log for states of allowFlight, flying and gliding. 2016-05-25 14:21:53 +02:00
asofold
ec193117ce Debug log view and bottom/top inventory on inventory click. 2016-05-24 17:45:39 +02:00
asofold
f009a14fab Clarify function of this method. 2016-05-23 09:24:33 +02:00
asofold
696b0509c1 Fix npe. 2016-05-22 22:29:27 +02:00
asofold
0d0b42d247 Add hidden configuration for horizontal speed cap for vehicles.
Section at: checks.moving.vehicle.envelope.hdistcap
Default is 4 (extreme move fall-back) at 'default'.
Other entries by bukkit entity type name, if desired.

This allows forcing set backs for testing in a convenient way, e.g. with
setting the value to 0.3 for boat/default.
2016-05-22 21:03:44 +02:00
asofold
a575a9bc05 Review vehicle position resetting.
Main objective was to not reset the set-backs on setting back a vehicle
with a player, plus data resetting cleanup.

Specific changes:
* Prefer an existing set-back, in case the default one has been
invalidated.
* Do not cancel a vehicle set back task, in case no set-back is present.
* Avoid multiple resetting and redundant calls for resetting positions.
* Ensure the location set back to is set as a set-back location after
set back.
* Skip changing vehicle data with player moving resetting (e.g. player
teleport, player morepackets disabled).

Review and possibly correct/alter use of:
* MovingData.vehicleMoves.invalidate
* MovingData.vehicleSetBacks
* MovingData.clearMostMovingData
* AuxMoving.resetXYPositions
* MovingData.clearVehicleData
* MovingData.clearVehicleMorePacketsData
* MovingData.clearAllMorePacketsData
* MovingData|AuxMoving.resetVehiclePositions
2016-05-22 20:10:32 +02:00
asofold
dfb65b23fb Distinguish original vs. final damage for ENTITY_ATTACK check.
This doesn't really change anything, except that it may be performing
slightly better and that it'll log both values if differing on
debugging.
2016-05-22 11:54:43 +02:00
asofold
6f53b63db2 Reset the actual morepackets (vehicle) data on calling that method. 2016-05-21 19:30:31 +02:00
asofold
4818d95d60 Tie "can't handle vehicle..." message to the allow-flight setting. 2016-05-21 17:06:49 +02:00
asofold
c19cd8c435 Don't wrongly return null here. 2016-05-21 16:18:39 +02:00
asofold
2b8dade7d2 More on vehicles (see details).
* Fix scheduling vehicle set-backs: disabled by default.
* Adjust detecting already set set back in morepackets (vehicle).
* Always warn if a set-back gets overridden.
* Adjust debug logging and comments.
* Some data loss.
2016-05-21 16:15:47 +02:00
asofold
980af8d664 Notes, adjust comments. 2016-05-16 22:07:23 +02:00