mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Cleanup this task a bit.
This commit is contained in:
parent
3aedeea220
commit
7ed218ee7f
@ -28,13 +28,12 @@ public class ChimaeraWingWarmup extends BukkitRunnable {
|
|||||||
private void checkChimaeraWingTeleport() {
|
private void checkChimaeraWingTeleport() {
|
||||||
Player player = mcMMOPlayer.getPlayer();
|
Player player = mcMMOPlayer.getPlayer();
|
||||||
Location previousLocation = mcMMOPlayer.getTeleportCommenceLocation();
|
Location previousLocation = mcMMOPlayer.getTeleportCommenceLocation();
|
||||||
Location newLocation = mcMMOPlayer.getPlayer().getLocation();
|
|
||||||
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
|
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
|
||||||
ItemStack inHand = player.getItemInHand();
|
ItemStack inHand = player.getItemInHand();
|
||||||
|
|
||||||
mcMMOPlayer.setTeleportCommenceLocation(null);
|
mcMMOPlayer.setTeleportCommenceLocation(null);
|
||||||
|
|
||||||
if (newLocation.distanceSquared(previousLocation) > 1.0 || !player.getInventory().containsAtLeast(ChimaeraWing.getChimaeraWing(0), 1)) {
|
if (player.getLocation().distanceSquared(previousLocation) > 1.0 || !player.getInventory().containsAtLeast(ChimaeraWing.getChimaeraWing(0), 1)) {
|
||||||
player.sendMessage(LocaleLoader.getString("Teleport.Cancelled"));
|
player.sendMessage(LocaleLoader.getString("Teleport.Cancelled"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user