Commit Graph

107 Commits

Author SHA1 Message Date
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
af5fbd900a Move prefixes to loggers. 2015-11-15 02:44:01 +01:00
asofold
6959504d20 Update supported version. 2015-07-31 16:51:01 +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
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
d11e91f2e4 [BLEEDING/INSTABLE] Roughly adjust to 1.6.1 Bukkit API changes. 2013-07-02 12:13:33 +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
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
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