Commit Graph

284 Commits

Author SHA1 Message Date
asofold
39e2a86472 [BLEEDING] Extra method for set-back + reset positions differently.
Setting back players on PlayerMoveEvents:
* Reset internal from/to tracking the set-back location.
* Use an extra method for that.
2014-07-14 22:49:37 +02:00
asofold
4ebe911509 Abort ray-tracing if there is no advance. Formatting + numbers.
If there is no advance on any axis, loop should be stopped.
2014-07-13 03:19:28 +02:00
asofold
aba5674f6a Correct log messages. 2014-07-13 01:45:39 +02:00
asofold
aa91a39eea Some Formatting. 2014-07-13 01:14:17 +02:00
asofold
e09d024101 Un-fix tempkickillegal issue: Do kick if location could not be restored. 2014-07-13 01:13:50 +02:00
asofold
607407d4fa Fix tempkickillegal setting being ignored. 2014-07-13 00:29:52 +02:00
asofold
74e6844e00 Check child individual child permissions for checks.blockplace.against. 2014-07-06 21:36:18 +02:00
asofold
5d8f77f309 Change "ncp ban ..." command to use the vanilla command.
This should be better in case the vanilla command allows UUIDs some day.
At least during testing in uuids did not work, so we added a warning
message if uuids are used for banning.

Using player names for actions should be safe anyway.
2014-06-15 02:57:24 +02:00
asofold
754fea92d8 Add some utility methods for names/uuids (taken from TrustCore).
Someone remind me of rendering TrustCore "uploadable" or to just upload
it.
2014-06-15 02:54:50 +02:00
asofold
fc83b884b3 Whoops. 2014-06-15 01:34:22 +02:00
asofold
b25b2be62c Hide some more warnings behind BlockProperties. 2014-06-14 22:29:10 +02:00
asofold
ae9415a012 More use of Material instead of ids... 2014-06-14 20:45:51 +02:00
asofold
c23e5e15a7 Remove unused calls. 2014-06-14 20:42:46 +02:00
asofold
785de7c0f4 Suppress deprecation warnings for BlockProperties.
Access by id may or may not be changed internally, depending on what
happens on the API side.

For performance reasons we might like to do without passing on extra
stuff like Material, or even do String-comparison.

If ids will become more expensive to use than other ways, or if it will
be possible/accepted that ids get reused during runtime, then we will
have to change all internals.
2014-06-14 20:39:32 +02:00
asofold
98f101e9ff Import cleanup. 2014-06-14 20:33:30 +02:00
asofold
f53cf96e78 Fix test failure due to invalid input.
A merge can happen if the maximum distance between any two points
exceeds the merge distance, because LocationTrace attempts to balance
distances entries. Thus this test must not bne able to walk further than
the merge distance.
2014-06-14 20:22:02 +02:00
asofold
6afaf4ebbd Formatting, shuffling, commenting. 2014-06-14 16:40:43 +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
5bfad6016c Small cleanup for fastbreak: creative mode is not handled by this check. 2014-06-13 11:12:50 +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
a75e32b2d3 Ra-add the instant-break compatibility code.
For whatever reason it was commented out, it is now put back, assuming
that the reason was "it did not help with mcMMO", because mcMMO used to
fire extra BlockBreakEventS.

Now we use a tri-state and set it to MAYBE if instantBreak is set
already on lowest priority, to have a rough indicator if a plugin set
it, or if the server might have done it. Later we might let FastBreak
assume some maximal duration for either case, instead of ignoring these.
2014-06-04 22:31:31 +02:00
asofold
d6e66dc22d Simplify and extend AlmostBoolean. 2014-06-04 22:04:26 +02:00
asofold
f4b109ec3b Comment added. 2014-06-04 21:54:13 +02:00
asofold
5c243aa4bc Add exception list for blockplace.noswing (water lily, flint and steel). 2014-05-18 20:57:04 +02:00
asofold
258dbbdf84 Deprecate some unused config methods for getting type ids. 2014-05-18 20:49:41 +02:00
asofold
c6dbd7330b Rename + extend config support for reading Material. 2014-05-18 20:46:29 +02:00
asofold
c93edcbbe9 Remove direction correction, as it does not seem to be effective. 2014-05-15 10:44:34 +02:00
asofold
24bc2816e6 Throw more npes for null worlds, to ensure things blow up in time. 2014-05-15 10:37:24 +02:00
asofold
521b4feb25 Re-check use of "useLoc" once more.
Fixes:
* On passable-violations useLoc might have been passed as newTo.

