Commit Graph

111 Commits

Author SHA1 Message Date
asofold
58ee2d2f9d Remove warning message of cbreflect up to 1.12.2. 2018-01-04 23:47:58 +01:00
md_5
df3344409b Fix server version detection logic 2017-12-21 14:00:27 +11:00
asofold
af44f13fbd [BREAKING] BlockCache: rename getTypeId to getType. 2017-12-18 01:19:49 +01:00
asofold
ce98d2aa54 [BLEEDING] Fix native access modules. 2017-12-18 01:14:23 +01:00
asofold
7fb960275d [BLIND] Use MinecraftServer.getVersion, if no version was detected. 2017-12-16 16:51:46 +01:00
asofold
7c5d67b1d4 Fixes and adjustments with String ids.
* Start renaming methods internally (getType for getting Material) -
unfinished.
* Temporary fix for the NCPCompatbukkit/cbreflect module: fetch NMS
blocks by id until we have a mapping and/or something efficient and
future proof in place.
2017-12-16 16:14:41 +01:00
md_5
1e988f24a0 Fix import location 2017-12-06 21:45:58 +11:00
md_5
3a111dc4a5 Remove Block IDs 2017-12-06 16:55:29 +11:00
asofold
afe080f1c2 Use cancel.dead as id instead of canceldead. 2017-05-31 21:00:42 +02:00
asofold
b38cb4da99 Passable: Prepare fixes. Remove legacy code and options.
New
* Define a couple of default lists for axis order.
* Allow setting axis order via a list.

Removed
* Configuration option to disable ray-tracing.
* Configuration option 'blockchangeonly' - there may be an equivalent
later on, where checking accounts for the entire bounding box(es).
* Legacy code option (things have stabilized and axis order switching
should fix false positives).

Random
* Accidentally commit FastConsume (whitespace).
2017-05-04 13:17:36 +02:00
asofold
def24ac1f1 Headers missed. 2017-04-11 00:06:35 +02:00
asofold
9a4b3f6f91 [BLEEDING][BREAKING] Store PlayerData by UUID, use a PlayerTickListener.
Instead of maps for each individual purpose, and the rather expensive
TickListener adding and removing, player specific task will be done via
one PlayerTickListener that can be registered with the TickTask. Thus
PlayerData has the access methods requestUpdateInventory and
requestPlayerSetBack, and so on, later more. For the
DataManager.playerData map it'll be UUID first now.

Consequently some calls have been altered to prefer passing Player or
UUID for PlayerData getting.
2017-04-08 15:47:06 +02:00
asofold
0cd0d508d1 [BREAKING] Add UUID to PlayerData creation. Outlook on data.
Breaks: DataManager.getPlayerData(String, boolean) has been removed, new
methods added to do the same without boolean or with UUID passed extra.

Following changes may repeatedly/randomly break PlayerData and check
data access (unless you use CheckType.getDataFactory), this may not
follow directly, but more or less soon. Even Later, CheckType will get
broken too :), in favor of class instances with dynamic registration
ability.

Basic direction is to concentrate stuff in PlayerData, getting rid of
all the static data stores, but also making access to shared data
more efficient (e.g. store last world id + name and permission cache in
PlayerData). Access will be more thread safe (only for PlayerData,
permissions cache, likely for fetching check data too, however returned
objects may have their own contracts).
2017-04-08 13:49:39 +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
30c3a40622 Towards vehicles with multiple passengers. 2017-04-02 18:55:32 +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
a4e106af52 Don't use the pre-1.11 method past 1.11. 2016-12-29 13:26:33 +01:00
asofold
664a01b951 Comment on having ReflectEntity there. 2016-12-29 13:06:37 +01:00
asofold
32c0250530 (Note entity bounding boxes on pre-1.7.10.) 2016-12-27 16:39:32 +01:00
asofold
95b2984ca9 [BLEEDING] Implement isIllegalBounds for cbreflect. 2016-12-27 16:34:39 +01:00
asofold
68eec44f14 [BREAKING] Move LocUtil to utilities.location 2016-12-27 15:28:36 +01:00
asofold
380ed8a185 Log resetting of fastconsume data for the obvious spots. 2016-11-28 22:24:51 +01:00
asofold
ea9c5a1b19 FastConsume: disable the instanteat check on reloading the
configuration.
2016-11-26 14:52:47 +01:00
asofold
85460d5cca Comments (simplify/complement some, add headers). 2016-11-23 21:07:53 +01:00
asofold
ba5f710c83 Fix pre-checks for getHeight, use fail() rather. 2016-11-22 21:04:59 +01:00
asofold
bf32406435 ReflectBlock: fix block shape access for 1.11. 2016-11-22 20:36:08 +01:00
asofold
12ce099eb1 [BLEEDING] Reflection module: access entity bounds/height etc.
This should fix more issues with horse type.
2016-11-22 19:25:13 +01:00
asofold
863b89763d [BREAKING] Move more classes around.
This time the focus is on the utilities package.

