Commit Graph

1217 Commits

Author SHA1 Message Date
asofold
4b5cca3fe4 Reduce calls to Bukkit.isPrimaryThread(). Provide optimized methods.
Where it's known that it's the primary thread, that test should be
omitted.

A remaining problem is the Check class, where the convenience methods
all will lead to testing for Bukkit.isPrimaryThread(). This needs to be
done differently.

It'll be hard/impossible to work around, if we have to check permissions
and meta data. For permissions we could do some kind of bulk/context
dependent caching and updating policy and check via PlayerData, but meta
data needs the Bukkit API to state thread safety. Future design could
also do without knowledge of the thread, if permissions are cached and
exemption by meta data is turned off (or also cached, but this only
works if other plugins don't use it for temporary exemption), a lazy
approach could pass on an AlmostBoolean isPrimaryThread.

For now, at least some of the frequently run moving checks use the
optimized approach.
2017-04-11 12:07:12 +02:00
asofold
def24ac1f1 Headers missed. 2017-04-11 00:06:35 +02:00
asofold
b41c267b15 Random. 2017-04-10 23:03:57 +02:00
asofold
b11ae340b5 Fix wrong precondition for handling cancelled moves.
Mostly affected moves cancelled by other plugins.
2017-04-10 18:10:35 +02:00
asofold
73a62a1e13 Add DualCollection, for future use. 2017-04-10 14:19:11 +02:00
asofold
f221086729 Distinguish method by Minecraft version. Skip packet level pre-1.9. 2017-04-08 23:54:53 +02:00
asofold
5be2f45ba7 [BLEEDING] Switch to HashMapLOW for PlayerData storage. Fix removal.
* HashMapLOW for thread-safe access to PlayerData instances.
* PlayerData removal now used the UUID. More changes pending for storing
the UUID for reference rather.
* Use bulk removal for expiration of entries (one time lock).
2017-04-08 17:55:34 +02:00
asofold
2f59297621 Do data.resetTeleported(), if the player is there on tick.
Can't do much better than being there already. Thinkable trouble could
be with high latency and multiple teleports to different locations in
quick succession, so that cancelling the teleport will lead to the
player violating survivalfly again in the future, which means longer
freezing/rubberbanding than if we teleport now. However, current
assumption is, that it's better not to keep teleporting players around.
2017-04-08 15:50:56 +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
bf6c3ff753 Comment on a possible step forward. 2017-04-08 02:05:54 +02:00
asofold
19e5e6f154 Remove deprecated method: clear(CheckType) 2017-04-08 00:49:00 +02:00
asofold
4f1573c83d Better name for onLeave, INotifyConfig extends INotifyReload. 2017-04-08 00:36:25 +02:00
asofold
87621f7d28 Old arrows. 2017-04-07 22:21:26 +02:00
asofold
1b79889dd4 Fix pre-horse. 2017-04-07 22:17:59 +02:00
asofold
464e374c10 Add capability to mostly ignore certain vehicle types (default: arrows).
Configuration setting is hidden for now.
2017-04-07 22:11:21 +02:00
asofold
718f991832 More skipping conditions for "set back on tick".
* The player is at the coordinates.
* The last received ACK for an outgoing teleport has been received on
packet level. This is experimental, to be confirmed to a) do something
b) not allow abuse.
2017-04-07 16:37:38 +02:00
asofold
d06e658c7a Demand the minimally needed type for isSamePos variants. 2017-04-07 16:23:00 +02:00
asofold
ae80e20457 Make set back method configurable.
We do need to fix behavior to move on, so the intention rather is to
react more flexibly towards debugging results, rather than having people
use random configurations early on. Still this does allow for fall-back
configuration, e.g. for live servers.

NOTES:
* Later we will make the configuration set at 'default' adjust to server
mod and version.
* Overriding checks.moving.setback.method with SET_TO can lead to
PlayerTeleportEvents with TeleportCause.PLUGIN on newer versions of
Spigot, which may conflict with other plugins assuming feature-based
teleportation (possibly resulting in /back locations getting overridden
wrongly). For legacy setups this will be similar to restoring the state
of build 1066 for most.

