Commit Graph

978 Commits

Author SHA1 Message Date
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
asofold
23f5e0cc06 [BLEEDING] Force direct teleportation on vehicle set back by default.
Looks like we're running into set-back loops, unless we can control this
otherwise. It's more safe and consistent for our context, however it
leads to nested events. Vehicle exit, player teleport and vehicle enter
will fire from within handling whichever event the vehicle checks got
called from, such as vehicle update, player move, vehicle move.

Possibly some justTeleported flag helps us here. Likely there is no
similar switch that we could use with scheduled set-backs. The proper
option would otherwise be, to use packet sending and/or even cancelling
packets selectively, which would more or less force us to hard depend on
ProtocolLib for supporting basic features of Minecraft, despite possibly
a
sensible move anyway.
2016-05-16 14:50:28 +02:00
asofold
ea4f86c250 Add convenience methods (set). 2016-05-16 14:16:23 +02:00
asofold
0726f9785e Change IEntityAccessLastPositionAndLook to have get and set. 2016-05-16 14:04:18 +02:00
asofold
a0386c6648 Alter selected debug log messages for easier recognition.
* 'set-back' -> 'set back', to get better highlighting with a certain
text editor.
* Log last vehicle position differently.
2016-05-16 13:33:07 +02:00
asofold
43f0201d76 Fix toString. 2016-05-16 12:13:09 +02:00
asofold
420d100150 Fix getLastNonPlayerVehicle use. Ensure positions on vehicle set-back.
Plus random clarify comments/javadoc, more/altered debug logging.
2016-05-16 12:08:21 +02:00
asofold
892944f807 Fix null world after set. 2016-05-16 10:41:00 +02:00
asofold
16647dedec Alter debug logging and exception throwing to track things. 2016-05-16 02:20:56 +02:00
asofold
6fb52915ab Fake vehicle enter on join. 2016-05-16 00:20:43 +02:00
asofold
ddc0111f73 Invalidate vehicle set-back locations on world change. 2016-05-16 00:04:45 +02:00
asofold
171a5ba070 Fix last position access activation when it shouldn't. 2016-05-15 23:28:43 +02:00
asofold
fff9f76980 [BLEEDING] Use past move data for vehicle move checking.
* Implement VehicleMoveInfo and provide via AuxMoving.
* Use MovingData.resetVehiclePositions to reset past location on enter.
* Some auxiliary functionality.
* Route vehicle update and move through the same checkVehicleMove
method, to initialize things, making some decision about what locations
to use for from and to, and to ensure that firstPastMove is set.
* Adjustments and fixes (workaround for generics with PlayerLocation,
LocUtil.hashCode).
2016-05-15 20:57:47 +02:00
asofold
c36f68a829 [BLEEDING][INCOMPLETE][BREAKING][NOT_COMPILING] Changes towards v-thing.
Prepare using VehicleUpdate and PlayerMove instead of VehicleMove for
vehicle moving. This change isn't intended to change
anything/much on the surface.

* Implement native IEntityAccessPositionAndLook for 1.9_R1 and 1.9_R2.
* Alter method visibility and parameters.
* Common pre-conditions.
* Route contents of both VehicleUpdateEvent and PlayerMoveEvent through
a common related method (also named onVehicleUpdate).
* Remove RichLivingEntityLocation, to be able to simplify more.
* Refine interfaces for locations (IGet... ISet... vs, I... for both).
* Implement location related interfaces in some places, related changes.
* Override hashCode for some of the location related classes. Use that
for storing location hashes instead of Location.hashCode. Auxiliary
methods for hashCode in LocUtil.
* Add onIce to LocationData.
* Renaming player vs. vehicles (likely incomplete).
* Possibly other related/random changes.

Line count is high for this change, despite not so complex. Next step is
to change VehicleChecks to use past move tracking to estimate from where
a vehicle is moving (left not compiling). Due to the lack of teleport
events, and due to entity last location being mostly useless, we have no
choice but to hard-set-back on anything that looks strange.
2016-05-15 00:54:15 +02:00
asofold
8bc696afdb Vehicle update: Only debug log if debug is set. 2016-05-13 10:24:30 +02:00
asofold
d5658cfddf [BREAKING] MoveInfo as generic super class of PlayerMoveInfo. 2016-05-12 16:03:26 +02:00
asofold
929578acf5 [BLEEDING] Common super class for PlayerMoveData and VehicleMoveData.
* Now MoveData is the common super class of the above.
* MoveTrace has a generic type parameter for the MoveData sub class.
2016-05-12 01:00:13 +02:00
asofold
970915ccf7 Refactor past move tracking. Few related changes for resetting logic.
Roughly:
* Encapsulate past move tracking in a MoveTrace class.
* Have playerMoves and vehicleMoves (the latter unused).
* Resetting method for both player+vehicle including more packets each.
* Don't reset vehicle data on game mode change.
2016-05-11 23:30:30 +02:00
asofold
a41ff38c99 Attempt to fix cross-plugin StackOverflowError with inventory.open.
Not sure who started this, but apparently...
* NCP closes an open inventory, leading to an event for that.
* Due to the player having an item on the curser or similar, an item
drop event is fired.
* WorldGuard will kick the player due to a blacklist event.
* NCP will detect an open inventory and attempt to close it, resulting
in looping this.

