changed findFactions() method to try matching faction tags before trying to match player names, instead of the other way around
This commit is contained in:
parent
f9d39271c0
commit
2900bf372f
@ -208,7 +208,7 @@ public class Factions extends JavaPlugin {
|
||||
Permissions = ((Permissions)test).getHandler();
|
||||
Factions.log("Found and will use plugin "+((Permissions)test).getDescription().getFullName());
|
||||
} else {
|
||||
Factions.log("Permission system not detected, defaulting to OP");
|
||||
Factions.log("Permissions plugin not detected, defaulting to Bukkit superperms system");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,17 +190,17 @@ public class FBaseCommand {
|
||||
|
||||
|
||||
public Faction findFaction(String factionName, boolean defaultToMine) {
|
||||
// First we search player names
|
||||
FPlayer fp = FPlayer.find(factionName);
|
||||
if (fp != null) {
|
||||
return fp.getFaction();
|
||||
}
|
||||
|
||||
// Secondly we search faction names
|
||||
// First we search faction names
|
||||
Faction faction = Faction.findByTag(factionName);
|
||||
if (faction != null) {
|
||||
return faction;
|
||||
}
|
||||
|
||||
// Next we search player names
|
||||
FPlayer fp = FPlayer.find(factionName);
|
||||
if (fp != null) {
|
||||
return fp.getFaction();
|
||||
}
|
||||
|
||||
if (defaultToMine && sender instanceof Player) {
|
||||
return me.getFaction();
|
||||
|
Loading…
Reference in New Issue
Block a user