There could still be places where distinction of the used method is
necessary, which would mean bugs.
2017-04-07 15:56:43 +02:00
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
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
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
b6ae8049b7 [BLEEDING] Ignore Minecraft fall distance if it's greater than tracked.
Fall damage is adjusted or cancelled, if the Minecraft fall distance is
greater than the distance(s) tracked by NCP (per move diffs, maximum y).
Intention is to prevent (speeding by) self damage by abusing Minecraft
dealing fall for untracked moves.
Issue: https://github.com/NoCheatPlus/Issues/issues/338
2016-12-29 00:19:55 +01:00
asofold
d85ee35d99 8465c40d93 (commitcomment-20312231) 2016-12-28 21:52:15 +01:00
asofold
8465c40d93 Register .silent check permission in postEnable.
Issue: https://github.com/NoCheatPlus/Issues/issues/353)
2016-12-28 10:37:34 +01:00
asofold
1ba300f3af [BREAKING] Move matchBlockFace to MapUtil.
(Likely no one is using this by now.)
2016-12-27 15:33:36 +01:00
asofold
b406204ce2 [BREAKING] Move isBadCoordinate to LocUtil. 2016-12-27 15:30:51 +01:00
asofold
68eec44f14 [BREAKING] Move LocUtil to utilities.location 2016-12-27 15:28:36 +01:00
asofold
d69dc0b44d [BLEEDING] Double trouble potential: NaN, infinity.
+ random Formatting + random fix (same angle checked twice in TrigUtil).
2016-12-27 15:26:26 +01:00
asofold
17db0bdcfe Comment: More work needed towards null world compatibility. 2016-12-27 15:04:28 +01:00
asofold
9d01191bcd cleanup: null checks. 2016-12-19 07:42:50 +01:00
asofold
dcfdec79e2 Intercept UnsupportedOperationException in getWorldConfig.
TemporaryPlayer issue: https://github.com/NoCheatPlus/Issues/issues/335
2016-12-19 00:11:22 +01:00
asofold
0ea8d379d0 Fix magic not used correctly. Indicate stuff. 2016-12-18 15:11:04 +01:00
asofold
1c024c072c [BLEEDING] First version of horizontal push.
New issue:
* Horizontal push can lead to vdistrel violations with yDistance = 1,
even with air blocks next to the foot position.
2016-12-18 00:33:13 +01:00
asofold
7646476993 Fix nested vehicle check on vehicle enter. 2016-12-17 19:44:40 +01:00
asofold
c9a744a7d3 [BLEEDING][BREAKING] Next step on past bounce with pistons.
Steps done:
* Add more velocity with less preconditions.
* Handle push with the player being just above the block where a slime
block is pushed to.
* Exception for vdistrel.
* Breaking:Move verVelUsed from MovingData to PlayerMoveData.

Gameplay issues remaining:
* Still too often fall damage is dealt.
* Friction envelope gets hidden with past-ground being set too often
(vdistsb).
* Potential for more edge cases.

Missing abuse prevention:
* Reinstate invalidation of past entries (currently turned off to
progress at all, will need another iteration).
* More confined preconditions.
* More/better invalidation conditions for velocity set for bounce
effects.
2016-12-17 15:39:54 +01:00
asofold
cf3ea4a1e2 [BLEEDING] One more step on slimes with pistons.
* Less fall damage.
* Flag all velocity added due to slime bouncing appropriately.
* Experimental concept for splitting up velocity, likely to be altered /
removed.
* Add a flag for (faked) pvp velocity.

