Commit Graph

2767 Commits

Author SHA1 Message Date
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
bb2c2d0cb6 Note MC versions. 2016-05-11 09:48:49 +02:00
asofold
0bcb994040 [BLEEDING] Compatibility module for Spigot/CraftBukkit on MC 1.9.4. 2016-05-11 00:58:54 +02:00
asofold
0280db5010 Dedicated compat module for Spigot/CraftBukkit 1.9-1.9.3 (1.9_R1). 2016-05-11 00:27:21 +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
db1d15d93a [Bleeding] Allow ProtocolLib 4.0.0 on MC [1.9, 1.10). See notes.
Issues on quick testing:
* End portal seems bugged, resulting in desync, entering in creative
mode. Switching to survival via console allows end portal travel after
kick+relog. Can't tell if this is a 1.9 bug or due to building NCP vs.
an older version of ProtocolLib.
2016-04-02 14:05:44 +02:00