mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-02-07 07:11:22 +01:00
Fix players in minecarts and reach in creativemode
This commit is contained in:
parent
6063b319a7
commit
8401d26d6d
@ -3,7 +3,7 @@ name: NoCheat
|
||||
author: Evenprime
|
||||
|
||||
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
||||
version: 2.16a
|
||||
version: 2.16b
|
||||
|
||||
commands:
|
||||
nocheat:
|
||||
|
@ -29,7 +29,7 @@ public class ReachCheck extends BlockPlaceCheck {
|
||||
|
||||
final SimpleLocation placedAgainstBlock = data.blockPlacedAgainst;
|
||||
|
||||
final double distance = CheckUtil.reachCheck(player, placedAgainstBlock.x + 0.5D, placedAgainstBlock.y + 0.5D, placedAgainstBlock.z + 0.5D, cc.reachDistance);
|
||||
final double distance = CheckUtil.reachCheck(player, placedAgainstBlock.x + 0.5D, placedAgainstBlock.y + 0.5D, placedAgainstBlock.z + 0.5D, player.isCreative() ? cc.reachDistance + 2 : cc.reachDistance);
|
||||
|
||||
if(distance > 0D) {
|
||||
// Player failed the check
|
||||
|
@ -85,6 +85,11 @@ public class MovingEventManager extends EventManager {
|
||||
@Override
|
||||
protected void handlePlayerMoveEvent(final PlayerMoveEvent event, final Priority priority) {
|
||||
|
||||
// Not interested at all in players in vehicles
|
||||
if(event.getPlayer().isInsideVehicle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the world-specific configuration that applies here
|
||||
final NoCheatPlayer player = plugin.getPlayer(event.getPlayer().getName());
|
||||
final CCMoving cc = player.getConfiguration().moving;
|
||||
|
@ -92,6 +92,6 @@ public class NoCheatPlayerImpl implements NoCheatPlayer {
|
||||
}
|
||||
|
||||
public boolean isCreative() {
|
||||
return player.getGameMode().equals(GameMode.CREATIVE);
|
||||
return player.getGameMode() == GameMode.CREATIVE;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user