mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
Fixed respawning (again)
This commit is contained in:
parent
ad78a91aab
commit
243cea5102
@ -3,7 +3,7 @@ name: NoCheat
|
|||||||
author: Evenprime
|
author: Evenprime
|
||||||
|
|
||||||
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
||||||
version: 1.09
|
version: 1.09b
|
||||||
|
|
||||||
softdepend: [ Permissions, CraftIRC ]
|
softdepend: [ Permissions, CraftIRC ]
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public class MovingCheck extends Check {
|
|||||||
|
|
||||||
if(runCheck) {
|
if(runCheck) {
|
||||||
result += Math.max(0D, runningCheck.check(from, to,
|
result += Math.max(0D, runningCheck.check(from, to,
|
||||||
player.isSneaking(), (fromType & toType & MovingEventHelper.LIQUID) > 0, data));
|
!allowFakeSneak && player.isSneaking(), !allowFastSwim && (fromType & toType & MovingEventHelper.LIQUID) > 0, data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -539,6 +539,7 @@ public class MovingCheck extends Check {
|
|||||||
pm.registerEvent(Event.Type.ENTITY_DAMAGE, new MovingEntityListener(this), Priority.Monitor, plugin);
|
pm.registerEvent(Event.Type.ENTITY_DAMAGE, new MovingEntityListener(this), Priority.Monitor, plugin);
|
||||||
pm.registerEvent(Event.Type.PLAYER_TELEPORT, new MovingPlayerMonitor(this), Priority.Monitor, plugin);
|
pm.registerEvent(Event.Type.PLAYER_TELEPORT, new MovingPlayerMonitor(this), Priority.Monitor, plugin);
|
||||||
pm.registerEvent(Event.Type.PLAYER_PORTAL, new MovingPlayerMonitor(this), Priority.Monitor, plugin);
|
pm.registerEvent(Event.Type.PLAYER_PORTAL, new MovingPlayerMonitor(this), Priority.Monitor, plugin);
|
||||||
|
pm.registerEvent(Event.Type.PLAYER_RESPAWN, new MovingPlayerMonitor(this), Priority.Monitor, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@ import cc.co.evenprime.bukkit.nocheat.data.MovingData;
|
|||||||
|
|
||||||
public class RunningCheck {
|
public class RunningCheck {
|
||||||
|
|
||||||
private final static double stepWidth = 0.22D;
|
public final static double stepWidth = 0.22D;
|
||||||
private final static double sneakWidth = 0.14D;
|
public final static double sneakWidth = 0.14D;
|
||||||
private final static double swimWidth = 0.18D;
|
public final static double swimWidth = 0.18D;
|
||||||
|
|
||||||
public RunningCheck() { }
|
public RunningCheck() { }
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
|||||||
import org.bukkit.event.player.PlayerListener;
|
import org.bukkit.event.player.PlayerListener;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.event.player.PlayerPortalEvent;
|
import org.bukkit.event.player.PlayerPortalEvent;
|
||||||
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.checks.MovingCheck;
|
import cc.co.evenprime.bukkit.nocheat.checks.MovingCheck;
|
||||||
@ -22,6 +23,12 @@ public class MovingPlayerMonitor extends PlayerListener {
|
|||||||
this.check = check;
|
this.check = check;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
||||||
|
MovingData data = MovingData.get(event.getPlayer());
|
||||||
|
data.wasTeleported = true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerPortal(PlayerPortalEvent event) {
|
public void onPlayerPortal(PlayerPortalEvent event) {
|
||||||
check.teleported(event);
|
check.teleported(event);
|
||||||
|
Loading…
Reference in New Issue
Block a user