Commit Graph

3295 Commits

Author SHA1 Message Date
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
e7aab4272e Use https for dbo. 2016-12-04 14:35:07 +01:00
asofold
da01ac1a48 Not AVR. 2016-12-01 13:09:17 +01:00
asofold
e644b44753 Mention the reflection based module. 2016-12-01 12:04:05 +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
ea9c5a1b19 FastConsume: disable the instanteat check on reloading the
configuration.
2016-11-26 14:52:47 +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
892af50209 Ensure to keep handles forever, once fetched.
(Less headaches with reloading the configuration and similar.)
2016-11-25 22:25:51 +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
6c73ab005e Properly unregister disabled handles, lazily.
Actually, proper would be to unregister the handle properly on disabling
it, not with the next fetch.
2016-11-24 00:40:58 +01:00
asofold
1058a45bbe Ensure we don't attempt to hand out disabled handles.
https://github.com/NoCheatPlus/Issues/issues/313
2016-11-24 00:25:56 +01:00
asofold
7db3a7d45a Note on order of registration. 2016-11-24 00:24:58 +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
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