Fix attempt (blind) stores the uuid of a player and skips further nested
closing of inventories.
2016-05-11 21:44:54 +02:00
asofold
368f2fb5f1 Dent into things: Towards unified data structures for moving.
Moving players and vehicles. Part evaluation, part preparations.
* Use more minimized types to demand for MoveData.

Likely future changes:
* Split MoveData into base MoveData extended by PlayerMoveData and
VehicleMoveData.

Might follow up:
* Might have a MoveDataStore providing the past move tracking in an
encapsulated way. To be used for players and vehicles.
* Attempt to have easy to share common auxiliary mechanics, so things
like 'mightBeMultipleMoves' and some of the associated resetting logic
can be a common routine for both players and vehicles.
* Similar.

Might follow up later:
* Don't laugh: consider lost ground to be made abstract enough to be
used for both players and vehicles.
* Track vehicles independently of players (tandem fly!).
2016-05-11 15:11:11 +02:00
asofold
554c8635e7 Sketch a reflection based provider for IEntityAccessLastPositionAndLook.
Directly following:
* Boat fly check based on VehicleUpdateEvent and fetching last pos.
* Implement a native access based provider for
EntityAccessLastPositionAndLook, after testing the reflection based one.

Likely following:
* Implement the same fly checks based on PlayerMoveEvent for horses and
pigs too, for the case server-side fly checking is disabled.
* Configurability for individual types of enbtities, at least a flag for
activation.
* Not sure if a fall-back to VehicleMoveEvent should be kept, setup
shouldn't be all too complicated.
2016-05-11 11:24:11 +02:00
asofold
43db457a57 Fix getting the bottom vehicle. Added logging to discover. 2016-05-10 22:57:25 +02:00
asofold
e3aa28d388 Prepare accessing last position for entities. 2016-05-10 22:29:45 +02:00
asofold
2281ba9d29 Make the denylogin message configurable (strings section). 2016-05-07 14:13:43 +02:00
asofold
beac108456 Notes on notes. 2016-05-07 13:52:36 +02:00
asofold
47e17b3bfc If no more-packets set-back is there, use the ordinary one. 2016-05-07 13:39:12 +02:00
asofold
ba5b38dd41 Code removed wrongly. 2016-05-07 13:30:24 +02:00
asofold
32ba3912c6 Notes on meta-data lookup, names. 2016-05-07 13:23:52 +02:00
asofold
25499d2f0e Corrections and adaptions for moving.vehicle.envelope and boats.
* Set-back handling: Use the last safe-medium set back for now.
* Parameters/magic.
2016-05-01 15:22:17 +02:00
asofold
ab5ca5c9dc Add a workaround case for skipping a vehicle move event. Adjust ids.
* Add a late in-air phase skip once workaround.
* Adjust oddSlope workaround ids to be lower-case and not contain wrpt.
* Add workaround counter for back to surface.
2016-05-01 13:46:02 +02:00
asofold
f9d0a1a6ca [BLEEDING][INSTABLE] Something for boats. 2016-04-30 17:37:51 +02:00
asofold
f27ac307ff OOPS. 2016-04-29 20:28:43 +02:00
asofold
3f00f73d40 [BLEEDING] Make use of DefaultSetBackStorage for vehicle set-back. 2016-04-29 18:56:40 +02:00
asofold
5b8039c5ae Refine location interfaces. Continue (Default/) SetBackStorage, naming. 2016-04-29 16:31:49 +02:00
asofold
64cbab1b0a [Breaking] More on locations and set-back.
* Create interfaces for positions/locations. Use in RichXYLocatio,
TrigUtil.
* Add a basic implementation for isOnIce to RichBoundsLocation.
* Optimize prepare in RichBoundsLocation.
* [ONGOING] Elaborate on SetBackStorage.

Breaks access to Trigutil and RichBoundsLocation, thus PlayerLocation.
Recompiling should solve issues.
2016-04-29 14:10:35 +02:00
asofold
9249cb2996 Unify locations on debugging (DebugUtil). Remove formatted locations. 2016-04-26 22:49:05 +02:00
asofold
60a00bf2f1 Piston not so special case. 2016-04-26 22:30:07 +02:00
asofold
96d95dff8e [BLEEDING][INSTABLE][BREAKING] Changes (see detailed commit message).
Major: Sketch vehicle envelope check.
* Renaming fields, methods, packages. Moving classes to other packages.
* Additions and refactoring for set-back handling and location tracking.
* Increase amount of debug logging.
* Adjustments to current vehicle set back handling.
* AuxMoving: call clear() on setMCAccess.