Possibly used, but not really official API:
* Move block cache to a 'map' sub-package.
* Move RichBounds/RichEntity/Player-Location and TrigUtil to a location
sub-package.

Not really official API, likely not used:
* Move AttribUtil to compat, since it belongs there.
* Split off direction check methods to collision.CollisionUtil.
* Move static BlockCache methods to map.MapUtil.
* Move food related methods from CheckUtils to InventoryUtil.
* Move vehicle/passenger related methods from CheckUtils to
PassengerUtil.

Not breaking:
* Move IdUtil to commons.
2016-06-21 09:56:50 +02:00
asofold
bfc6422115 Move entity last position and look access to another package. 2016-06-20 22:14:35 +02:00
asofold
b6088c3e3a [BLEEDING][BREAKING] Registry changes concerning MCAccess.
Main objective is to get rid of too complex setMCAccess methods and to
be able to store handles rather permanently instead.

* Remove MCAccessHolder.
* Add/refine interfaces and implementations.
* Change constructors.
2016-06-19 16:55:44 +02:00
asofold
bb8c8f4156 Add missing GPLv3 headers + accidentally add useless javadoc comments. 2016-06-18 17:57:16 +02:00
asofold
77465b09e3 [BREAKING] Move (registry) interfaces to sub-packages.
This is neither complete nor final. Intentions are to group interfaces
better, rather organizing packages in a flat way.

At some point there will be other major move-arounds, but that'll
hopefully be a point where we have a better idea of where to put what
(...). For now the approach is to move interfaces/things rather where
it's not interfering with profane exemption API use, preferably neither
taking down the top level API layer
(NoCheatPlusAPI). 

Added deprecated interfaces to prevent cncp to break too quickly.

Outlook:
* Classes that are rather only expected to be used internally for setup
will likely get moved around freely.
* Classes that have been added since last release might also get moved
around freely.
2016-06-15 16:13:59 +02:00
asofold
db945a7559 CompatCBReflect: block shape fetching for MC 1.9 and 1.10.
Worked on the first run :p, still took too long.
2016-06-13 17:56:14 +02:00
asofold
94ff2c1c72 Adjust end portal dupe hotfix to cover items as well. 2016-06-13 01:22:23 +02:00
asofold
d948357b46 Destructive hot fix for item duplication via end portals.
Configurable. Falling blocks, piston, end portal, roughly. Destructive:
the entity is removed.

(In addition some of the feature tags are added regardless activation
flags, because 'ncp reload' could change things anyway.)

Feel free to suggest alternatives/variations...
2016-06-13 00:14:15 +02:00
asofold
1e3620ac38 Re-add/repair reflection based attribute access. 2016-06-11 10:26:24 +02:00
asofold
f18e7e46d1 [BLEEDING] Guards for activation of IAtributeAccess implementations. 2016-06-09 23:40:09 +02:00
asofold
765383834b [BREAKING] Generic instance based attribute access.
MCAccess will be split into smaller providers with time, so do expect
more breaking changes of this type. If this is an issue, please contact
us, so we can see how to smoothen things. E.g. we could still make
MCAccess an aggregate, that just delegates to the more fine grained
providers, or we could provide other 
(default) aggregates.

This also adds a Bukkit-based provider for future updates.
2016-06-09 20:14:39 +02:00
asofold
4e91a9d5fc Ready for UEFA EC: GPLv3 headers.
Might need more training still.
2016-06-02 20:33:21 +02:00
asofold
68c4ab2bf2 Review dual wielding.
* Account for off hand in more places.
* Use bridge methods to get rid of warnings for now.
* Adds utility methods to CheckUtils.
* Do not allow left click on off hand (knockback).
2016-06-01 20:00:37 +02:00
asofold
241ff08d47 FastConsume: account for off-hand on cancel. 2016-05-31 08:27:42 +02:00
asofold
0726f9785e Change IEntityAccessLastPositionAndLook to have get and set. 2016-05-16 14:04:18 +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
0280db5010 Dedicated compat module for Spigot/CraftBukkit 1.9-1.9.3 (1.9_R1). 2016-05-11 00:27:21 +02: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
282024f3a8 [BREAKING] Move several methods from MinecraftVersion to GenericVersion.
This breaks testing for UNKNOWN_VERSION, if that is used externally.
Access methods are added for testing for unknown versions.

PR mentioning access methods:
94c4da3267
2015-11-26 09:51:11 +01:00
asofold
556ef2b0cd Set internal dependencies to provided for all the compat modules. 2015-11-25 15:26:32 +01:00
asofold
473ec3873c Set Bukkit dependency to 1.8.8-R0.1-SNAPSHOT, scope to 'provided'.
(That means adding Bukkit as a dependency to several modules.)
2015-11-25 08:58:15 +01:00
asofold
af5fbd900a Move prefixes to loggers. 2015-11-15 02:44:01 +01:00
asofold
866a2248cf Use tabs for all the pom.xml. 2015-08-01 00:58:33 +02:00