Don't allow vanished players to block others from teleporting. Fixes #111.
This commit is contained in:
@@ -54,6 +54,8 @@ public interface FPlayer extends EconomyParticipator {
|
||||
|
||||
public boolean isAdminBypassing();
|
||||
|
||||
public boolean isVanished();
|
||||
|
||||
public void setIsAdminBypassing(boolean val);
|
||||
|
||||
public void setChatMode(ChatMode chatMode);
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CmdHome extends FCommand {
|
||||
}
|
||||
|
||||
FPlayer fp = FPlayers.getInstance().getByPlayer(p);
|
||||
if (fme.getRelationTo(fp) != Relation.ENEMY) {
|
||||
if (fme.getRelationTo(fp) != Relation.ENEMY || fp.isVanished()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,4 +36,8 @@ public class Essentials {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isVanished(Player player) {
|
||||
return essentials.getUser(player).isVanished();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.massivecraft.factions.event.LandClaimEvent;
|
||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||
import com.massivecraft.factions.iface.RelationParticipator;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.integration.Essentials;
|
||||
import com.massivecraft.factions.integration.Worldguard;
|
||||
import com.massivecraft.factions.scoreboards.FScoreboard;
|
||||
import com.massivecraft.factions.scoreboards.sidebar.FInfoSidebar;
|
||||
@@ -168,6 +169,10 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
return this.isAdminBypassing;
|
||||
}
|
||||
|
||||
public boolean isVanished() {
|
||||
return Essentials.isVanished(getPlayer());
|
||||
}
|
||||
|
||||
public void setIsAdminBypassing(boolean val) {
|
||||
this.isAdminBypassing = val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user