NOTE: Invalidation of past entries has been deactivated to progress on detecting the stupid past bouncing at all. This will need another iteration.
2016-12-17 15:02:26 +01:00
asofold
6d28354f11 [BLEEDING] Consider an NPE fixed.
(Assume this doesn't result in an endless loop.)
2016-12-12 20:30:42 +01:00
asofold
6de231ac54 [BLEEDING][BREAKING] Shift entry points for past state bounce.
Lots of issues remain, but vertical push/bounce with pistons is much
improved. Still there are show stoppers (false positives remain, as well
as occasional fall damage).

Use same/similar entry points, like static/classic bounce checking in
MovingListener. SurvivalFly still keeps one exception with the
after-failure Y_POS block move check.

Also check: https://github.com/NoCheatPlus/Issues/issues/5
2016-12-10 21:49:57 +01:00
asofold
9dca93e650 Don't add bluntly redundant block change entries.
Match vs. the last entry of existing entries for those coordinates.
Seems to be better with piston retract events.
2016-12-07 22:18:53 +01:00
asofold
9a6a370f1d [BLEEDING] Adjustments + more slime+piston support (incomplete).
There are typical cases to cover:
* Extra falling height.
* Fall damage where a slime block had been.

Thus adding a specialized method for bounce (just foot position) instead
of using the full bounds would be better, preferably just check within
the MovingListener (set bounce / adjust velocity there).
2016-12-07 22:10:04 +01:00
asofold
06c2cadf7f Add skipping conditions for redstone current change. 2016-12-07 21:18:29 +01:00
asofold
ef9492b0bc Use the activation flag(s). Comments. 2016-12-07 10:12:52 +01:00
asofold
5afcfdea96 Add access methods for getting a BlockChangeEntry matching flags.
(Slime blocks ahead, somehow.)
2016-12-07 00:34:40 +01:00
asofold
0cd07d2f2a COmments- 2016-12-06 15:21:33 +01:00
asofold
602abfe55b Fix margin not being used for hasActivity. Distinguish shuffle.
(+ Set useBlockChangeTracker before testing for bounce.)
2016-12-06 14:26:21 +01:00
asofold
068a523833 [BLEEDING] Cover blocks changed by entities for a change. 2016-12-06 14:11:17 +01:00
asofold
e6673de09e [BLEEDING] Sketch one approach for on-ground with past states.
Still incomplete, could contain bugs (endless loops, perhaps).
Invalidation
mechanics may need to be refined.

Not covered:
* Exemption for moves resulting from horizontal push/pull.

*
2016-12-06 13:28:37 +01:00
asofold
3cd7625516 [BREAKING] Make an extra package for block change tracking.
* Split off the BlockChangeReference, BlockChangeListener.
2016-12-05 14:29:57 +01:00
asofold
da01ac1a48 Not AVR. 2016-12-01 13:09:17 +01:00
asofold
cc52581437 Missing check for null. 2016-11-30 12:42:05 +01:00
asofold
f5396e5d91 Split off lazy expiration from getBlockChangeEntry. 2016-11-30 11:32:48 +01:00
asofold
8e3c4d3b8c Tick should be int for now. 2016-11-30 11:13:22 +01:00
asofold
4e58ff980c Random/ alter on-ground logic (might fix fences+some abuse).
* In case of non-full bounds + variable, allow ground to be found
underneath. Can concern fences (tested on 1.11).
* There has been a probably misplaced/leftover check assuming the block
above to be passable, without checking for it (iMaxY). Since the
access.getMaxBlockY() has already been checked, this part appears to be
not of use, thus iMaxY has been removed from the signature together with
this exception.

If this causes something, please provide debug logs / circumstances :).
2016-11-30 00:35:08 +01:00
asofold
3a6c0a4945 Add block changes via redstone events for door/gate like blocks.
This is unfinished, but gives an outlook on what we may be able to do
with this.
* Double doors are not covered (upper/lower half are).
* Interaction with levers / directly with doors is not covered.
* Only doors + gates (not sure what else there is).
* More fine grained configurability is missing (+ only register
listeners if needed).
* Possibly other things.

Tracking BlockRedstone seems to be more promising than BlockPhysics, as
long as we don't have to inspect neighbour blocks to check for door like
blocks at all.
2016-11-29 15:18:45 +01:00
asofold
26b4c7a376 Prepare adding block changes without direction. 2016-11-29 14:01:57 +01:00
asofold
65777e0e32 Debug log the timing window for the BlockChangeTracker, Adjust comments.
Currently the oldest available entries are used, as if the player had
the maximum allowed latency always. Later on, at least attempting to hit
a global latency estimate (+window) should be attempted.

We'll still have a (moderate) fast-forward implementation to see what
opportunistic checking can do on live servers (elevators, doors etc.).
2016-11-29 13:20:38 +01:00
asofold
00b4dc5545 Format, adapt getCorrectedBounds to use a node. 2016-11-28 23:14:40 +01:00
asofold
380ed8a185 Log resetting of fastconsume data for the obvious spots. 2016-11-28 22:24:51 +01:00
asofold
e926f34963 [BLEEDING][BREAKING] Rework internals to use IBlockCacheNode (rough).
Intention is to work towards passing stored IBlockCacheNode instances to
methods in BlockProperties, i.e. to have
isOnGroundInAnOverlyOpportunisticWay implemented.

If you need one of the old BlockProperties signatures (or a more
simplified one), just open a GitHub issue.

This is a slightly peculiar change.
* Passing node and nodeAbove is a little bit odd, despite seemingly
efficient at present.
* Later we might need a BlockCache instance that busies about past
states (currently too complicated to implement).
* Uncertain impact (could perform better, could perform worse).
* Possibly left out a couple of places.
* Might have introduced bugs (fast forward).

