Fixed respawning (again)

This commit is contained in:
Evenprime 2011-07-13 01:15:10 +02:00
parent ad78a91aab
commit 243cea5102
4 changed files with 13 additions and 5 deletions

View File

@ -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 ]

View File

@ -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);
} }

View File

@ -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() { }

View File

@ -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);