Commit Graph

3361 Commits

Author SHA1 Message Date
asofold
5d5e45e2df Set default child permissions in plugin.yml. 2018-02-07 16:54:03 +01:00
asofold
6f4c61d8f3 [BREAKING] Remove legacy behavior for notify permissions.
* Remove the old per-world permission cache.
* Use the new permission caching feature.
* Always use permission subscriptions.

Pitfalls:
* Permission subscriptions might fail under certain conditions
(legacy?).
2018-02-07 15:15:34 +01:00
asofold
c50cc4f052 Add child permissions within onEnable already. 2018-02-07 14:46:00 +01:00
asofold
ad87137711 [BREAKING] Fix fall damage with jump effect (for most).
Only count the fall height below the set back y from lift-off (rather).

Breaking:
* Adjust method signatures and public visibility / interface for NoFall.
2018-02-06 14:53:42 +01:00
asofold
f6519ef289 isInfinite... 2018-02-06 13:46:26 +01:00
asofold
658de28fcd lostground: adjust for equipped end portal frame.
Allow slightly lower amounts of negative y-Distance.
2018-02-06 12:36:07 +01:00
asofold
715a49d1bd Passable / initially colliding blocks: catch 1.5 height.
Just check bounds vs. blocks up to 0.5 blocks lower within
BlockProperties.collectInitiallyColliding.
2018-02-06 12:17:27 +01:00
asofold
3c9809817a Improvements on piston + slime block.
Issues with bunny hopping remain (...), but this might help with
elevators.

Use of velocity entries has been made more strict (directly use, remove
previously queued ones).
2018-02-05 23:13:06 +01:00
asofold
c45a31b979 [BLIND] Switch rule definition to a list of strings. (+)
(+) Extend/alter slightly, e.g. added a regex example.

Replacement characters are not needed, and default values won't keep
reappearing.

Tests pending, e.g. dump with the upcoming registry log.
2018-02-02 23:49:58 +01:00
asofold
08aaa5fb1c PermissionPolicy: Rename to/from config. Clarify defaults. 2018-02-02 22:43:53 +01:00
asofold
97d59045ae [BLEEDING][BREAKING][INSTABLE] Swiftly throw in permission caching.
Benefits:
* Improves performance, where permission lookup has major impact, with
timeout based lookup, static permissions (skip permission check
entirely), and world/offline based invalidation. (Once fully
implemented.)
* Hopefully more efficient: use Bukkit Permission for faster defaults.
* (Allows control over how which permission is to be
updated/invalidated, which is useful per se.)

Risks:
* Complex changes yield bugs.
* Other plugins depending on NCP might break.
* Cache incoherence might happen (permissions are changed dynamically +-
unintended malconfiguration, or in case of bugs).
* (Endless loops certainly have all been fixed.)

Breaking:
* Lots of more or less internal API has been changed or removed: Check,
CheckType, CheckUtils, TickTask, ...
* Permission checking behavior has been altered.

Rough points:
* Implement a permission cache within PlayerData.
* Remove the player tasks and permission updates in favour of handling
those within DataManager and PlayerData.
* Adjust everything else to it (partly TBD).
* Updating sets of permissions (e.g. for CHAT) is done more lazily now,
i.e. one per 10 ticks). An actual permission check would still yield an
update next tick (asynchronous).
* Fixed/extended random spots (DualCollection, MiniListener registration
support, StringUtil).

Missing:
* Basic implementation
  * Cleanup after logout (stages: 1. non-essential like permissions,
2. unrecoverable like set-back location, 3. complete data removal).
* Coverage
  * Might have missed spots.
  * NoCheatPlus.nameSetPerms should be replaced by caching + default
config for world-wise updating.
  * Command permissions are always checked. At least for players,
cache based lookup should get implemented.
  * More unit tests.
* Extended configurability: Per-world settings/policies.
* Efficiency
  * Not all parts of the implementation are 100%/optimal yet.
2018-01-30 23:09:34 +01:00
asofold
1de1c37d29 Add getMergePrimaryThreadAndClear. 2018-01-28 17:33:53 +01:00
asofold
e7aa12141a Fix overrides not respecting external side conditions. 2018-01-21 18:56:17 +01:00
asofold
6bf5b4c180 Support configuration for breaking time overrides. 2018-01-21 18:39:32 +01:00
asofold
1a8c292015 Support overriding the block breaking time for specific side conditions.
Relatively cheap addition, done:
* Internal API within BlockProperties.

Missing:
* Support configuration: compatibility.blocks.breakingtime
* Support a command to update by the last n mined blocks (!). Needs
storing all side conditions within BlockBreakKey and convenience methods
for getBlockBreakKey + use internally.
2018-01-21 18:11:03 +01:00
asofold
cdbd49785e Adjust breaking time of stone axe vs iron block. 2018-01-21 16:44:08 +01:00
asofold
6d04795850 Bogo-fix first attack after data removal triggering...
fight.noswing.
2018-01-20 01:03:49 +01:00
asofold
b60d63d2e2 Only accept public methods for now. 2018-01-20 00:50:16 +01:00
asofold
c2dcc600b5 Use public visibility for event handler methods. 2018-01-20 00:37:20 +01:00
asofold
09a963ed49 Add GPLv3 headers where missing. 2018-01-17 23:52:50 +01:00
asofold
37127c1f2b [BLEEDING][BREAKING] Use a new internal event registry.
The old ListenerManager is removed, new system in place. Removed
doesManageListeners(). (The new system isn't that new, but it's been
fixed and adapted to using RegistrationOrder.)

