mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
Log in survivalfly, if the player is wearing elytra, but no end rod.
This commit is contained in:
parent
ff12a15c97
commit
56f217c9f2
@ -22,6 +22,7 @@ import fr.neatmonster.nocheatplus.checks.moving.magic.MagicLiquid;
|
|||||||
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||||
import fr.neatmonster.nocheatplus.checks.moving.model.MoveData;
|
import fr.neatmonster.nocheatplus.checks.moving.model.MoveData;
|
||||||
import fr.neatmonster.nocheatplus.checks.workaround.WRPT;
|
import fr.neatmonster.nocheatplus.checks.workaround.WRPT;
|
||||||
|
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||||
import fr.neatmonster.nocheatplus.compat.BridgeEnchant;
|
import fr.neatmonster.nocheatplus.compat.BridgeEnchant;
|
||||||
import fr.neatmonster.nocheatplus.compat.blocks.BlockChangeTracker;
|
import fr.neatmonster.nocheatplus.compat.blocks.BlockChangeTracker;
|
||||||
import fr.neatmonster.nocheatplus.compat.blocks.BlockChangeTracker.Direction;
|
import fr.neatmonster.nocheatplus.compat.blocks.BlockChangeTracker.Direction;
|
||||||
@ -2205,6 +2206,9 @@ public class SurvivalFly extends Check {
|
|||||||
// Exception: does not take into account latency.
|
// Exception: does not take into account latency.
|
||||||
tags.add("lowfoodsprint");
|
tags.add("lowfoodsprint");
|
||||||
}
|
}
|
||||||
|
if (Bridge1_9.isWearingElytra(player)) {
|
||||||
|
tags.add("elytra_off");
|
||||||
|
}
|
||||||
if (!tags.isEmpty()) {
|
if (!tags.isEmpty()) {
|
||||||
builder.append("\n" + " tags: " + StringUtil.join(tags, "+"));
|
builder.append("\n" + " tags: " + StringUtil.join(tags, "+"));
|
||||||
}
|
}
|
||||||
|
@ -58,20 +58,20 @@ public class Bridge1_9 {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static boolean isReadyForElytra(final Player player) {
|
public static boolean isReadyForElytra(final Player player) {
|
||||||
// TODO: Off-hand testing needs to be supported, pass an instance for access.
|
|
||||||
// TODO: Generic jet-pack / potion support (triggers + model configs).
|
// TODO: Generic jet-pack / potion support (triggers + model configs).
|
||||||
if (END_ROD == null || ELYTRA == null) {
|
return END_ROD != null && ELYTRA != null && isWearingElytra(player) && hasItemInAnyHand(player, END_ROD);
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
ItemStack stack = player.getInventory().getChestplate();
|
/**
|
||||||
if (stack == null || stack.getType() != ELYTRA) {
|
* Just test if the player has elytra equipped in the chest plate slot. The
|
||||||
return false;
|
* player may or may not be holding an end rod in either hand.
|
||||||
}
|
*
|
||||||
if (!hasItemInAnyHand(player, END_ROD)) {
|
* @param player
|
||||||
return false;
|
* @return
|
||||||
}
|
*/
|
||||||
// Possible to use elytra.
|
public static boolean isWearingElytra(final Player player) {
|
||||||
return true;
|
final ItemStack stack = player.getInventory().getChestplate();
|
||||||
|
return stack != null && stack.getType() == ELYTRA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user