Commit Graph

2780 Commits

Author SHA1 Message Date
asofold
a32bc257f3 Also recognize ProtocolLib versions just with build number prefix. 2016-05-16 22:11:32 +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
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