Solved Is block in own/wilderness territory

Discussion in 'Spigot Plugin Development' started by GalacticLD, Jun 11, 2018.

  1. How can i check is block in own/wilderness faction territory(FactionsUUID)?
     
  2. JanTuck

    Supporter

    So i'm guessing this would do, and you can modify it to whatever. This is a general IDEA, i got no clue how the factions work.
    Code (Java):
        private boolean isInWilderness(Location location){
            FLocation fLocation = new FLocation(location);
            Faction faction = Board.getInstance().getFactionAt(fLocation);
            return faction == Factions.getInstance().getWilderness();
        }

        private boolean isInOwnClaim(Location location, Player player){
            FLocation fLocation = new FLocation(location);
            Faction faction = Board.getInstance().getFactionAt(fLocation);
            return faction == FPlayers.getInstance().getByPlayer(player).getFaction();
        }
     
    • Like Like x 1
  3. I've solved my problem, thanks for help anyway!