Reduce potential for accidental future misuse:
* Call useLoc.setWorld(null) as late as possible.
* Do not reset world of MoveInfo.useLoc in MoveInfo.set.
2014-05-15 10:09:53 +02:00
asofold
e7f292ebe0 Too loud thinking. 2014-05-13 10:27:19 +02:00
asofold
35684208f0 Set default delay to 100 in fastbreak. 2014-05-13 10:22:36 +02:00
asofold
4213002653 Fix instantbow resetting, e.g. with item changing, if in strict mode. 2014-05-13 10:22:07 +02:00
asofold
b822b5c08a Wrong way round - default behavior was to allow it (be it a bug or not). 2014-05-11 23:03:19 +02:00
asofold
0024e16112 Add config flag to allow preventing vl reset in chat.text.
This might be temporary, the resetting could get removed completely,
or it might be fixed/altered.
2014-05-11 22:59:37 +02:00
asofold
fc69b10fa4 Set max steps for ray tracing in BlockProperties as well. 2014-05-05 23:53:59 +02:00
asofold
307e2c6cac Fix handling move events while in vehicles.
Bug by "refactoring".
2014-04-27 22:34:25 +02:00
asofold
b4f9c5d8a6 Apply yaw/pitch correction in fight-handling directly.
Might later do without having this done after moving all the time.
2014-04-23 20:54:02 +02:00
asofold
146936b326 [BLEEDING] Treat respawn mostly like join. 2014-04-23 20:49:07 +02:00
asofold
62b3088082 Wrong API used. 2014-04-21 14:25:23 +02:00
asofold
db7b34e50c Make use of yaw/pitch correction (silent correction). 2014-04-21 14:17:00 +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
829e52d473 Add methods to check and correct yaw and pitch to LocUtil. 2014-04-21 14:10:43 +02:00
asofold
2d07fa1b5a Add method to DataManager to retrieve data for a Player instance. 2014-04-21 14:09:38 +02:00
asofold
53f027c3a3 [BLEEDING] Something quick against "magnet".
"Magnet" refers to a player seemingly freezing other nearby players onto
the spot, causing them to yaw-glitch, seemingly getting attracted by the
cheater.

Thanks again @Iceee for reporting and @Amaranth for finding cause +
suggested fix.

Not sure this both helps and prevents false positives, so it could get
redone a couple of times, might also result in being impossible to fix
with a plugin in an acceptable way.
2014-04-20 16:04:07 +02:00
asofold
b8fd9da08f Partly stitch up command protection.
- Never skip undoing changes. This is necessary to also process commands
that are not registered or that are fall-back aliases.
- Check adding all plugin commands always.
- Check for aliases as well for decision if to match a command.
2014-04-15 22:31:53 +02:00
asofold
547dfc890b Harden the command-pre-process handling against fall-back aliases.
These seem not to have been affected beforehand, due to the nature of
the SimpleCommandMap, however we don't want to exclusively rely on
fetching that one successfully.
2014-04-15 20:31:37 +02:00
asofold
e017ebf54a Increase VL change for blockplace.fastplace by a factor of 1000.
There had been a divisor of 1000, not sure why exactly.
2014-04-15 20:13:03 +02:00
asofold
1f0aafb63e Add a fail for null-worlds on updating set-back locations internally.
Setting a set-back location with a null World will now lead to a
NullPointerException. Setting null worlds on set-back locations is not
intended by contract, however due to using temporary Location instances
with Entity.getLocation(Location) and setting the world to null
afterwards to prevent memory leaks, also considering the number of
places where setSetBack is used, this seems to be an appropriate measure
to track better or help excluding violations of that contract.
2014-04-12 20:31:03 +02:00
asofold
af5e38b0a8 No extra NCP prefixes on commands. 2014-04-05 00:33:28 +02:00