Commit Graph

3275 Commits

Author SHA1 Message Date
asofold
c1b12c3fb8 Clarify INeedConfig. 2017-04-07 14:59:57 +02:00
asofold
4e2ab0164e Towards configurable set back behavior.
* Don't unset teleported, if event.getTo is the same position as the
teleported (set back) location.
* Prepare (with) comments.

(Main driver is to be able to adjust quickly without shifting code
to-fro legacy etc., while dealing with much differing side conditions
for server mod + version, client versions with multi protocol support,
and other like bungee or not bungee.)
2017-04-07 14:45:32 +02:00
asofold
b9aab8513a Hint at something extensible for how to set back technically.
Versions, mods, ...
2017-04-07 13:27:12 +02:00
asofold
ef1d811a4b Set back preparation + confirmation: slight cleanup
* MovingListener.prepareSetBack makes more sense than the previous
ambiguous naming.
* On confirming a set back, don't update the setBack field, only set if
null.

The aim is to have a more consistent handling and naming for set back
stages.
2017-04-07 12:49:23 +02:00
asofold
d88b36d4bc Treat a position (coordinates) match as confirmation of a set back.
More light weight, more lenient (not sure if relevant).
2017-04-07 12:31:32 +02:00
asofold
a5bbd54925 Format javadocs: 2017-04-06 22:38:28 +02:00
asofold
fb056d8e43 Have isLocked be static.
Until it's remade to be all instance...
2017-04-06 20:47:24 +02:00
asofold
aa445edc36 Attempt a hybrid approach for set back handling.
Both schedule a set back and update PlayerMoveEvent.getFrom() with the
set back location coordinates. This way, either the next incoming move
or a teleport event can confirm the set back location.
2017-04-06 19:31:21 +02:00
asofold
6e41730135 [BLEEDING] Quick overhaul for handling scheduled set backs.
When a set back is scheduled:
* Cancel other teleports early. (x)
* Prevent Portal use. (x)
* Vehicle enter (not on vehicle set back). (x)
* Prevent attacking.
* Interact block. (x)
* Break block.
* Damage block. (x)
* Launch projectile.
* Place Block.
* Interact entity.
* Open inventory. (x)

The list is incomplete and adding/removing items remains subject to
discussion, having differing impact/severity for different actions. As
long as setting back rolls back to last ground, it might be better to
prevent some type of actions. Not all cancelling is logged.

(x) Probably most important for consistency, avoiding some types of
potential abuse.

A common framework
for "prevent types of action" during whatever-handling also is something
to consider.

Optimizations: 
* Move handling some rare cases to methods (MovingListener,
PlayerTeleportEvent handling).
2017-04-05 14:31:31 +02:00
asofold
ed6db25338 Comment: More abstraction feasible for loop checks? 2017-04-05 12:43:05 +02:00
asofold
ba4001a0b5 Fix NPE with legacy vehicle API. Use a stored list for null passenger. 2017-04-03 12:16:54 +02:00
asofold
1ac29ee052 [BLEEDING] Try to update passive player passengers data in a useful way.
When the captain leaves the boat, the vehicle data of a passive player
passenger may be set now, so it won't set them back to where they
entered the vehicle.