On the other hand there may be a lot of other types of changes, if we
ever go for a less opportunistic implementation, which can not be
estimated simply, so this may be about the best that can be done, to get
a quick step in.
2016-11-28 14:30:57 +01:00
asofold
21505cf4fa Use the appropriate variable here.
Wondering about Double.MAX_VALUE...
2016-11-28 10:14:17 +01:00
asofold
c80ca6c8a6 Split off the per-block logic in isOnGround.
Already have the signature use IBlockCacheNode for node+nodeAbove, like
it will be done with other methods like collidesBlock.

This will allow calling this with past block states, once other methods
have been adapted as well.
2016-11-28 00:07:43 +01:00
asofold
511bcfd4ad More useful method naming and behavior for getting IBlockCacheNodeS. 2016-11-28 00:04:30 +01:00
asofold
4fdca46ccb Cap the message letter count (128 length), to allow 1.11 messages. 2016-11-27 12:14:46 +01:00
asofold
a97ae0171c It's vertical here. 2016-11-26 23:42:18 +01:00
asofold
baf09380f7 Check activity before using the BlockChangeTracker. 2016-11-26 22:57:28 +01:00
asofold
d96abe9a3e Keep track of cuboids of block change activity (resolution of 32). 2016-11-26 22:38:00 +01:00
asofold
c26c3cb0c6 Maintain a validity interval (ticks) of an entry in an efficient way. 2016-11-26 15:55:50 +01:00
asofold
371afd91d0 Need to call updateFinal within MovingListener.
Necessary with multiple checks updating the BlockChangeReference/span.
2016-11-26 14:41:22 +01:00
asofold
5939e1e206 Add per-path build numbers. Activate BlockChangeTRacker by default. 2016-11-26 14:16:08 +01:00
asofold
206d627e9b Skip the legacy bull shit.
(Let's hope this doesn't enable anything unwaynted :p.)
2016-11-25 23:08:49 +01:00
asofold
dec6ef1412 Opportunistic passable checking. 2016-11-25 23:06:06 +01:00
asofold
93b71bb316 Clarify. 2016-11-25 21:29:47 +01:00
asofold
9abe1ae3d2 Move + rename updateBlockChangeRef. 2016-11-25 21:18:20 +01:00
asofold
30979935ce Ensure not to update with an older block change entry. +comments. 2016-11-25 21:08:01 +01:00
asofold
c477f1af72 More neutral naming (rather blockMove than push). 2016-11-25 19:11:47 +01:00
asofold
574390f90d Add 1.11 blocks. Add/alter comments. 2016-11-25 11:32:26 +01:00
asofold
0a834624ac Comment on height150 (with axis tracing). 2016-11-24 16:19:18 +01:00
asofold
ae44be5740 Allow sub classes to query for ignored blocks. 2016-11-24 16:18:31 +01:00
asofold
f372d76272 Suggest removal of world name tracking. 2016-11-24 11:18:21 +01:00
asofold
d01951a10e Use an IBLockCacheNode for passing a node + private constants.
Within BlockProperties BlockCache and IBlockCacheNode ("read only") get
passed, removing id/data/shape from arguments. If a property is not set
in the node, it'll be fetched from the block cache, but the node is not
updated from outside the BlockCache. For subsequent calls, the node
would be updated by the block cache, if it isn't a node stored by the
BlockChangeTracker from an earlier time, and similar.

This way, opportunistic passable checking can be implemented, by
switching to cached nodes instead of id/data/shape arguments with lazy
fetching from BlockCache.

The name IBlockCacheNode seems to be appropriate, since we'll pass it
alongside with a BlockCache anyway.
2016-11-23 23:51:11 +01:00
asofold
85460d5cca Comments (simplify/complement some, add headers). 2016-11-23 21:07:53 +01:00
asofold
bb5afe0d2e Add retention policy etc. to MethodOrder. 2016-11-22 19:09:03 +01:00
asofold
2cf064b3a9 Detect 1.11 horse types.
We do have increased issues on layered snow, possibly due to lost-ground
or bounding box. At least other horse types can be used somehow at all.
2016-11-22 12:35:27 +01:00
asofold
da40bd06e2 Keep track of past block states within BlockChangeTracker.
We only have pistons for now, previous states of blocks are not yet used
for anything with this commit.
2016-11-21 01:09:37 +01:00
asofold
67a500ede9 Implement getBlockCacheNode correctly (no interface). 2016-11-20 23:39:15 +01:00
asofold
cc538ee5a5 First BlockCache implementation using nodes.
(USe bounds instead of shape for the nodes as well.)
2016-11-20 20:36:50 +01:00
asofold
62455f4504 Start sketching out BlockCacheNode use. 2016-11-20 15:11:54 +01:00
asofold
24b45ae5d9 Rename BlockChangeReference.entry to lastUsedEntry, comments. 2016-11-20 14:51:08 +01:00
asofold
7fb1da6dc5 FORMAT +comments +fibbity. 2016-11-19 14:26:03 +01:00
asofold
ba15cfc267 [BLIND] Keep track of the position a player teleports to the end from.
Cross-world teleport to the end issue: set back hard, if the player
moves to the position they set off from the last world, which seems to
be a bug with some server types/versions at present (!?).
2016-11-06 20:04:59 +01:00
asofold
f3eb4f22ff Debug log hacc as well. 2016-11-06 18:48:46 +01:00
asofold
5e2e11dd10 Keep track of the world name in NetData, for use with CatchAllAdapter.
Some packets arrive with a null world for a player, possibly sent by
plugins - thus attempt to use a stored world name.