Minor: Adjust block change tracking implementation.
* Use a class instead of an id, in order to keep track of used entries.
* Allow reuse of an id, if the block still is intersecting.
* Improves situation for simple setup, issues remaining:
 * Random UNKNOWN teleport by server potentially interfering.
 * Distances > 1.0, possibly resulting from split move handling.
 * On-ground estimation and passable.
 * Blocks with gravity are worse (likely on-ground).
 * More in-depth checking of constraints of implementation.
 * Note that the block change tracker currently is disabled by default.
2016-04-26 13:31:20 +02:00
asofold
305e1b1a7e Allow vertical velocity on climbables. 2016-04-23 14:55:08 +02:00
asofold
557208c9b3 Avoid setting the vehicle more packets set-back early. 2016-04-22 20:57:25 +02:00
asofold
d3de47fd69 Use RichBoundsLocation instead of PlayerLocation in TrigUtil. 2016-04-22 20:36:33 +02:00
asofold
1e6ac0f24f Ensure to have the vehicle morepackets set-back early. 2016-04-22 19:56:18 +02:00
asofold
c98f883dea Adjust rich locations (method order, prevent super class set). 2016-04-22 18:34:21 +02:00
asofold
909e6d5404 Vehicles: Prepare new checks and use correct config paths.
Naming:
* Possibly not final.
 * survivalfly: Does not fit at all.
 * Separate official checks + sections for speed and fly: nope.
 * runfly: not running.
 * speedfly: mix up with too fast flying.
 * moving: too much redundancy with moving.vehicle.moving
 * envelope: so and so, possibly better with tags to be set.

 Content:
 * Prepare a vehicle moving envelope check (just basic pre-coding
bookkeeping and refactoring).
2016-04-22 18:11:41 +02:00
asofold
ecf0c996cd Format this. 2016-04-22 17:05:06 +02:00
asofold
28d6809c22 Prevent setting the morepackets set-back, if newTo had already been set. 2016-04-22 17:01:20 +02:00
asofold
9c925f422b Optimize the preconditions for morepackets (player). 2016-04-22 16:53:28 +02:00
asofold
6625470501 Allow morepackets(player) to override the set-back by other checks.
This is meant to prevent packet based speeding, employing micro
violations of other checks, in order to erase the morepackets data.
2016-04-22 16:31:04 +02:00
asofold
067497fb25 [BREAKING] Missing vehicle renames. 2016-04-22 16:15:08 +02:00
asofold
b6228e417e [BREAKING] Rename fields from morePacketsVehicle... to vehicle... 2016-04-22 15:27:57 +02:00
asofold
a8954ad458 Moving: Move player checks into a player package for now. 2016-04-22 15:00:42 +02:00
asofold
b747678f26 Reorder methods. 2016-04-22 14:50:58 +02:00
asofold
5d595cd275 [BREAKING] Prepare more refined vehicle checks.
* Split vehicle checks to another class. Needs refactoring.
* Add ability for simple generic instance registration by an interface.
* Add new sub check type MOVING_VEHICLE, with configuration section,
move existing stuff there (moving.vehicles.., morepacketsvehicle).
* Breaks at least the use of check type MOVING_MOREPACKETSVEHICLE.

FunFact:
* Try CheckType setup with MOVING_MOREPACKETS_VEHICLE(MOVING, ...) to
see why there is a test for this kind of thing.

Bugs:
* Old configuration paths don't seem to get removed with @Moved.

Missing:
* More refined vehicle checks.
2016-04-21 15:57:18 +02:00
asofold
6f95111304 Elaborate on PlayerLocation super classes.
* Alter visibility of some fields.
* Do add RichLivingEntityLocation.
2016-04-21 14:20:57 +02:00
asofold
44a2a7af97 Make PlayerLocation have super classes.
No public method signature changes, but methods are moved to super
classes.

Likely not the final word. Think of RichLivingEntityLocation (horse head
bump, ...), and using more clean setup methods, as well as a better
implementation for isOnIce and similar.
2016-04-21 02:36:50 +02:00
asofold
dcde95f6f9 Enable assumed pvp knockback velocity past MC 1.8 by default.
(Instead of disabling it with 1.9.)
2016-04-20 23:36:38 +02:00
asofold
dac45b6780 Use end crytsal from bridge (don't crash on pre-1.9). 2016-04-11 02:19:14 +02:00
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