Commit Graph

134 Commits

Author SHA1 Message Date
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
asofold 6959504d20 Update supported version. 2015-07-31 16:51:01 +02:00
asofold 7da874ad66 Attempt to deploy only the final plugin jar. 2015-07-30 11:27:30 +02:00
asofold ca07ecc3ab Attributes: Allow detecting if attributes are available at all. 2015-07-24 23:09:41 +02:00
asofold 61274d30ba Allow nms/obc not to be relocated for the reflection module.
(Means better testing for some setups.)
2015-07-23 23:42:26 +02:00
asofold 705170f80c Lessen repetition of violation with false positives for FastConsume. 2015-07-08 14:10:56 +02:00
asofold 2f50cca03d [BLEEDING] Fixes and additions for the compatibility layer.
* Make attribute methods consistent (remove the sprint boost modifier
from the generic speed multiplier, because it's inconsistent).
* Add missing implementations.
* Adjust default sprinting speed modifier.
* Add more guards for the latest compat module (1.8_R3).
* Add a reflection based compat module for CB, to cover minor updates.
* Possibly other minor fixes/changes.

[Hail "insufficient data written"!]
2015-06-06 16:14:36 +02:00
asofold cb62547fc0 More complete go on speed attributes.
* Undo the sprint boost modifier until we add it (minimize code change).
* Implement methods for MCAccess implementations down to 1_6_R1.
2015-05-30 02:22:49 +02:00
asofold 2450636f3c [BLEEDING] First go on generic speed attribute support. 2015-05-29 00:33:16 +02:00
asofold 067ce0d5a5 Vanish-o. 2015-03-21 11:58:37 +01:00
asofold ef1ef05115 Spaces. 2015-03-20 23:35:36 +01:00
asofold ccf9242402 Update entity widths in NCPCompatBukkit. 2015-03-20 23:23:59 +01:00
asofold e0a8ef21d6 Revert module dependency versions to 1.1-SNAPSHOT.
(LATEST would use the old static ones.)
2015-02-06 02:05:48 +01:00
asofold a7127336a8 Use LATEST as version for internal dependencies. 2015-02-04 23:42:05 +01:00
asofold 2cecd50961 Change all "static" pom versions to "1.1-SNAPSHOT", to allow deploy. 2015-02-04 18:49:52 +01:00
asofold 0fa307a8df Add a check for creating books with more than 50 pages. 2015-01-19 02:52:02 +01:00
asofold f0c5552873 [SAFETY COMMIT] Redo with proper assignment (details see below).
Contained changes:
- Melon and pumpkin block break timings: 1.8-specific, keep workaround.
- Don't run all horizontal move checking if no move.
- Utility method for checking for air.
- Some formatting.
2015-01-04 20:06:05 +01:00
asofold 3eab23ae92 [BLEEDING] First attempt to make slime blocks work. 2014-12-10 00:45:08 +01:00
asofold fa87287c97 Adapt some version strings according to ~ intended use. 2014-12-02 02:03:40 +01:00
asofold 37c1da73ff Rename LogUtil to StaticLog. 2014-11-17 11:25:51 +01:00
asofold 1eb8d98860 Spaces again. 2014-11-03 22:23:04 +01:00
asofold 7dba18cf67 Add entity widths to MCAccessBukkit. Compile with Bukkit 1.7.2-R0.3.
* "Swiftly" add entity widths to MCAccessBukkit (mostly switch).
* Compile CompatBukkit with Bukkit 1.7.2-R0.3 from now on.
2014-11-03 22:19:38 +01:00
asofold 5f82584072 Use TickTask.getLag(..., true), within the primary thread.
This counts in if the current tick is taking longer than 50 ms.
2014-08-01 19:25:37 +02:00
asofold c6c904254f Feed some counters for debugging purposes.
Some might get removed soon.

* Various sorts of silent cancelling (probably not caught all).
* Count PlayerMoveEvent with look/pos/look+pos changes.
2014-07-27 21:01:36 +02:00
asofold b6c146ce64 Remove getKeepAliveTime from MCAccess.
It does not seem to become accessible any time soon, while packet level
access allows to fetch it.
2014-07-17 14:33:38 +02:00
asofold c449414d9a Suppress deprecation warnings in BlockCache.
Assuming this is the most efficient way at present.
Feedback welcome...
2014-06-14 22:05:07 +02:00
asofold 75224adf63 Reduce use of using block-ids in more places.
* Use Material directly in more places.
* Hide id-getting within BlockProperties.

TODO:
* BlockInit, BlockFlags + use of those.
* Possibly other.
2014-06-13 12:01:44 +02:00
asofold 587236dfdc Alter resetting of FastConsume timings.
* Reset to time, if time ran backwards.
* Reset to time instead of 0, on eating.

TODO: Switch to Monotonic.
2014-06-13 00:39:42 +02:00
asofold 56bab0a3ae Cancel various actions for dead players. Config pending. 2014-06-04 23:52:07 +02:00
asofold c93edcbbe9 Remove direction correction, as it does not seem to be effective. 2014-05-15 10:44:34 +02:00
asofold 6dbe33b310 Update actually supported versions for some MCAccess modules. 2014-04-22 22:20:16 +02:00
asofold 59054b402b Add Methods to correct yaw and pitch to MCAccess.
An implementation for NCPCompatBukkit is missing.

Note that the native access can not set lastYaw nor lastPitch in
PlayerConnection (private), but it could set lastYaw and lastPitch in
EntityPlayer.

Can't guarantee this actually helps with stuff like derp/magnet, because
we can not really set the outcome of a PlayerMoveEvent without
rubberbanding the whole planet. Hacks could send enough packets per tick
to keep freezing people - we might be able to keep track of yaw/pitch
correction and cancel (most) attacking for the same tick after yaw
correction (invalidate "same" with in-bounds yaw).
2014-04-21 14:16:11 +02:00
asofold cb557122b8 Set maxBlockY from given world. 2014-02-25 11:22:39 +01:00
asofold abdeb12377 Less object creation with short-use Locations + other preparation.
* Make use of Entity.getLocation(Location) in most places, for starters.
* Prepare a check for moving location consistency.
2014-02-23 02:01:28 +01:00
asofold 8d5a0b1dca Rough update for 1.7.2 blocks.
Adds an ice flag to BlockProperties.
2013-12-01 21:46:44 +01:00
asofold 875b9bdac5 BukkitCompat: Attempt to get the CommandMap by reflection. 2013-08-10 02:27:17 +02:00
asofold f17378b3e0 More cleanup for health API changes. 2013-07-15 12:31:37 +02:00
asofold a8d1aded59 [BLEEDING] Adapt to health changes + set NCPCore dependency to 1.6.1. 2013-07-10 01:55:56 +02:00
asofold e1babee538 MCAccess: Get rid of Block_i method. 2013-07-09 12:05:06 +02:00
asofold e69741f5dc Simplify MCAccess version tags for support of multiple sub-versions. 2013-07-09 11:47:16 +02:00
asofold 670f403f11 [BLEEDING/INSTABLE] Add 1.6.2 native support, DROP 1.6.1 support. 2013-07-09 11:34:19 +02:00
asofold f315336005 [TEST] Attempt to fall back to reflection for health issues (one spot). 2013-07-06 15:48:26 +02:00
asofold e60006d6a3 Update pom.xml descriptions. 2013-07-06 14:49:24 +02:00
asofold d11e91f2e4 [BLEEDING/INSTABLE] Roughly adjust to 1.6.1 Bukkit API changes. 2013-07-02 12:13:33 +02:00
asofold 73c8ae01e8 NCPCompatBukkit: Bukkit dependency to 1.5.2-R1.0. 2013-06-24 13:25:31 +02:00
asofold 8f862fb3f6 Outer space again! 2013-06-07 15:23:40 +02:00
asofold 3b22ca2e6a [Experimental] Update inventory after FastConsume violations.
This might be used for other inventory violations too (subject to
testing).
2013-05-26 21:01:39 +02:00
asofold c77dbff23e [Bleeding] Add FastConsume, if available will replace instanteat.
Somewhat hacky still, not sure it actually works too well.
2013-05-23 09:44:24 +02:00
asofold ce834675d7 Move most code to NCPCore, removes NCPCompat.
Factories are now on NCPPlugin level, thus all the core stuff can be in
one module, giving better source code browsing.

Updates has been moved into an updates package, because there is to be
expected more content, and to make utilities less fat.

To indicate the direction, the basic infra-structure has been added to
allow adding components to the DefaultComponentFactory. Further
processQueuedSubComponents is now called after each components adding in
order to allow more flexible registry features.
2013-05-22 12:24:48 +02:00
asofold 6519ea1e19 Update supported versions of MCAccessBukkit. 2013-05-21 15:07:23 +02:00
asofold 8d0751fa64 [Safety commit] Prepare better mod support for blockbreak (slowly).
Not yet in place, but setting up new package structure to split off some
things from BlockProperties. Likely not final.
2013-05-21 15:02:51 +02:00
asofold 22ffb43ddf [BLEEDING] Testing: ender-pearl glitch use (first sketch, read details).
* This method is "hard-coded" and not configurable yet.
* Prevent throwing and teleporting into blocks directly, prevent
the second throw on glitching into a one thick ceiling (might lead to
lots of passable violations at present).
* If stuck in a block with the feet (not sand/gravel) without being on
ground, throwing is prevented.
* Some dependencies were updated, hopefully without conflicts for
backwards compatibility (untested).
2013-04-22 21:46:49 +02:00
asofold f2ab4c9a7c Override cleanup methods in BlockCache implementations to remove world
references.
2013-03-13 20:47:42 +01:00
asofold 333369d0ea Can't stand on a minecart, give little more room for boat. 2013-03-13 19:37:49 +01:00
asofold e35f0585ae Rename simplified fluid level flag. 2013-03-13 19:34:35 +01:00
asofold b8cda625f8 Double is used here. 2013-03-13 19:30:20 +01:00
asofold 0d2862c21b Check "instanceof Minecart" instead of EntityType.
Right now and especially with Minecraft 1.5, one has to account for
several types of minecarts.
2013-03-13 05:22:53 +01:00
asofold 3f2780fe7d Fix block-flag-setup for bukkit-api-only.
Allow all blocks that get the IGN_PASSABLE flag set but which the player
can stand on to be ground from height 0 on (GROUND_HEIGHT, takes
effect unless for blocks with an explicit workaround). Set IGN_PASSABLE
and GROUND_HEIGHT for ENDER_PORTAL_FRAME explicitly.
2013-03-11 07:50:44 +01:00
asofold 212438dd7b MCAcessBukkit: Also make Glowstone an exception. 2013-03-01 19:34:44 +01:00
asofold b2be3b9474 NCPBukkitCompat: Ensure some full blocks are not ignored by passable. 2013-03-01 19:10:00 +01:00
asofold e46c8a1893 Compile NCPCompatBukkit against 1.4.7-R1.0, since more is not needed. 2013-03-01 16:38:05 +01:00
asofold da4b142aa9 Add module: NCPCompatBukkit
Seems better to have a dedicated module for this as well, since other
modules might be built against different versions of the Bukkit-API,
potentially.
2013-02-28 03:40:40 +01:00