This is just a hot fix attempt.
2016-11-05 21:13:43 +01:00
asofold
b8746efcb7 Include the entire MC 1.10.x range with ProtocolLib 4.1 and later. 2016-11-02 19:10:46 +01:00
asofold
cad500edc7 Adjust hacc limit for liquid to 1.8.8 clients for now. 2016-11-02 09:50:46 +01:00
asofold
bea35e610a Ensure resetting hacc only happens with head obstructed. 2016-11-02 09:35:19 +01:00
asofold
518f2f08da More block flags: HEIGHT8_1 and ALLOW_LOWJUMP (see description below).
Attempt to enable workarounds for lily pads with servers that support
multiple client versions. Add to the configuration at
compatibility.blocks.overrideflags:
WATER_LILY: default+ign_passable+ground_height+height8_1

HEIGHT8_1 just means 1/8 height (0.125).

The ALLOW_LOWJUMP flag was intended to be used in case of
ground_height+height100 or the like leading to issues with
sprint-jumping due to the low jump detection, however other special
casing checks for bunny hopping let this still fail (less than before,
but still), thus this flag might get removed. Keeping it for now, to
provide some kind of toolkit.
2016-11-01 13:42:05 +01:00
asofold
3d141f3125 [BLEEDING][INSTABLE] Attempt to know when the bloody bunny can't fly.
Technically, tracking actual speed / base speed seems promising, done
here via using the liftOffEnvelope that is maintained anyway, adding a
counter and sum value. [Base speed is something like the allowed speed,
without accounting for specialties like bunny hopping.]

Limits are checked for moving in ground+air or water+air and are
currently hard-coded. This simplistic first-step-in may easily yield all
sorts of false positives and other random issues, handle with care.
2016-11-01 00:40:34 +01:00
asofold
7023fdb2af Fix passable fp with 2-high ceiling.
Can't judge side effects, concerning other passable like tests telling
the head to be inside a block by the micro margin, while passable allows
such a move now.
2016-10-31 22:00:52 +01:00
asofold
48a7e9c0e1 Run passable ignoring sneaking. Adjust box height for REL. 2016-08-07 15:18:45 +02:00
asofold
cec7927850 Allow friction on ladders anyway (not only with velocity set). 2016-08-07 15:18:18 +02:00
asofold
7243ab7538 Quick fix attempt for placed material issues with off-hand. 2016-07-20 10:03:17 +02:00
asofold
514877e1d1 Another reason for dynamic check type registration. 2016-06-27 06:52:33 +02:00
asofold
fc24fe529c [BLEEDING] Overall packet spam check for pre-1.9.
Not sure if this really pays, if most people use protocol-support
plugins that limit packets anyway. There could be some future use, e.g.
generic rate limiting with configurable implementation.

Other:
* New methods for RawConfigFile+ConfigManager to check for
AlmostBooleanS.
* Add all net check permissions to plugin.yml.
2016-06-26 22:18:43 +02:00
asofold
b420f34f23 Add a method to test activation via AlmostBoolean for all configs. 2016-06-26 14:37:03 +02:00
asofold
2623a1ae5c Add a sequence count to DataPacketFlying.
Set with adding to the flyingQueue.
2016-06-25 10:57:43 +02:00
asofold
cce7e76211 The idea of choosing a simple implementation was to skip debugging. 2016-06-24 23:38:27 +02:00
asofold
889d21c1d5 Add convenience method to set the AABB. 2016-06-24 20:54:08 +02:00
asofold
050760afd2 Complete initial draft for ICollideRayVsAABB.
(Blind/untested.)
2016-06-24 20:38:43 +02:00