Fly Fixes

This commit is contained in:
Driftay 2019-05-23 17:08:18 -04:00
parent 8770ea0d4f
commit e3cfb575fd
3 changed files with 10 additions and 13 deletions

View File

@ -192,6 +192,7 @@ public class CmdFly extends FCommand {
} }
} }
if (args.size() == 0) { if (args.size() == 0) {
toggleFlight(fme.isFlying(), me); toggleFlight(fme.isFlying(), me);
} else if (args.size() == 1) { } else if (args.size() == 1) {

View File

@ -8,8 +8,6 @@ import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import java.util.ArrayList;
import java.util.Iterator;
public class UtilFly { public class UtilFly {
@ -17,7 +15,6 @@ public class UtilFly {
if (!SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) if (!SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight"))
return; return;
Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> { Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> {
for (FPlayer fp : FPlayers.getInstance().getAllFPlayers()) { for (FPlayer fp : FPlayers.getInstance().getAllFPlayers()) {
if (fp.isFlying()) fp.checkIfNearbyEnemies(); if (fp.isFlying()) fp.checkIfNearbyEnemies();

View File

@ -1070,7 +1070,6 @@ public abstract class MemoryFPlayer implements FPlayer {
if (e == null) { if (e == null) {
continue; continue;
} }
if (e instanceof Player) { if (e instanceof Player) {
Player eplayer = (((Player) e).getPlayer()); Player eplayer = (((Player) e).getPlayer());
if (eplayer == null) { if (eplayer == null) {
@ -1080,7 +1079,7 @@ public abstract class MemoryFPlayer implements FPlayer {
if (efplayer == null) { if (efplayer == null) {
continue; continue;
} }
if (efplayer != null && this.getRelationTo(efplayer).equals(Relation.ENEMY) && !efplayer.isStealthEnabled()) { if (this.getRelationTo(efplayer).equals(Relation.ENEMY) && !efplayer.isStealthEnabled()) {
setFlying(false); setFlying(false);
msg(TL.COMMAND_FLY_ENEMY_NEAR); msg(TL.COMMAND_FLY_ENEMY_NEAR);
Bukkit.getServer().getPluginManager().callEvent(new FPlayerStoppedFlying(this)); Bukkit.getServer().getPluginManager().callEvent(new FPlayerStoppedFlying(this));