2016-06-02 20:14:09 +02:00
|
|
|
/*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-04-22 15:00:42 +02:00
|
|
|
package fr.neatmonster.nocheatplus.checks.moving.player;
|
2012-08-03 16:48:06 +02:00
|
|
|
|
2016-03-06 14:36:51 +01:00
|
|
|
import java.util.LinkedList;
|
|
|
|
import java.util.List;
|
2012-08-03 16:48:06 +02:00
|
|
|
import java.util.Locale;
|
|
|
|
|
2015-02-06 02:27:23 +01:00
|
|
|
import org.bukkit.GameMode;
|
2012-08-03 16:48:06 +02:00
|
|
|
import org.bukkit.Location;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
import org.bukkit.World;
|
2012-08-03 16:48:06 +02:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2016-12-06 00:14:29 +01:00
|
|
|
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
2012-08-03 16:48:06 +02:00
|
|
|
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
|
|
|
import fr.neatmonster.nocheatplus.checks.Check;
|
2012-08-08 01:24:31 +02:00
|
|
|
import fr.neatmonster.nocheatplus.checks.CheckType;
|
2012-08-09 17:56:48 +02:00
|
|
|
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
2016-04-22 15:00:42 +02:00
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
2016-03-21 18:13:25 +01:00
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.magic.LostGround;
|
2016-03-12 00:24:32 +01:00
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.magic.Magic;
|
2016-03-21 18:13:25 +01:00
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
2015-09-13 13:05:10 +02:00
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.model.ModelFlying;
|
2016-05-12 00:45:18 +02:00
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
2016-03-21 18:13:25 +01:00
|
|
|
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
2016-03-25 19:40:31 +01:00
|
|
|
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
2015-02-06 02:27:23 +01:00
|
|
|
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
2016-12-06 00:14:29 +01:00
|
|
|
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
|
[BROKEN] Data storage overhaul (basics). (+)
(SAFETY COMMIT)
Largely breaking change.
* Interfaces in front of data types (and 'managers'), some interfaces
removed.
* Data and configuration fetching.
* Check activation checking (config flags, isEnabled, hasBypass).
* CheckType (activation checks, factories removed).
* Lots of collateral signature changes, including IPlayerData.
The (I)WorldDataManager stores per-world data (+ per world per check
type).
* Raw configurations.
* Typical flags: check activation, debug, lag adaption.
* Generic data, such as check configurations or per world check data.
The (I)PlayerDataManager stores per player data.
* Check Data.
* Typical flags: debug
* Exemption
* Check data (and config cache).
* Further mappings and later OfflinePlayerData.
* The registration interface will allow defining, how instances are
handled for registered types (factory, proxy, what on world change, what
on logout, global removal handler, per player removal handler).
(I)PlayerData is intended to be/become the central access point.
* External interface is IPlayerData now.
* Per player debug flags, exemptions.
* Fetching configuration and data: local cache, relaying fetching to
registered factories and proxy-registries/storage (e.g. fetching
configuration from per world storage).
Other fixes/changes:
(+) Extend the debug player command (set true/false, reset to world
default, arbitrary check types).
(+) PlayerData maintains a currentWorldIdentifier (to be used instead of
ChatData in future).
(+) The WorldConfigProvider getAll implementation returns a
LinkedHashSet now, avoiding duplicates.
(+) Move DefaultGenericInstanceRegistry to NCPCore.
(+) Thread-safety considerations for DefaultGenericInstanceRegistry.
(+) Don't log errors on hasBypass checking. TBD: Instead intercept
during listener methods (or even as a feature within the listener node:
e.g. @ThreadContext(primaryThread=true, skipOffContext=true,
cancelOffContext=true).
(+) Add fight.wrongturn permissions to plugin.yml.
(+) Missing GPLv3 headers.
Broken/Missing:
* WorldData inheritance from default: propagate all changes done
directly to the default config to children (all worlds that don't have
an explicit world_config.yml set) - possibly add an OverrideState or
similar, (NONE, FROM_DEFAULT, EXPLICIT) and don't override EXPLICIT if
coming from the default. Calling override on the default WorldData is
not to be confused with calling override for WorldDataManager (override
for all worlds as EXPLICIT).
* Organize overriding for special circumstances (version dependent
activation and the like). Might want to add registered override
handlers to be called on reload automatically.
* Store generic per check type per world data in the WorldDataManager,
such as configurations and per-world check data. TBD: Factories, cleanup
(!).
* Most efficient referencing (IWorldCheckTypeNode, IHandle<something>?).
* All the registry stuff (see PlayerData).
* Use interfaces for auto registry (and a flag within
RegistrationContext?) - world unload, world change, player join / leave.
* (Data expiration handling including transition to IOfflinePlayerData,
because now data is a little heavier.)
* Further details.
2018-02-13 15:15:23 +01:00
|
|
|
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
2016-03-06 14:36:51 +01:00
|
|
|
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
2016-06-21 09:31:21 +02:00
|
|
|
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
|
|
|
import fr.neatmonster.nocheatplus.utilities.location.TrigUtil;
|
2012-08-03 16:48:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A check designed for people that are allowed to fly. The complement to the "SurvivalFly", which is for people that
|
|
|
|
* aren't allowed to fly, and therefore have tighter rules to obey.
|
|
|
|
*/
|
|
|
|
public class CreativeFly extends Check {
|
|
|
|
|
2016-03-06 14:36:51 +01:00
|
|
|
private final List<String> tags = new LinkedList<String>();
|
2016-12-06 00:14:29 +01:00
|
|
|
private final BlockChangeTracker blockChangeTracker;
|
2016-03-06 14:36:51 +01:00
|
|
|
|
2012-08-08 01:24:31 +02:00
|
|
|
/**
|
|
|
|
* Instantiates a new creative fly check.
|
|
|
|
*/
|
|
|
|
public CreativeFly() {
|
|
|
|
super(CheckType.MOVING_CREATIVEFLY);
|
2016-12-06 00:14:29 +01:00
|
|
|
blockChangeTracker = NCPAPIProvider.getNoCheatPlusAPI().getBlockChangeTracker();
|
2012-08-08 01:24:31 +02:00
|
|
|
}
|
|
|
|
|
2012-08-03 16:48:06 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param player
|
|
|
|
* @param from
|
|
|
|
* @param to
|
2014-12-06 01:37:50 +01:00
|
|
|
* @param data
|
|
|
|
* @param cc
|
2016-03-18 12:20:30 +01:00
|
|
|
* @param time Milliseconds.
|
2014-12-06 01:37:50 +01:00
|
|
|
* @return
|
2012-08-03 16:48:06 +02:00
|
|
|
*/
|
2016-12-06 00:14:29 +01:00
|
|
|
public Location check(final Player player, final PlayerLocation from, final PlayerLocation to,
|
[BROKEN] Data storage overhaul (basics). (+)
(SAFETY COMMIT)
Largely breaking change.
* Interfaces in front of data types (and 'managers'), some interfaces
removed.
* Data and configuration fetching.
* Check activation checking (config flags, isEnabled, hasBypass).
* CheckType (activation checks, factories removed).
* Lots of collateral signature changes, including IPlayerData.
The (I)WorldDataManager stores per-world data (+ per world per check
type).
* Raw configurations.
* Typical flags: check activation, debug, lag adaption.
* Generic data, such as check configurations or per world check data.
The (I)PlayerDataManager stores per player data.
* Check Data.
* Typical flags: debug
* Exemption
* Check data (and config cache).
* Further mappings and later OfflinePlayerData.
* The registration interface will allow defining, how instances are
handled for registered types (factory, proxy, what on world change, what
on logout, global removal handler, per player removal handler).
(I)PlayerData is intended to be/become the central access point.
* External interface is IPlayerData now.
* Per player debug flags, exemptions.
* Fetching configuration and data: local cache, relaying fetching to
registered factories and proxy-registries/storage (e.g. fetching
configuration from per world storage).
Other fixes/changes:
(+) Extend the debug player command (set true/false, reset to world
default, arbitrary check types).
(+) PlayerData maintains a currentWorldIdentifier (to be used instead of
ChatData in future).
(+) The WorldConfigProvider getAll implementation returns a
LinkedHashSet now, avoiding duplicates.
(+) Move DefaultGenericInstanceRegistry to NCPCore.
(+) Thread-safety considerations for DefaultGenericInstanceRegistry.
(+) Don't log errors on hasBypass checking. TBD: Instead intercept
during listener methods (or even as a feature within the listener node:
e.g. @ThreadContext(primaryThread=true, skipOffContext=true,
cancelOffContext=true).
(+) Add fight.wrongturn permissions to plugin.yml.
(+) Missing GPLv3 headers.
Broken/Missing:
* WorldData inheritance from default: propagate all changes done
directly to the default config to children (all worlds that don't have
an explicit world_config.yml set) - possibly add an OverrideState or
similar, (NONE, FROM_DEFAULT, EXPLICIT) and don't override EXPLICIT if
coming from the default. Calling override on the default WorldData is
not to be confused with calling override for WorldDataManager (override
for all worlds as EXPLICIT).
* Organize overriding for special circumstances (version dependent
activation and the like). Might want to add registered override
handlers to be called on reload automatically.
* Store generic per check type per world data in the WorldDataManager,
such as configurations and per-world check data. TBD: Factories, cleanup
(!).
* Most efficient referencing (IWorldCheckTypeNode, IHandle<something>?).
* All the registry stuff (see PlayerData).
* Use interfaces for auto registry (and a flag within
RegistrationContext?) - world unload, world change, player join / leave.
* (Data expiration handling including transition to IOfflinePlayerData,
because now data is a little heavier.)
* Further details.
2018-02-13 15:15:23 +01:00
|
|
|
final MovingData data, final MovingConfig cc, final IPlayerData pData,
|
|
|
|
final long time, final int tick,
|
2017-01-29 18:32:43 +01:00
|
|
|
final boolean useBlockChangeTracker) {
|
2015-12-13 18:48:42 +01:00
|
|
|
|
2016-03-06 14:36:51 +01:00
|
|
|
// Reset tags, just in case.
|
|
|
|
tags.clear();
|
|
|
|
|
[BROKEN] Data storage overhaul (basics). (+)
(SAFETY COMMIT)
Largely breaking change.
* Interfaces in front of data types (and 'managers'), some interfaces
removed.
* Data and configuration fetching.
* Check activation checking (config flags, isEnabled, hasBypass).
* CheckType (activation checks, factories removed).
* Lots of collateral signature changes, including IPlayerData.
The (I)WorldDataManager stores per-world data (+ per world per check
type).
* Raw configurations.
* Typical flags: check activation, debug, lag adaption.
* Generic data, such as check configurations or per world check data.
The (I)PlayerDataManager stores per player data.
* Check Data.
* Typical flags: debug
* Exemption
* Check data (and config cache).
* Further mappings and later OfflinePlayerData.
* The registration interface will allow defining, how instances are
handled for registered types (factory, proxy, what on world change, what
on logout, global removal handler, per player removal handler).
(I)PlayerData is intended to be/become the central access point.
* External interface is IPlayerData now.
* Per player debug flags, exemptions.
* Fetching configuration and data: local cache, relaying fetching to
registered factories and proxy-registries/storage (e.g. fetching
configuration from per world storage).
Other fixes/changes:
(+) Extend the debug player command (set true/false, reset to world
default, arbitrary check types).
(+) PlayerData maintains a currentWorldIdentifier (to be used instead of
ChatData in future).
(+) The WorldConfigProvider getAll implementation returns a
LinkedHashSet now, avoiding duplicates.
(+) Move DefaultGenericInstanceRegistry to NCPCore.
(+) Thread-safety considerations for DefaultGenericInstanceRegistry.
(+) Don't log errors on hasBypass checking. TBD: Instead intercept
during listener methods (or even as a feature within the listener node:
e.g. @ThreadContext(primaryThread=true, skipOffContext=true,
cancelOffContext=true).
(+) Add fight.wrongturn permissions to plugin.yml.
(+) Missing GPLv3 headers.
Broken/Missing:
* WorldData inheritance from default: propagate all changes done
directly to the default config to children (all worlds that don't have
an explicit world_config.yml set) - possibly add an OverrideState or
similar, (NONE, FROM_DEFAULT, EXPLICIT) and don't override EXPLICIT if
coming from the default. Calling override on the default WorldData is
not to be confused with calling override for WorldDataManager (override
for all worlds as EXPLICIT).
* Organize overriding for special circumstances (version dependent
activation and the like). Might want to add registered override
handlers to be called on reload automatically.
* Store generic per check type per world data in the WorldDataManager,
such as configurations and per-world check data. TBD: Factories, cleanup
(!).
* Most efficient referencing (IWorldCheckTypeNode, IHandle<something>?).
* All the registry stuff (see PlayerData).
* Use interfaces for auto registry (and a flag within
RegistrationContext?) - world unload, world change, player join / leave.
* (Data expiration handling including transition to IOfflinePlayerData,
because now data is a little heavier.)
* Further details.
2018-02-13 15:15:23 +01:00
|
|
|
final boolean debug = pData.isDebugActive(type);
|
|
|
|
|
2016-03-10 20:00:23 +01:00
|
|
|
// Some edge data for this move.
|
|
|
|
final GameMode gameMode = player.getGameMode();
|
2016-05-12 00:45:18 +02:00
|
|
|
final PlayerMoveData thisMove = data.playerMoves.getCurrentMove();
|
2016-03-18 12:20:30 +01:00
|
|
|
// if (!data.thisMove.from.extraPropertiesValid) {
|
|
|
|
// // TODO: Confine by model config flag or just always do [if the latter: do it in the listener]?
|
|
|
|
// data.thisMove.setExtraProperties(from, to);
|
|
|
|
// }
|
2016-05-12 00:45:18 +02:00
|
|
|
final PlayerMoveData lastMove = data.playerMoves.getFirstPastMove();
|
2017-05-07 14:20:54 +02:00
|
|
|
final ModelFlying model = thisMove.modelFlying;
|
|
|
|
// TODO: Other set back policy for elytra, e.g. not set in narrow spaces?
|
2012-08-03 16:48:06 +02:00
|
|
|
|
2017-01-29 18:32:43 +01:00
|
|
|
// Proactive reset of elytraBoost (MC 1.11.2).
|
|
|
|
if (data.fireworksBoostDuration > 0) {
|
|
|
|
if (!lastMove.valid || lastMove.flyCheck != CheckType.MOVING_CREATIVEFLY
|
|
|
|
|| lastMove.modelFlying != model
|
|
|
|
|| data.fireworksBoostTickExpire < tick ) {
|
|
|
|
data.fireworksBoostDuration = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
data.fireworksBoostDuration --;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-03 16:48:06 +02:00
|
|
|
// Calculate some distances.
|
2015-12-13 18:48:42 +01:00
|
|
|
final double yDistance = thisMove.yDistance;
|
|
|
|
final double hDistance = thisMove.hDistance;
|
2012-08-03 16:48:06 +02:00
|
|
|
|
2015-02-06 02:27:23 +01:00
|
|
|
final boolean flying = gameMode == BridgeMisc.GAME_MODE_SPECTATOR || player.isFlying();
|
2016-03-21 18:13:25 +01:00
|
|
|
final boolean sprinting = time <= data.timeSprinting + cc.sprintingGrace;
|
|
|
|
|
|
|
|
// Lost ground, if set so.
|
2017-05-07 21:28:00 +02:00
|
|
|
if (model.getGround()) {
|
2016-03-21 18:13:25 +01:00
|
|
|
MovingUtil.prepareFullCheck(from, to, thisMove, Math.max(cc.yOnGround, cc.noFallyOnGround));
|
|
|
|
if (!thisMove.from.onGroundOrResetCond) {
|
|
|
|
if (from.isSamePos(to)) {
|
|
|
|
if (lastMove.toIsValid && lastMove.hDistance > 0.0 && lastMove.yDistance < -0.3 // Copy and paste from sf.
|
|
|
|
&& LostGround.lostGroundStill(player, from, to, hDistance, yDistance, sprinting, lastMove, data, cc, tags)) {
|
|
|
|
// Nothing to do.
|
|
|
|
}
|
|
|
|
}
|
2016-12-06 00:14:29 +01:00
|
|
|
else if (LostGround.lostGround(player, from, to, hDistance, yDistance, sprinting, lastMove,
|
|
|
|
data, cc, useBlockChangeTracker ? blockChangeTracker : null, tags)) {
|
2016-03-21 18:13:25 +01:00
|
|
|
// Nothing to do.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-01-19 00:20:00 +01:00
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
// Horizontal distance check.
|
2016-03-21 18:13:25 +01:00
|
|
|
double[] resH = hDist(player, from, to, hDistance, yDistance, sprinting, flying, lastMove, time, model, data, cc);
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
double limitH = resH[0];
|
|
|
|
double resultH = resH[1];
|
2014-08-23 23:12:41 +02:00
|
|
|
|
2013-03-08 04:06:17 +01:00
|
|
|
// Check velocity.
|
2014-10-10 17:08:35 +02:00
|
|
|
if (resultH > 0) {
|
2014-08-23 23:12:41 +02:00
|
|
|
double hFreedom = data.getHorizontalFreedom();
|
2014-10-10 17:08:35 +02:00
|
|
|
if (hFreedom < resultH) {
|
2014-08-23 23:12:41 +02:00
|
|
|
// Use queued velocity if possible.
|
|
|
|
hFreedom += data.useHorizontalVelocity(resultH - hFreedom);
|
|
|
|
}
|
2014-10-10 17:08:35 +02:00
|
|
|
if (hFreedom > 0.0) {
|
2014-08-23 23:12:41 +02:00
|
|
|
resultH = Math.max(0.0, resultH - hFreedom);
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
if (resultH <= 0.0) {
|
|
|
|
limitH = hDistance;
|
|
|
|
}
|
|
|
|
tags.add("hvel");
|
2014-08-23 23:12:41 +02:00
|
|
|
}
|
|
|
|
}
|
2014-10-10 17:08:35 +02:00
|
|
|
else {
|
2014-10-10 15:15:22 +02:00
|
|
|
data.clearActiveHorVel(); // TODO: test/check !
|
2014-08-23 23:12:41 +02:00
|
|
|
}
|
2012-08-03 16:48:06 +02:00
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
resultH *= 100.0; // Normalize to % of a block.
|
2016-03-06 14:36:51 +01:00
|
|
|
if (resultH > 0.0) {
|
|
|
|
tags.add("hdist");
|
|
|
|
}
|
2012-08-03 16:48:06 +02:00
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
// Vertical move.
|
|
|
|
double limitV = 0.0; // Limit.
|
|
|
|
double resultV = 0.0; // Violation (normalized to 100 * 1 block, applies if > 0.0).
|
[BLEEDING][BREAKING] Rework much of y-axis handling.
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).
Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
2015-09-15 23:55:17 +02:00
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
// Distinguish checking method by y-direction of the move.
|
|
|
|
if (yDistance > 0.0) {
|
|
|
|
// Ascend.
|
2016-03-21 18:13:25 +01:00
|
|
|
double[] res = vDistAscend(from, to, yDistance, flying, thisMove, lastMove, model, data, cc);
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
resultV = Math.max(resultV, res[1]);
|
|
|
|
limitV = res[0];
|
2015-11-22 02:40:49 +01:00
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
else if (yDistance < 0.0) {
|
|
|
|
// Descend.
|
|
|
|
double[] res = vDistDescend(from, to, yDistance, flying, lastMove, model, data, cc);
|
|
|
|
resultV = Math.max(resultV, res[1]);
|
|
|
|
limitV = res[0];
|
[BLEEDING][BREAKING] Rework much of y-axis handling.
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).
Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
2015-09-15 23:55:17 +02:00
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
else {
|
|
|
|
// Keep altitude.
|
|
|
|
double[] res = vDistZero(from, to, yDistance, flying, lastMove, model, data, cc);
|
|
|
|
resultV = Math.max(resultV, res[1]);
|
|
|
|
limitV = res[0];
|
2016-03-12 22:52:39 +01:00
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
|
2016-03-12 22:52:39 +01:00
|
|
|
// Velocity.
|
|
|
|
if (resultV > 0.0 && data.getOrUseVerticalVelocity(yDistance) != null) {
|
[BLEEDING][BREAKING] Rework much of y-axis handling.
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).
Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
2015-09-15 23:55:17 +02:00
|
|
|
resultV = 0.0;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
tags.add("vvel");
|
[BLEEDING][BREAKING] Rework much of y-axis handling.
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).
Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
2015-09-15 23:55:17 +02:00
|
|
|
}
|
2014-12-06 01:37:50 +01:00
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
// Add tag for maximum height check (silent set back).
|
2017-05-07 21:28:00 +02:00
|
|
|
final double maximumHeight = model.getMaxHeight() + player.getWorld().getMaxHeight();
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
if (to.getY() > maximumHeight) {
|
|
|
|
// TODO: Allow use velocity there (would need a flag to signal the actual check below)?
|
|
|
|
tags.add("maxheight");
|
|
|
|
}
|
|
|
|
|
|
|
|
resultV *= 100.0; // Normalize to % of a block.
|
2016-03-06 14:36:51 +01:00
|
|
|
if (resultV > 0.0) {
|
|
|
|
tags.add("vdist");
|
|
|
|
}
|
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
final double result = Math.max(0.0, resultH) + Math.max(0.0, resultV);
|
2012-08-03 16:48:06 +02:00
|
|
|
|
[BROKEN] Data storage overhaul (basics). (+)
(SAFETY COMMIT)
Largely breaking change.
* Interfaces in front of data types (and 'managers'), some interfaces
removed.
* Data and configuration fetching.
* Check activation checking (config flags, isEnabled, hasBypass).
* CheckType (activation checks, factories removed).
* Lots of collateral signature changes, including IPlayerData.
The (I)WorldDataManager stores per-world data (+ per world per check
type).
* Raw configurations.
* Typical flags: check activation, debug, lag adaption.
* Generic data, such as check configurations or per world check data.
The (I)PlayerDataManager stores per player data.
* Check Data.
* Typical flags: debug
* Exemption
* Check data (and config cache).
* Further mappings and later OfflinePlayerData.
* The registration interface will allow defining, how instances are
handled for registered types (factory, proxy, what on world change, what
on logout, global removal handler, per player removal handler).
(I)PlayerData is intended to be/become the central access point.
* External interface is IPlayerData now.
* Per player debug flags, exemptions.
* Fetching configuration and data: local cache, relaying fetching to
registered factories and proxy-registries/storage (e.g. fetching
configuration from per world storage).
Other fixes/changes:
(+) Extend the debug player command (set true/false, reset to world
default, arbitrary check types).
(+) PlayerData maintains a currentWorldIdentifier (to be used instead of
ChatData in future).
(+) The WorldConfigProvider getAll implementation returns a
LinkedHashSet now, avoiding duplicates.
(+) Move DefaultGenericInstanceRegistry to NCPCore.
(+) Thread-safety considerations for DefaultGenericInstanceRegistry.
(+) Don't log errors on hasBypass checking. TBD: Instead intercept
during listener methods (or even as a feature within the listener node:
e.g. @ThreadContext(primaryThread=true, skipOffContext=true,
cancelOffContext=true).
(+) Add fight.wrongturn permissions to plugin.yml.
(+) Missing GPLv3 headers.
Broken/Missing:
* WorldData inheritance from default: propagate all changes done
directly to the default config to children (all worlds that don't have
an explicit world_config.yml set) - possibly add an OverrideState or
similar, (NONE, FROM_DEFAULT, EXPLICIT) and don't override EXPLICIT if
coming from the default. Calling override on the default WorldData is
not to be confused with calling override for WorldDataManager (override
for all worlds as EXPLICIT).
* Organize overriding for special circumstances (version dependent
activation and the like). Might want to add registered override
handlers to be called on reload automatically.
* Store generic per check type per world data in the WorldDataManager,
such as configurations and per-world check data. TBD: Factories, cleanup
(!).
* Most efficient referencing (IWorldCheckTypeNode, IHandle<something>?).
* All the registry stuff (see PlayerData).
* Use interfaces for auto registry (and a flag within
RegistrationContext?) - world unload, world change, player join / leave.
* (Data expiration handling including transition to IOfflinePlayerData,
because now data is a little heavier.)
* Further details.
2018-02-13 15:15:23 +01:00
|
|
|
if (debug) {
|
2016-03-06 14:36:51 +01:00
|
|
|
outpuDebugMove(player, hDistance, limitH, yDistance, limitV, model, tags, data);
|
2014-12-06 01:37:50 +01:00
|
|
|
}
|
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
// Violation handling.
|
|
|
|
Location setBack = null; // Might get altered below.
|
|
|
|
if (result > 0.0) {
|
2016-03-18 12:29:57 +01:00
|
|
|
// Increment violation level.
|
|
|
|
data.creativeFlyVL += result;
|
|
|
|
|
|
|
|
// Execute whatever actions are associated with this check and the violation level and find out if we
|
|
|
|
// should cancel the event.
|
|
|
|
final ViolationData vd = new ViolationData(this, player, data.creativeFlyVL, result, cc.creativeFlyActions);
|
|
|
|
if (vd.needsParameters()) {
|
|
|
|
vd.setParameter(ParameterName.LOCATION_FROM, String.format(Locale.US, "%.2f, %.2f, %.2f", from.getX(), from.getY(), from.getZ()));
|
|
|
|
vd.setParameter(ParameterName.LOCATION_TO, String.format(Locale.US, "%.2f, %.2f, %.2f", to.getX(), to.getY(), to.getZ()));
|
|
|
|
vd.setParameter(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", TrigUtil.distance(from, to)));
|
|
|
|
if (!tags.isEmpty()) {
|
|
|
|
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
2012-10-08 04:28:39 +02:00
|
|
|
}
|
2016-03-18 12:29:57 +01:00
|
|
|
}
|
|
|
|
if (executeActions(vd).willCancel()) {
|
|
|
|
// Compose a new location based on coordinates of "newTo" and viewing direction of "event.getTo()"
|
|
|
|
// to allow the player to look somewhere else despite getting pulled back by NoCheatPlus.
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
setBack = data.getSetBack(to);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Maximum height check (silent set back).
|
|
|
|
if (to.getY() > maximumHeight) {
|
|
|
|
setBack = data.getSetBack(to);
|
[BROKEN] Data storage overhaul (basics). (+)
(SAFETY COMMIT)
Largely breaking change.
* Interfaces in front of data types (and 'managers'), some interfaces
removed.
* Data and configuration fetching.
* Check activation checking (config flags, isEnabled, hasBypass).
* CheckType (activation checks, factories removed).
* Lots of collateral signature changes, including IPlayerData.
The (I)WorldDataManager stores per-world data (+ per world per check
type).
* Raw configurations.
* Typical flags: check activation, debug, lag adaption.
* Generic data, such as check configurations or per world check data.
The (I)PlayerDataManager stores per player data.
* Check Data.
* Typical flags: debug
* Exemption
* Check data (and config cache).
* Further mappings and later OfflinePlayerData.
* The registration interface will allow defining, how instances are
handled for registered types (factory, proxy, what on world change, what
on logout, global removal handler, per player removal handler).
(I)PlayerData is intended to be/become the central access point.
* External interface is IPlayerData now.
* Per player debug flags, exemptions.
* Fetching configuration and data: local cache, relaying fetching to
registered factories and proxy-registries/storage (e.g. fetching
configuration from per world storage).
Other fixes/changes:
(+) Extend the debug player command (set true/false, reset to world
default, arbitrary check types).
(+) PlayerData maintains a currentWorldIdentifier (to be used instead of
ChatData in future).
(+) The WorldConfigProvider getAll implementation returns a
LinkedHashSet now, avoiding duplicates.
(+) Move DefaultGenericInstanceRegistry to NCPCore.
(+) Thread-safety considerations for DefaultGenericInstanceRegistry.
(+) Don't log errors on hasBypass checking. TBD: Instead intercept
during listener methods (or even as a feature within the listener node:
e.g. @ThreadContext(primaryThread=true, skipOffContext=true,
cancelOffContext=true).
(+) Add fight.wrongturn permissions to plugin.yml.
(+) Missing GPLv3 headers.
Broken/Missing:
* WorldData inheritance from default: propagate all changes done
directly to the default config to children (all worlds that don't have
an explicit world_config.yml set) - possibly add an OverrideState or
similar, (NONE, FROM_DEFAULT, EXPLICIT) and don't override EXPLICIT if
coming from the default. Calling override on the default WorldData is
not to be confused with calling override for WorldDataManager (override
for all worlds as EXPLICIT).
* Organize overriding for special circumstances (version dependent
activation and the like). Might want to add registered override
handlers to be called on reload automatically.
* Store generic per check type per world data in the WorldDataManager,
such as configurations and per-world check data. TBD: Factories, cleanup
(!).
* Most efficient referencing (IWorldCheckTypeNode, IHandle<something>?).
* All the registry stuff (see PlayerData).
* Use interfaces for auto registry (and a flag within
RegistrationContext?) - world unload, world change, player join / leave.
* (Data expiration handling including transition to IOfflinePlayerData,
because now data is a little heavier.)
* Further details.
2018-02-13 15:15:23 +01:00
|
|
|
if (debug) {
|
2017-05-07 22:29:38 +02:00
|
|
|
debug(player, "Maximum height exceeded, silent set-back.");
|
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
}
|
|
|
|
if (setBack == null) {
|
|
|
|
// Slowly reduce the violation level with each event.
|
|
|
|
data.creativeFlyVL *= 0.97;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return setBack, if set.
|
|
|
|
if (setBack != null) {
|
2017-04-02 15:01:23 +02:00
|
|
|
// Check for max height of the set back.
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
if (setBack.getY() > maximumHeight) {
|
|
|
|
// Correct the y position.
|
|
|
|
setBack.setY(getCorrectedHeight(maximumHeight, setBack.getWorld()));
|
[BROKEN] Data storage overhaul (basics). (+)
(SAFETY COMMIT)
Largely breaking change.
* Interfaces in front of data types (and 'managers'), some interfaces
removed.
* Data and configuration fetching.
* Check activation checking (config flags, isEnabled, hasBypass).
* CheckType (activation checks, factories removed).
* Lots of collateral signature changes, including IPlayerData.
The (I)WorldDataManager stores per-world data (+ per world per check
type).
* Raw configurations.
* Typical flags: check activation, debug, lag adaption.
* Generic data, such as check configurations or per world check data.
The (I)PlayerDataManager stores per player data.
* Check Data.
* Typical flags: debug
* Exemption
* Check data (and config cache).
* Further mappings and later OfflinePlayerData.
* The registration interface will allow defining, how instances are
handled for registered types (factory, proxy, what on world change, what
on logout, global removal handler, per player removal handler).
(I)PlayerData is intended to be/become the central access point.
* External interface is IPlayerData now.
* Per player debug flags, exemptions.
* Fetching configuration and data: local cache, relaying fetching to
registered factories and proxy-registries/storage (e.g. fetching
configuration from per world storage).
Other fixes/changes:
(+) Extend the debug player command (set true/false, reset to world
default, arbitrary check types).
(+) PlayerData maintains a currentWorldIdentifier (to be used instead of
ChatData in future).
(+) The WorldConfigProvider getAll implementation returns a
LinkedHashSet now, avoiding duplicates.
(+) Move DefaultGenericInstanceRegistry to NCPCore.
(+) Thread-safety considerations for DefaultGenericInstanceRegistry.
(+) Don't log errors on hasBypass checking. TBD: Instead intercept
during listener methods (or even as a feature within the listener node:
e.g. @ThreadContext(primaryThread=true, skipOffContext=true,
cancelOffContext=true).
(+) Add fight.wrongturn permissions to plugin.yml.
(+) Missing GPLv3 headers.
Broken/Missing:
* WorldData inheritance from default: propagate all changes done
directly to the default config to children (all worlds that don't have
an explicit world_config.yml set) - possibly add an OverrideState or
similar, (NONE, FROM_DEFAULT, EXPLICIT) and don't override EXPLICIT if
coming from the default. Calling override on the default WorldData is
not to be confused with calling override for WorldDataManager (override
for all worlds as EXPLICIT).
* Organize overriding for special circumstances (version dependent
activation and the like). Might want to add registered override
handlers to be called on reload automatically.
* Store generic per check type per world data in the WorldDataManager,
such as configurations and per-world check data. TBD: Factories, cleanup
(!).
* Most efficient referencing (IWorldCheckTypeNode, IHandle<something>?).
* All the registry stuff (see PlayerData).
* Use interfaces for auto registry (and a flag within
RegistrationContext?) - world unload, world change, player join / leave.
* (Data expiration handling including transition to IOfflinePlayerData,
because now data is a little heavier.)
* Further details.
2018-02-13 15:15:23 +01:00
|
|
|
if (debug) {
|
2017-04-02 15:01:23 +02:00
|
|
|
debug(player, "Maximum height exceeded by set back, correct to: " + setBack.getY());
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
}
|
|
|
|
}
|
2016-03-21 18:13:25 +01:00
|
|
|
data.sfJumpPhase = 0;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
return setBack;
|
|
|
|
}
|
|
|
|
else {
|
2017-04-02 15:01:23 +02:00
|
|
|
// Adjust the set back and other last distances.
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
data.setSetBack(to);
|
2016-03-21 18:13:25 +01:00
|
|
|
// Adjust jump phase.
|
|
|
|
if (!thisMove.from.onGroundOrResetCond && !thisMove.to.onGroundOrResetCond) {
|
|
|
|
data.sfJumpPhase ++;
|
|
|
|
}
|
|
|
|
else if (thisMove.touchedGround && !thisMove.to.onGroundOrResetCond) {
|
|
|
|
data.sfJumpPhase = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
data.sfJumpPhase = 0;
|
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param player
|
|
|
|
* @param from
|
|
|
|
* @param to
|
|
|
|
* @param hDistance
|
|
|
|
* @param yDistance
|
|
|
|
* @param flying
|
|
|
|
* @param lastMove
|
|
|
|
* @param time
|
|
|
|
* @param model
|
|
|
|
* @param data
|
|
|
|
* @param cc
|
|
|
|
* @return limitH, resultH (not normalized).
|
|
|
|
*/
|
2016-05-12 00:45:18 +02:00
|
|
|
private double[] hDist(final Player player, final PlayerLocation from, final PlayerLocation to, final double hDistance, final double yDistance, final boolean sprinting, final boolean flying, final PlayerMoveData lastMove, final long time, final ModelFlying model, final MovingData data, final MovingConfig cc) {
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
// Modifiers.
|
|
|
|
double fSpeed;
|
|
|
|
|
|
|
|
// TODO: Make this configurable ! [Speed effect should not affect flying if not on ground.]
|
2017-05-07 21:28:00 +02:00
|
|
|
if (model.getApplyModifiers()) {
|
2016-06-19 15:55:44 +02:00
|
|
|
final double speedModifier = mcAccess.getHandle().getFasterMovementAmplifier(player);
|
2016-12-27 15:10:08 +01:00
|
|
|
if (Double.isInfinite(speedModifier)) {
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
fSpeed = 1.0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fSpeed = 1.0 + 0.2 * (speedModifier + 1.0);
|
|
|
|
}
|
|
|
|
if (flying) {
|
|
|
|
// TODO: Consider mechanics for flying backwards.
|
2017-02-21 19:26:46 +01:00
|
|
|
fSpeed *= data.flySpeed / Magic.DEFAULT_FLYSPEED;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
if (sprinting) {
|
|
|
|
// TODO: Prevent for pre-1.8?
|
2017-05-07 21:28:00 +02:00
|
|
|
fSpeed *= model.getHorizontalModSprint();
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
tags.add("sprint");
|
|
|
|
}
|
|
|
|
tags.add("flying");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// (Ignore sprinting here).
|
2017-02-21 19:26:46 +01:00
|
|
|
fSpeed *= data.walkSpeed / Magic.DEFAULT_WALKSPEED;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fSpeed = 1.0;
|
|
|
|
}
|
|
|
|
|
2017-05-07 21:28:00 +02:00
|
|
|
double limitH = model.getHorizontalModSpeed() / 100.0 * ModelFlying.HORIZONTAL_SPEED * fSpeed;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
|
|
|
|
if (lastMove.toIsValid) {
|
|
|
|
// TODO: Use last friction (as well)?
|
|
|
|
// TODO: Test/adjust more.
|
|
|
|
double frictionDist = lastMove.hDistance * Magic.FRICTION_MEDIUM_AIR;
|
|
|
|
limitH = Math.max(frictionDist, limitH);
|
|
|
|
tags.add("hfrict");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Finally, determine how far the player went beyond the set limits.
|
|
|
|
// double resultH = Math.max(0.0.0, hDistance - data.horizontalFreedom - limitH);
|
|
|
|
double resultH = Math.max(0.0, hDistance - limitH);
|
|
|
|
|
2017-05-07 21:28:00 +02:00
|
|
|
if (model.getApplyModifiers()) {
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
data.bunnyhopDelay--;
|
|
|
|
if (!flying && resultH > 0 && sprinting) {
|
|
|
|
// TODO: Flying and bunnyhop ? <- 8 blocks per second - could be a case.
|
|
|
|
// Try to treat it as a the "bunnyhop" problem. The bunnyhop problem is that landing and immediately jumping
|
|
|
|
// again leads to a player moving almost twice as far in that step.
|
|
|
|
// TODO: Real modeling for that kind of moving pattern (same with sf?).
|
|
|
|
if (data.bunnyhopDelay <= 0 && resultH < 0.4) {
|
|
|
|
data.bunnyhopDelay = 9;
|
|
|
|
resultH = 0.0;
|
|
|
|
tags.add("bunnyhop");
|
|
|
|
}
|
2014-10-10 17:08:35 +02:00
|
|
|
}
|
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
return new double[] {limitH, resultH};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param from
|
|
|
|
* @param to
|
|
|
|
* @param yDistance
|
|
|
|
* @param flying
|
|
|
|
* @param lastMove
|
|
|
|
* @param model
|
|
|
|
* @param data
|
|
|
|
* @param cc
|
|
|
|
* @return limitV, resultV (not normalized).
|
|
|
|
*/
|
2016-05-12 00:45:18 +02:00
|
|
|
private double[] vDistAscend(final PlayerLocation from, final PlayerLocation to, final double yDistance, final boolean flying, final PlayerMoveData thisMove, final PlayerMoveData lastMove, final ModelFlying model, final MovingData data, final MovingConfig cc) {
|
2017-05-07 21:28:00 +02:00
|
|
|
double limitV = model.getVerticalAscendModSpeed() / 100.0 * ModelFlying.VERTICAL_ASCEND_SPEED; // * data.jumpAmplifier;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
double resultV = 0.0;
|
2017-05-07 21:28:00 +02:00
|
|
|
if (model.getApplyModifiers() && flying && yDistance > 0.0) {
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
// Let fly speed apply with moving upwards.
|
2017-02-21 19:26:46 +01:00
|
|
|
limitV *= data.flySpeed / Magic.DEFAULT_FLYSPEED;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
}
|
2017-05-07 21:28:00 +02:00
|
|
|
else if (model.getScaleLevitationEffect() && Bridge1_9.hasLevitation()) {
|
2016-05-26 12:57:28 +02:00
|
|
|
// Exclude modifiers for now.
|
|
|
|
final double levitation = Bridge1_9.getLevitationAmplifier(from.getPlayer());
|
|
|
|
if (levitation > 0.0) {
|
|
|
|
// (Double checked.)
|
|
|
|
// TODO: Perhaps do with a modifier instead, to avoid confusion.
|
|
|
|
limitV += 0.046 * levitation; // (It ends up like 0.5 added extra for some levels of levitation, roughly.)
|
|
|
|
tags.add("levitation:" + levitation);
|
|
|
|
}
|
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
|
2017-01-29 18:32:43 +01:00
|
|
|
// Related to elytra.
|
2017-05-07 22:29:38 +02:00
|
|
|
if (model.getVerticalAscendGliding()) {
|
2017-01-29 18:32:43 +01:00
|
|
|
// TODO: Better detection of an elytra model (extra flags?).
|
2017-05-07 22:29:38 +02:00
|
|
|
limitV = Math.max(limitV, limitV = hackLytra(yDistance, limitV, thisMove, lastMove, data));
|
2016-03-25 19:40:31 +01:00
|
|
|
}
|
|
|
|
|
2017-05-07 21:28:00 +02:00
|
|
|
if (model.getGravity()) {
|
2016-03-21 18:13:25 +01:00
|
|
|
// Friction with gravity.
|
2017-05-07 21:28:00 +02:00
|
|
|
if (yDistance > limitV && lastMove.toIsValid) { // TODO: gravity/friction?
|
2016-03-21 18:13:25 +01:00
|
|
|
// (Disregard gravity.)
|
|
|
|
// TODO: Use last friction (as well)?
|
|
|
|
double frictionDist = lastMove.yDistance * Magic.FRICTION_MEDIUM_AIR;
|
|
|
|
if (!flying) {
|
|
|
|
frictionDist -= Magic.GRAVITY_MIN;
|
|
|
|
}
|
|
|
|
if (frictionDist > limitV) {
|
|
|
|
limitV = frictionDist;
|
|
|
|
tags.add("vfrict_g");
|
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-07 21:28:00 +02:00
|
|
|
if (model.getGround()) {
|
2016-03-21 18:13:25 +01:00
|
|
|
// Jump lift off gain.
|
|
|
|
// NOTE: This assumes SurvivalFly busies about moves with from.onGroundOrResetCond.
|
|
|
|
if (yDistance > limitV && !thisMove.to.onGroundOrResetCond && !thisMove.from.onGroundOrResetCond && (
|
|
|
|
// Last move touched ground.
|
|
|
|
lastMove.toIsValid && lastMove.touchedGround &&
|
|
|
|
(lastMove.yDistance <= 0.0 || lastMove.to.extraPropertiesValid && lastMove.to.onGround)
|
|
|
|
// This move touched ground by a workaround.
|
|
|
|
|| thisMove.touchedGroundWorkaround
|
|
|
|
)) {
|
|
|
|
// Allow normal jumping.
|
|
|
|
final double maxGain = LiftOffEnvelope.NORMAL.getMaxJumpGain(data.jumpAmplifier);
|
|
|
|
if (maxGain > limitV) {
|
|
|
|
limitV = maxGain;
|
|
|
|
tags.add("jump_gain");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
|
2016-03-21 18:13:25 +01:00
|
|
|
// Ordinary step up.
|
|
|
|
// TODO: Might be within a 'if (model.ground)' block?
|
|
|
|
// TODO: sfStepHeight should be a common modeling parameter?
|
|
|
|
if (yDistance > limitV && yDistance <= cc.sfStepHeight
|
|
|
|
&& (lastMove.toIsValid && lastMove.yDistance < 0.0 || from.isOnGroundOrResetCond() || thisMove.touchedGroundWorkaround)
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
&& to.isOnGround()) {
|
|
|
|
// (Jump effect not checked yet.)
|
2016-03-21 18:13:25 +01:00
|
|
|
limitV = cc.sfStepHeight;
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
tags.add("step_up");
|
|
|
|
}
|
2016-03-21 18:13:25 +01:00
|
|
|
|
|
|
|
// Determine violation amount.
|
|
|
|
resultV = Math.max(0.0, yDistance - limitV);
|
|
|
|
|
|
|
|
// Post-violation recovery.
|
|
|
|
|
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
return new double[] {limitV, resultV};
|
|
|
|
}
|
|
|
|
|
2016-05-12 00:45:18 +02:00
|
|
|
private double hackLytra(final double yDistance, final double limitV, final PlayerMoveData thisMove, final PlayerMoveData lastMove, final MovingData data) {
|
2017-01-29 18:32:43 +01:00
|
|
|
// TODO: Hack, move / config / something.
|
|
|
|
// TODO: Confine more. hdist change relates to ydist change
|
2017-04-02 15:01:23 +02:00
|
|
|
// TODO: Further: jumpphase vs. y-distance to set back. Problem: velocity
|
2016-03-25 19:40:31 +01:00
|
|
|
// TODO: Further: record max h and descend speeds and relate to those.
|
|
|
|
// TODO: Demand total speed to decrease.
|
|
|
|
if (yDistance > Magic.GLIDE_DESCEND_PHASE_MIN && yDistance < 17.0 * Magic.GRAVITY_MAX
|
|
|
|
&& (
|
|
|
|
// Normal envelope.
|
|
|
|
yDistance - lastMove.yDistance < Magic.GRAVITY_MAX * 1.5
|
|
|
|
// Inversion (neg -> pos).
|
|
|
|
|| lastMove.yDistance < -Magic.GRAVITY_SPAN && yDistance < Magic.GRAVITY_MAX + Magic.GRAVITY_ODD && yDistance > Magic.GRAVITY_SPAN
|
|
|
|
)
|
|
|
|
&& thisMove.hDistance < lastMove.hDistance
|
|
|
|
&& (lastMove.yDistance > 0.0 || lastMove.hDistance > 0.55) // Demand some speed on the transition.
|
|
|
|
// Demand total speed to decrease somehow, unless for the very transition.
|
|
|
|
&& (thisMove.distanceSquared / lastMove.distanceSquared < 0.99
|
|
|
|
|| lastMove.yDistance < 0.0) // Might confine the latter something to be tested.
|
|
|
|
) {
|
|
|
|
if (lastMove.hDistance > 0.52) {
|
|
|
|
// (Increasing y-distance.)
|
|
|
|
tags.add("elytra_asc1");
|
|
|
|
return yDistance;
|
|
|
|
}
|
|
|
|
else if (thisMove.hDistance > Magic.GRAVITY_MIN && yDistance < lastMove.yDistance) {
|
|
|
|
// (Decreasing y-distance.)
|
2016-05-12 00:45:18 +02:00
|
|
|
final PlayerMoveData pastMove1 = data.playerMoves.getSecondPastMove();
|
2016-03-25 19:40:31 +01:00
|
|
|
if (pastMove1.toIsValid && pastMove1.to.extraPropertiesValid) {
|
|
|
|
// Demand this being the first one, or decreasing by a decent amount with past two moves.
|
|
|
|
if (
|
|
|
|
// First move rather decreasing.
|
|
|
|
pastMove1.yDistance < lastMove.yDistance
|
|
|
|
// Decreasing by a reasonable (?) amount.
|
|
|
|
|| yDistance - pastMove1.yDistance < -0.001
|
|
|
|
// && yDistance - lastMove.yDistance < lastMove.yDistance - pastMove1.yDistance - 0.0005 // Probably need remove.
|
|
|
|
) {
|
|
|
|
tags.add("elytra_asc2");
|
|
|
|
return yDistance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-01-29 18:32:43 +01:00
|
|
|
}
|
2016-03-25 19:40:31 +01:00
|
|
|
|
2017-01-29 18:32:43 +01:00
|
|
|
// Elytra boost with fireworks rockets.
|
|
|
|
if (yDistance > limitV && data.fireworksBoostDuration > 0 && lastMove.toIsValid
|
|
|
|
&& (
|
|
|
|
yDistance >= lastMove.yDistance
|
|
|
|
|| yDistance - lastMove.yDistance < Magic.GRAVITY_MAX
|
|
|
|
// TODO: Head blocked -> friction does it?
|
|
|
|
)
|
|
|
|
&& (
|
|
|
|
yDistance - lastMove.yDistance < 0.77 // TODO
|
|
|
|
|| lastMove.yDistance < 0.0 && yDistance < 1.54
|
|
|
|
)
|
|
|
|
&& yDistance < 1.67 // Last resort, check / TODO
|
|
|
|
) {
|
|
|
|
/*
|
|
|
|
* TODO: Do cross check item consumption (do other events fire?).
|
|
|
|
* [?on tick: expectations framework, check before tick and before
|
|
|
|
* other inventory events, once set]
|
|
|
|
*/
|
|
|
|
// TODO: Remove fumbling with magic constants.
|
|
|
|
// TODO: Relate horizontal to vertical + relate to looking direction.
|
|
|
|
// TODO: More invalidation conditions, like total age (checked elsewhere?).
|
|
|
|
tags.add("fw_boost_asc");
|
|
|
|
return yDistance;
|
2016-03-25 19:40:31 +01:00
|
|
|
}
|
2017-01-29 18:32:43 +01:00
|
|
|
|
2016-03-25 19:40:31 +01:00
|
|
|
return limitV;
|
|
|
|
}
|
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param from
|
|
|
|
* @param to
|
|
|
|
* @param yDistance
|
|
|
|
* @param flying
|
|
|
|
* @param lastMove
|
|
|
|
* @param model
|
|
|
|
* @param data
|
|
|
|
* @param cc
|
|
|
|
* @return limitV, resultV
|
|
|
|
*/
|
2016-05-12 00:45:18 +02:00
|
|
|
private double[] vDistDescend(final PlayerLocation from, final PlayerLocation to, final double yDistance, final boolean flying, final PlayerMoveData lastMove, final ModelFlying model, final MovingData data, final MovingConfig cc) {
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
double limitV = 0.0;
|
|
|
|
double resultV = 0.0;
|
|
|
|
// Note that 'extreme moves' are covered by the extreme move check.
|
|
|
|
// TODO: if gravity: friction + gravity.
|
|
|
|
// TODO: deny falling, possibly special case head-step-down - to be tested (levitation).
|
|
|
|
// TODO: min-max envelope (elytra).
|
|
|
|
// TODO: ordinary flying (flying: enforce maximum speed at least)
|
|
|
|
return new double[] {limitV, resultV};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param from
|
|
|
|
* @param to
|
|
|
|
* @param yDistance
|
|
|
|
* @param flying
|
|
|
|
* @param lastMove
|
|
|
|
* @param model
|
|
|
|
* @param data
|
|
|
|
* @param cc
|
|
|
|
* @return limitV, resultV
|
|
|
|
*/
|
2016-05-12 00:45:18 +02:00
|
|
|
private double[] vDistZero(final PlayerLocation from, final PlayerLocation to, final double yDistance, final boolean flying, final PlayerMoveData lastMove, final ModelFlying model, final MovingData data, final MovingConfig cc) {
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
double limitV = 0.0;
|
|
|
|
double resultV = 0.0;
|
|
|
|
// TODO: Deny on enforcing mingain.
|
|
|
|
return new double[] {limitV, resultV};
|
|
|
|
}
|
2012-08-03 16:48:06 +02:00
|
|
|
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
private double getCorrectedHeight(final double maximumHeight, final World world) {
|
|
|
|
return Math.max(maximumHeight - 10.0, world.getMaxHeight());
|
2012-08-03 16:48:06 +02:00
|
|
|
}
|
2014-12-06 01:37:50 +01:00
|
|
|
|
2016-12-17 15:07:23 +01:00
|
|
|
private void outpuDebugMove(final Player player, final double hDistance, final double limitH,
|
|
|
|
final double yDistance, final double limitV, final ModelFlying model, final List<String> tags,
|
|
|
|
final MovingData data) {
|
2016-05-12 00:45:18 +02:00
|
|
|
final PlayerMoveData lastMove = data.playerMoves.getFirstPastMove();
|
2014-12-06 01:37:50 +01:00
|
|
|
StringBuilder builder = new StringBuilder(350);
|
2016-03-25 19:40:31 +01:00
|
|
|
final String dHDist = lastMove.toIsValid ? " (" + StringUtil.formatDiff(hDistance, lastMove.hDistance) + ")" : "";
|
|
|
|
final String dYDist = lastMove.toIsValid ? " (" + StringUtil.formatDiff(yDistance, lastMove.yDistance)+ ")" : "";
|
|
|
|
builder.append("hDist: " + hDistance + dHDist + " / " + limitH + " , vDist: " + yDistance + dYDist + " / " + limitV);
|
2016-05-12 00:45:18 +02:00
|
|
|
final PlayerMoveData thisMove = data.playerMoves.getCurrentMove();
|
2016-03-25 19:40:31 +01:00
|
|
|
if (lastMove.toIsValid) {
|
2016-05-11 23:21:38 +02:00
|
|
|
builder.append(" , fdsq: " + StringUtil.fdec3.format(thisMove.distanceSquared / lastMove.distanceSquared));
|
2016-03-25 19:40:31 +01:00
|
|
|
}
|
2016-12-17 15:07:23 +01:00
|
|
|
if (thisMove.verVelUsed != null) {
|
|
|
|
builder.append(" , vVelUsed: " + thisMove.verVelUsed);
|
[BLEEDING][BREAKING] Rework much of y-axis handling.
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).
Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
2015-09-15 23:55:17 +02:00
|
|
|
}
|
2017-05-07 21:28:00 +02:00
|
|
|
if (data.fireworksBoostDuration > 0 && MovingConfig.ID_JETPACK_ELYTRA.equals(model.getId())) {
|
2017-01-29 18:32:43 +01:00
|
|
|
builder.append(" , boost: " + data.fireworksBoostDuration);
|
|
|
|
}
|
2017-05-07 21:28:00 +02:00
|
|
|
builder.append(" , model: " + model.getId());
|
2016-03-06 14:36:51 +01:00
|
|
|
if (!tags.isEmpty()) {
|
[BLEEDING] Re-organize creativefly, extend configuration.
* Do or start to distinguish ascend vs. descend, if gravity is used, if
modifiers are used, similar, based on the model in use (the vertical
check part had never accounted for descending anyway). Shuffle chunks of
code.
* Reflect new options in the configuration, sort in more to vertical and
horizontal sections.
* Alter set-back handling, use ordinary set-back for maxheight,
prioritie other violations over maxheight.
* fly-nofly transition: Clear active horizontal velocity, allow less
horizontal friction.
* Increase horizontal speed to 420 for spectator mode.
* Add more tags with specific cases applying.
* Adjust logging format of hdist/vdist.
This probably isn't a usable state, more changes and testing will
follow.
2016-03-19 10:53:57 +01:00
|
|
|
builder.append(" , tags: ");
|
2016-03-06 14:36:51 +01:00
|
|
|
builder.append(StringUtil.join(tags, "+"));
|
|
|
|
}
|
2016-03-21 18:13:25 +01:00
|
|
|
builder.append(" , jumpphase: " + data.sfJumpPhase);
|
2016-05-11 23:21:38 +02:00
|
|
|
thisMove.addExtraProperties(builder, " , ");
|
2016-01-25 19:25:44 +01:00
|
|
|
debug(player, builder.toString());
|
2014-12-06 01:37:50 +01:00
|
|
|
}
|
[BLEEDING][BREAKING] Rework much of y-axis handling.
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).
Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
2015-09-15 23:55:17 +02:00
|
|
|
|
2012-08-03 16:48:06 +02:00
|
|
|
}
|