Likely other places still need adjusting.
2017-04-03 01:15:32 +02:00
asofold
f518371208 Keep that one nms (for old CB for MC 1.11.x versions on maven). 2017-04-03 00:44:14 +02:00
asofold
29e05fe09b Left over set back teleport cause. 2017-04-03 00:34:01 +02:00
asofold
30b9fe5290 [BLEEDING] Multi passenger vehicle set back.
Tested with a pig. It's not nice.
* Vehicle envelope needs a lot of overhaul.
* Force fall set backs may be more nice to have for in-air downwards.
* The set back locations can be from seconds ago, with different
passengers than at the time of the set-back.
2017-04-03 00:28:19 +02:00
asofold
6a7d56c5ac IEntityAccessVehicle.addPassenger, reduce warnings.
Supposedly just making use of altered internal+external API. No
substantial change.
2017-04-02 20:47:24 +02:00
asofold
386d484939 Change TeleportUtil.teleport to PassengerUtil.teleportWithPassengers.
* Removes TeleportUtil.
* Hasn't implemented handling multiple passengers, yet.
2017-04-02 20:24:34 +02:00
asofold
5e751e492b Make PassengerUtil non static.
Some more handling of multiple passengers, incomplete.
2017-04-02 20:05:59 +02:00
asofold
30c3a40622 Towards vehicles with multiple passengers. 2017-04-02 18:55:32 +02:00
asofold
f7a11bbc95 Comments: Attribute.GENERIC_MAX_HEALTH / IGenericInstanceHandle. 2017-04-02 17:49:53 +02:00
asofold
0491fa7805 Use getWidth and getHeight for Bukkit entities, once available.
* Simplify MC version string.
2017-04-02 17:23:17 +02:00
asofold
c017d00866 Don't run legacy sweep attack detection, if the DamageCause exists. 2017-04-02 16:43:01 +02:00
asofold
4d84a9f512 Use MovingData.debug here. 2017-04-02 15:08:27 +02:00
asofold
c5e1f6ba2b [BLEEDING][BREAKING] Player move set back: cancel event + schedule TP.
Because Spigot changed to fire the teleport following an altered move
end point with TeleportCause.PLUGIN, we have to alter set back handling,
so we can ensure to keep TeleportCause.UNKNOWN for setting back players.

Instead of altering the move end point, the event is just cancelled, and
a teleport is scheduled (with a dedicated TickTask method). Uncancelled
moving events mean removing scheduled teleports.

[BLEEDING]
* Comparably simple change - more places and special cases may still be
uncovered.

[BREAKING]
* Plugins that may rely on the exact sequence of things within NCP, as
it used to be.

Random
* Change "set-back" to "set back" everywhere for simplicity, and to
obfuscate the actual code changes.
* Set backs are now going through MovingListener.onCancelledMove instead
of MovingListener.onMoveMonitorNotCancelled.
* Illegal move handling would still use event.setTo.
2017-04-02 15:01:23 +02:00
asofold
8b3dcff7c4 Simplify onTick, let JIT decide. 2017-04-01 18:52:09 +02:00
asofold
d324fc02fd Log details in flylong, and always for file+console.
* Split log messages: ingame vs. console+file
* Alter flylong to contain tags.

Performance-wise, it's not optimal that flylong is the same as flyfile
at this stage. Not sure if to remove flylong in favor of using flyfile,
to indicate it means details - main objective is to get minimal details
into the violation log, even if people edit it out of the ingame chat
messages.
2017-04-01 16:10:11 +02:00
asofold
6aeef95fb7 [BREAKING] Don't use TelelportCause.PLUGIN to avoid confusion (p+v).
Players and vehicles:
Instead always use UNKNOWN, as that is what results from
PlayerMoveEvent.setTo(newTo), as we use it for setting back players.

This should break functionality that relies on TeleportCause.PLUGIN
being used, possibly more likely with vehicles.
2017-04-01 14:29:57 +02:00
asofold
e3d5b70db8 Order.
(See if hooks work now.)
2017-02-22 23:16:38 +01:00
asofold
c046658c86 Allow the elytra model for creative mode, when not flying. 2017-02-22 22:51:04 +01:00
asofold
7ee946c899 [BLIND] Slowness hack for walkSpeed and attributes.
And:
* Move default walkSpeed/dlySpeed constants to Magic.
2017-02-21 19:26:46 +01:00
asofold
0ae9e962ab Add a method to remove all block change entries for certain coordinates. 2017-02-07 22:30:31 +01:00
asofold
514945f936 Cap additum for hacc at 10. 2017-02-05 12:54:25 +01:00
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
b0a9f35f2d Dummy commit to check stuff. 2017-01-17 02:03:16 +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
9dd01a6d59 [BLEEDING] Since builds fail with 1.11, use 1.11.2 here. 2016-12-29 13:46:04 +01:00
asofold
b99fe62517 [BLEEDING] Use early 1.10 and 1.11 for native dependencies.
(Hoping for Jenkins to build.)
2016-12-29 13:42:58 +01:00
asofold
119e664d70 [BLEEDING] Update NCPCompatCBDev to 1.11.2. 2016-12-29 13:34:25 +01:00
asofold
a4e106af52 Don't use the pre-1.11 method past 1.11. 2016-12-29 13:26:33 +01:00