Fix faction name on visibility set - print set ID (help with permissions setting)

This commit is contained in:
Mike Primm 2012-07-29 11:23:16 -05:00
parent 36b112ef0c
commit 617807fe37

View File

@ -161,6 +161,10 @@ public class DynmapFactionsPlugin extends JavaPlugin {
} }
private void updatePlayerSet(String factid) { private void updatePlayerSet(String factid) {
/* If Wilderness or other unassociated factions, skip */
if(factid.equals("0") || factid.startsWith("-")) {
return;
}
Set<String> plids = new HashSet<String>(); Set<String> plids = new HashSet<String>();
Faction f = factapi.get(factid); /* Get faction */ Faction f = factapi.get(factid); /* Get faction */
if(f != null) { if(f != null) {
@ -168,14 +172,19 @@ public class DynmapFactionsPlugin extends JavaPlugin {
for(FPlayer fp : ps) { for(FPlayer fp : ps) {
plids.add(fp.getId()); plids.add(fp.getId());
} }
factid = f.getTag();
} }
String setid = "factions." + factid; String setid = "factions." + factid;
PlayerSet set = markerapi.getPlayerSet(setid); /* See if set exists */ PlayerSet set = markerapi.getPlayerSet(setid); /* See if set exists */
if(set == null) { if((set == null) && (f != null)) {
set = markerapi.createPlayerSet(setid, true, plids, false); set = markerapi.createPlayerSet(setid, true, plids, false);
info("Added player visibility set '" + setid + "' for faction " + factid);
}
else if(f != null) {
set.setPlayers(plids);
} }
else { else {
set.setPlayers(plids); set.deleteSet();
} }
} }