Two small fixes, added grace period for users that just logged in.

This commit is contained in:
Adam committed 2012-05-12 15:39:32 -04:00
1 parent e20ea7c551
commit bb756e952c
2 files changed
+8 -1

No files matched your search

@@ -158,6 +158,7 @@ public class PlayerListener extends EventListener
{
player.sendMessage("§f §f §4 §0 §9 §6");
}
backend.logJoin(event.getPlayer());
}
@EventHandler
@@ -35,6 +35,7 @@ import org.bukkit.event.player.PlayerToggleSprintEvent;
public class Backend
{
public static final int ENTERED_EXTITED_TIME = 20;
public static final int JOIN_TIME = 40;
public static final int DROPPED_ITEM_TIME = 2;
public static final int DAMAGE_TIME = 50;
public static final int KNOCKBACK_DAMAGE_TIME = 50;
@@ -211,7 +212,7 @@ public class Backend
public boolean checkFlight(Player player, double y1, double y2)
{
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
if(y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0)
if(y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player))
{
String name = player.getName();
if(Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player))
@@ -367,6 +368,11 @@ public class Backend
logEvent(movingExempt,player,ENTERED_EXTITED_TIME);
}
public void logJoin(final Player player)
{
logEvent(movingExempt,player,JOIN_TIME);
}
public boolean isMovingExempt(Player player)
{
return movingExempt.contains(player.getName()) || player.isFlying();