New
* Register all Bukkit events via the new EventRegistryBukkit.
* This way listeners can be ordered by numeric priority and tags
(regular expressions for beforeTag and afterTag).
* Unregistering listeners is possible (a listener node stays in the
Bukkit registry, but only one per event).
* It's possible to add listeners with minimal impact (MiniListener).
* The registry registers by event class 'hard' i.e., no relations
between already registered classes are checked.
* Order isn't necessarily stable nor even reproducible for randomized
start conditions with the same elements.

Point
* Compatibility hooks can easily place event listeners
before/after/between NCP default listeners, without resorting to tricks
like 'load-before'.
* Future registry of NCP itself: unregistering listeners is necessary
for runtime-removable checks, order is useful if not necessary, to be
able to add check listeners at any point of time.

Breaks:
* Anything relying on the previous (optional) managelisteners feature.

Missing:
* Lots of testing/inspection.
* Ensure all NCP listeners are coming with name/tag at least.
* Provide meaningful tags/RegistrationOrder for fine grained access
(e.g. after feature.moving but before feature.inventory).
* Change cncp to hard depend on NCP and use listener priorities.
2018-01-17 12:42:32 +01:00
asofold
f7571dcf2f [BREAKING] Move std. annotations into RegistrationOrder. Add more.
* The annotations made for RegistrationOrder are defined in there.
* Add RegisterMethodWithOrder (method) for event handlers.
* Add RegisterEventsWithOrder (type) for default order with listeners.
2018-01-16 21:08:45 +01:00
asofold
243d8dd6c8 Fix premature non-abort. Return boolean for simplicity with traversal. 2018-01-16 12:02:29 +01:00
asofold
2b469a4613 Add traversal methods. 2018-01-16 11:31:54 +01:00
asofold
c9d2a5de74 Simplify using CheckTypeUtils. 2018-01-16 11:02:34 +01:00
asofold
361b37962d Move methods from hooks.APIUtils to utilities.CheckTypeUtil.
(Not specific to hooks anymore.)
2018-01-16 10:18:55 +01:00
asofold
1d96fb32a1 An unmodifiable list. 2018-01-16 09:53:30 +01:00
asofold
3e81499fa6 Add a CheckTypeTree for fully spanned check-type-related structures. 2018-01-16 00:18:17 +01:00
asofold
532eef14a2 [BLEEDING] Partial overhaul for CheckType.
Yes
* Remove the UNKNOWN type.
* All types except ALL have a parent now.
* All types have a type now.
* APIUtils: Add getDirectChildren for distinction.

No
* APIUtils doesn't collect the descendants in a generic way yet.
2018-01-16 00:10:33 +01:00
asofold
073220cc01 Clarify APIUtils methods meaning by renaming, deprecate former. 2018-01-15 23:19:41 +01:00
asofold
adc0d16d73 Add a type for check types (future may have multiple levels). 2018-01-15 23:07:04 +01:00
asofold
a25dc44501 [BLIND] Include other blocks in the multi protocol block patch, rename. 2018-01-15 22:16:09 +01:00
asofold
e8cf861150 Disable the MultiClientProtocolWaterLilyPatch with unit tests. 2018-01-15 22:00:17 +01:00
asofold
01aaccbf54 Fixes and extension for Activation. (+)
(+) Always return Activation, not IActivation.
(+) Add unitTest() and notUnitTest().
2018-01-15 21:59:39 +01:00
asofold
30b293e735 Rename DummyNoCheatPlusAPI to UnitTestNoCheatPlusAPI for the prefix.
Allows determining the state of the system more easily.
2018-01-15 21:45:41 +01:00
asofold
13b00a6b8e Fix APIUtils not returning an unmodifiable collection. Change to Set.
Using the LinkedHashSet directly.
2018-01-15 21:20:50 +01:00
asofold
5cf2613f36 Should mention... 2018-01-15 13:10:44 +01:00
asofold
def7d61bc5 Test for NPCs with the Inventory.Open check. (+)
(+) Note: If it's fired asynchronously, meta data isn't checked, due to
that not being thread-safe. In future extra checks for (demanded to be)
thread-safe external plugin APIs can be added (reflection only).
(+) Add comments to PlayerData, concerning future treatment of name-uuid
mappings and retaining data.
2018-01-15 13:02:30 +01:00
asofold
7fdd6a586b Register the ExemptionSettings instance in use as generic instance. 2018-01-15 12:31:00 +01:00
asofold
dc4849f3a8 [BLEEDING] Do not delete PlayerData instances for online players. (+)
(+) Add getPlayerName for exact case name getting from internal storage.
2018-01-14 16:31:38 +01:00
asofold
0306e2c982 Add getKeys(), similar to to keySet(), but without option to alter. 2018-01-14 15:47:53 +01:00
asofold
8e11fe8184 removeDataPrecisely: Don't create ANY debug text if debug is false. (+)
(+) Add/alter comments with PlayerData removal.
(+) Remove comment to store PlayerData by UUID.
2018-01-14 14:39:12 +01:00
asofold
46b0b3df02 Set version to 3.16.1-SNAPSHOT for the next iteration of development. 2018-01-14 13:44:14 +01:00
asofold
424b357db1 Set version to 3.16.0-RC for release. 2018-01-10 22:37:28 +01:00
asofold
bc408d2a2c Update links. 2018-01-10 12:50:51 +01:00
asofold
27b1ee4347 Surgery. 2018-01-10 12:48:17 +01:00
asofold
305f71c473 Include SpigotMC links here. 2018-01-10 12:29:55 +01:00
asofold
a9afde112b Change order within. 2018-01-10 12:20:24 +01:00
asofold
3270194bab Add info on latest stuff. 2018-01-10 12:06:23 +01:00
asofold
0dae590fb4 Maven 3.3.9 should work. 2018-01-10 02:56:55 +01:00