Don't allow vanished players to block others from teleporting. Fixes #111.

This commit is contained in:
drtshock 2014-11-07 12:08:57 -06:00
parent 8b64b4bfe1
commit 962f92496c
5 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,7 @@
FactionsUUID FactionsUUID
==================== ====================
<rant> <rant>
I'd appreciate it if you could pay for the [resource](http://www.spigotmc.org/resources/factionsuuid.1035/) if your server makes money. If you only run your server for your kids or some friends and don't make any money, then I don't want to stop you from doing so by forcing you to buy a $10 plugin. If that's the case, then just send me a message and we can work something out. I'd appreciate it if you could pay for the [resource](http://www.spigotmc.org/resources/factionsuuid.1035/) if your server makes money. If you only run your server for your kids or some friends and don't make any money, then I don't want to stop you from doing so by forcing you to buy a $15 plugin. If that's the case, then just send me a message and we can work something out.
The repo is open because of that and because I still hope to see people contributing upstream :) The repo is open because of that and because I still hope to see people contributing upstream :)
</rant> </rant>

View File

@ -54,6 +54,8 @@ public interface FPlayer extends EconomyParticipator {
public boolean isAdminBypassing(); public boolean isAdminBypassing();
public boolean isVanished();
public void setIsAdminBypassing(boolean val); public void setIsAdminBypassing(boolean val);
public void setChatMode(ChatMode chatMode); public void setChatMode(ChatMode chatMode);

View File

@ -79,7 +79,7 @@ public class CmdHome extends FCommand {
} }
FPlayer fp = FPlayers.getInstance().getByPlayer(p); FPlayer fp = FPlayers.getInstance().getByPlayer(p);
if (fme.getRelationTo(fp) != Relation.ENEMY) { if (fme.getRelationTo(fp) != Relation.ENEMY || fp.isVanished()) {
continue; continue;
} }

View File

@ -36,4 +36,8 @@ public class Essentials {
} }
return true; return true;
} }
public static boolean isVanished(Player player) {
return essentials.getUser(player).isVanished();
}
} }

View File

@ -6,6 +6,7 @@ import com.massivecraft.factions.event.LandClaimEvent;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.iface.RelationParticipator; import com.massivecraft.factions.iface.RelationParticipator;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.integration.Essentials;
import com.massivecraft.factions.integration.Worldguard; import com.massivecraft.factions.integration.Worldguard;
import com.massivecraft.factions.scoreboards.FScoreboard; import com.massivecraft.factions.scoreboards.FScoreboard;
import com.massivecraft.factions.scoreboards.sidebar.FInfoSidebar; import com.massivecraft.factions.scoreboards.sidebar.FInfoSidebar;
@ -168,6 +169,10 @@ public abstract class MemoryFPlayer implements FPlayer {
return this.isAdminBypassing; return this.isAdminBypassing;
} }
public boolean isVanished() {
return Essentials.isVanished(getPlayer());
}
public void setIsAdminBypassing(boolean val) { public void setIsAdminBypassing(boolean val) {
this.isAdminBypassing = val; this.isAdminBypassing = val;
} }