From 5eed71fc67b87c5d3a504f07fb8214bacc36bb10 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 24 Apr 2013 19:01:17 +0200 Subject: [PATCH] Rename Faction Tag to Faction Name. What did tag ever mean? Name makes more sense. --- plugin.yml | 6 +-- src/com/massivecraft/factions/Factions.java | 8 +-- src/com/massivecraft/factions/Perm.java | 2 +- .../factions/TerritoryAccess.java | 2 +- .../tag/{ChatTagTag.java => ChatTagName.java} | 10 ++-- ...TagTagforce.java => ChatTagNameforce.java} | 10 ++-- .../factions/cmd/CmdFactions.java | 4 +- .../factions/cmd/CmdFactionsAccess.java | 4 +- .../factions/cmd/CmdFactionsCreate.java | 22 ++++---- .../factions/cmd/CmdFactionsDisband.java | 4 +- .../factions/cmd/CmdFactionsInvite.java | 2 +- .../factions/cmd/CmdFactionsJoin.java | 12 ++--- .../factions/cmd/CmdFactionsKick.java | 2 +- .../factions/cmd/CmdFactionsList.java | 2 +- ...dFactionsTag.java => CmdFactionsName.java} | 32 ++++++------ .../factions/cmd/CmdFactionsPowerBoost.java | 4 +- .../cmd/CmdFactionsRelationAbstract.java | 4 +- .../factions/cmd/CmdFactionsSethome.java | 2 +- .../factions/cmd/CmdFactionsShow.java | 10 ++-- .../factions/cmd/CmdFactionsUnclaim.java | 9 ---- .../factions/cmd/CmdFactionsUnclaimall.java | 2 +- .../factions/cmd/arg/ARFaction.java | 8 +-- .../massivecraft/factions/entity/Board.java | 6 +-- .../massivecraft/factions/entity/Faction.java | 51 +++++++++---------- .../factions/entity/FactionColl.java | 38 +++++++------- .../massivecraft/factions/entity/MConf.java | 4 +- .../massivecraft/factions/entity/UConf.java | 8 +-- .../massivecraft/factions/entity/UPlayer.java | 16 +++--- .../factions/event/FactionsEventCreate.java | 8 +-- ...ange.java => FactionsEventNameChange.java} | 12 ++--- .../listeners/FactionsListenerEcon.java | 10 ++-- .../listeners/FactionsListenerMain.java | 2 +- .../massivecraft/factions/util/MiscUtil.java | 2 +- .../factions/util/RelationUtil.java | 4 +- 34 files changed, 156 insertions(+), 166 deletions(-) rename src/com/massivecraft/factions/chat/tag/{ChatTagTag.java => ChatTagName.java} (70%) rename src/com/massivecraft/factions/chat/tag/{ChatTagTagforce.java => ChatTagNameforce.java} (62%) rename src/com/massivecraft/factions/cmd/{CmdFactionsTag.java => CmdFactionsName.java} (56%) rename src/com/massivecraft/factions/event/{FactionsEventTagChange.java => FactionsEventNameChange.java} (72%) diff --git a/plugin.yml b/plugin.yml index 88f2e64e..eaa7b299 100644 --- a/plugin.yml +++ b/plugin.yml @@ -50,7 +50,7 @@ permissions: factions.seechunk: {description: see the chunk you stand in, default: false} factions.sethome: {description: set the faction home, default: false} factions.show: {description: show faction information, default: false} - factions.tag: {description: set faction tag, default: false} + factions.name: {description: set faction name, default: false} factions.title: {description: set player title, default: false} factions.unclaim: {description: unclaim land where you stand, default: false} factions.unclaimall: {description: unclaim all land, default: false} @@ -95,7 +95,7 @@ permissions: factions.seechunk: true factions.sethome: true factions.show: true - factions.tag: true + factions.name: true factions.title: true factions.unclaim: true factions.unclaimall: true @@ -165,7 +165,7 @@ permissions: factions.seechunk: true factions.sethome: true factions.show: true - factions.tag: true + factions.name: true factions.title: true factions.unclaim: true factions.unclaimall: true diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 5a0d1dc0..10cfa9b4 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -15,8 +15,8 @@ import com.massivecraft.factions.chat.modifier.ChatModifierUcf; import com.massivecraft.factions.chat.tag.ChatTagRelcolor; import com.massivecraft.factions.chat.tag.ChatTagRole; import com.massivecraft.factions.chat.tag.ChatTagRoleprefix; -import com.massivecraft.factions.chat.tag.ChatTagTag; -import com.massivecraft.factions.chat.tag.ChatTagTagforce; +import com.massivecraft.factions.chat.tag.ChatTagName; +import com.massivecraft.factions.chat.tag.ChatTagNameforce; import com.massivecraft.factions.chat.tag.ChatTagTitle; import com.massivecraft.factions.cmd.*; import com.massivecraft.factions.entity.Board; @@ -146,8 +146,8 @@ public class Factions extends MPlugin ChatTagRelcolor.get().register(); ChatTagRole.get().register(); ChatTagRoleprefix.get().register(); - ChatTagTag.get().register(); - ChatTagTagforce.get().register(); + ChatTagName.get().register(); + ChatTagNameforce.get().register(); ChatTagTitle.get().register(); postEnable(); diff --git a/src/com/massivecraft/factions/Perm.java b/src/com/massivecraft/factions/Perm.java index 256d0c85..7b430e72 100644 --- a/src/com/massivecraft/factions/Perm.java +++ b/src/com/massivecraft/factions/Perm.java @@ -52,7 +52,7 @@ public enum Perm SEE_CHUNK("seechunk"), SETHOME("sethome"), SHOW("show"), - TAG("tag"), + NAME("name"), TITLE("title"), UNCLAIM("unclaim"), UNCLAIM_ALL("unclaimall"), diff --git a/src/com/massivecraft/factions/TerritoryAccess.java b/src/com/massivecraft/factions/TerritoryAccess.java index 8aa3a2d8..18be7d2d 100644 --- a/src/com/massivecraft/factions/TerritoryAccess.java +++ b/src/com/massivecraft/factions/TerritoryAccess.java @@ -136,7 +136,7 @@ public class TerritoryAccess { if (list.length() > 0) list.append(", "); - list.append(FactionColls.get().get(universeExtractable).get(factionID).getTag()); + list.append(FactionColls.get().get(universeExtractable).get(factionID).getName()); } return list.toString(); } diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagTag.java b/src/com/massivecraft/factions/chat/tag/ChatTagName.java similarity index 70% rename from src/com/massivecraft/factions/chat/tag/ChatTagTag.java rename to src/com/massivecraft/factions/chat/tag/ChatTagName.java index f473cc44..018df592 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagTag.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagName.java @@ -4,15 +4,15 @@ import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.UPlayer; -public class ChatTagTag extends ChatTagAbstract +public class ChatTagName extends ChatTagAbstract { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private ChatTagTag() { super("factions_tag"); } - private static ChatTagTag i = new ChatTagTag(); - public static ChatTagTag get() { return i; } + private ChatTagName() { super("factions_name"); } + private static ChatTagName i = new ChatTagName(); + public static ChatTagName get() { return i; } // -------------------------------------------- // // OVERRIDE @@ -23,7 +23,7 @@ public class ChatTagTag extends ChatTagAbstract { Faction faction = fsender.getFaction(); if (faction.isNone()) return ""; - return faction.getTag(); + return faction.getName(); } } diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagTagforce.java b/src/com/massivecraft/factions/chat/tag/ChatTagNameforce.java similarity index 62% rename from src/com/massivecraft/factions/chat/tag/ChatTagTagforce.java rename to src/com/massivecraft/factions/chat/tag/ChatTagNameforce.java index 2384ee14..35e6e89d 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagTagforce.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagNameforce.java @@ -3,15 +3,15 @@ package com.massivecraft.factions.chat.tag; import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.entity.UPlayer; -public class ChatTagTagforce extends ChatTagAbstract +public class ChatTagNameforce extends ChatTagAbstract { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private ChatTagTagforce() { super("factions_tagforce"); } - private static ChatTagTagforce i = new ChatTagTagforce(); - public static ChatTagTagforce get() { return i; } + private ChatTagNameforce() { super("factions_nameforce"); } + private static ChatTagNameforce i = new ChatTagNameforce(); + public static ChatTagNameforce get() { return i; } // -------------------------------------------- // // OVERRIDE @@ -20,7 +20,7 @@ public class ChatTagTagforce extends ChatTagAbstract @Override public String getReplacement(UPlayer fsender, UPlayer frecipient) { - return fsender.getFaction().getTag(); + return fsender.getFaction().getName(); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactions.java b/src/com/massivecraft/factions/cmd/CmdFactions.java index e9834ae0..14b95ad8 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactions.java @@ -40,7 +40,7 @@ public class CmdFactions extends FCommand public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk(); public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome(); public CmdFactionsShow cmdFactionsShow = new CmdFactionsShow(); - public CmdFactionsTag cmdFactionsTag = new CmdFactionsTag(); + public CmdFactionsName cmdFactionsName = new CmdFactionsName(); public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle(); public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim(); public CmdFactionsUnclaimall cmdFactionsUnclaimall = new CmdFactionsUnclaimall(); @@ -66,7 +66,7 @@ public class CmdFactions extends FCommand this.addSubCommand(this.cmdFactionsHome); this.addSubCommand(this.cmdFactionsCreate); this.addSubCommand(this.cmdFactionsSethome); - this.addSubCommand(this.cmdFactionsTag); + this.addSubCommand(this.cmdFactionsName); this.addSubCommand(this.cmdFactionsDemote); this.addSubCommand(this.cmdFactionsDescription); this.addSubCommand(this.cmdFactionsPerm); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java index dfb432ce..07744026 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java @@ -82,7 +82,7 @@ public class CmdFactionsAccess extends FCommand Faction targetFaction = this.arg(1, ARFaction.get(myFaction), myFaction); if (targetFaction == null) return; added = territory.toggleFaction(targetFaction); - target = "Faction \""+targetFaction.getTag()+"\""; + target = "Faction \""+targetFaction.getName()+"\""; } msg("%s has been %s the access list for this territory.", target, Txt.parse(added ? "added to" : "removed from")); @@ -91,7 +91,7 @@ public class CmdFactionsAccess extends FCommand private void showAccessList(TerritoryAccess territory, Faction locFaction) { - msg("Host faction %s has %s in this territory.", locFaction.getTag(), Txt.parse(territory.isHostFactionAllowed() ? "normal access" : "restricted access")); + msg("Host faction %s has %s in this territory.", locFaction.getName(), Txt.parse(territory.isHostFactionAllowed() ? "normal access" : "restricted access")); String players = territory.fplayerList(); String factions = territory.factionList(locFaction); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java index 19f5fc4e..3d50064c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java @@ -22,7 +22,7 @@ public class CmdFactionsCreate extends FCommand { this.addAliases("create"); - this.addRequiredArg("faction tag"); + this.addRequiredArg("name"); this.addRequirements(ReqHasPerm.get(Perm.CREATE.node)); } @@ -31,7 +31,7 @@ public class CmdFactionsCreate extends FCommand public void perform() { // Args - String newTag = this.arg(0); + String newName = this.arg(0); // Verify if (fme.getFaction().isNormal()) @@ -42,16 +42,16 @@ public class CmdFactionsCreate extends FCommand FactionColl coll = FactionColls.get().get(fme); - if (coll.isTagTaken(newTag)) + if (coll.isNameTaken(newName)) { - msg("That tag is already in use."); + msg("That name is already in use."); return; } - ArrayList tagValidationErrors = coll.validateTag(newTag); - if (tagValidationErrors.size() > 0) + ArrayList nameValidationErrors = coll.validateName(newName); + if (nameValidationErrors.size() > 0) { - sendMessage(tagValidationErrors); + sendMessage(nameValidationErrors); return; } @@ -59,13 +59,13 @@ public class CmdFactionsCreate extends FCommand String factionId = coll.getIdStrategy().generate(coll); // Event - FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newTag); + FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newName); createEvent.run(); if (createEvent.isCancelled()) return; // Apply Faction faction = coll.create(factionId); - faction.setTag(newTag); + faction.setName(newName); fme.setRole(Rel.LEADER); fme.setFaction(faction); @@ -77,14 +77,14 @@ public class CmdFactionsCreate extends FCommand // Inform for (UPlayer follower : UPlayerColls.get().get(fme).getAllOnline()) { - follower.msg("%s created a new faction %s", fme.describeTo(follower, true), faction.getTag(follower)); + follower.msg("%s created a new faction %s", fme.describeTo(follower, true), faction.getName(follower)); } msg("You should now: %s", Factions.get().getOuterCmdFactions().cmdFactionsDescription.getUseageTemplate()); if (MConf.get().logFactionCreate) { - Factions.get().log(fme.getName()+" created a new faction: "+newTag); + Factions.get().log(fme.getName()+" created a new faction: "+newName); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java index 3afa7391..672dfb4e 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -67,13 +67,13 @@ public class CmdFactionsDisband extends FCommand } else { - uplayer.msg("%s disbanded the faction %s.", who, faction.getTag(uplayer)); + uplayer.msg("%s disbanded the faction %s.", who, faction.getName(uplayer)); } } if (MConf.get().logFactionDisband) { - Factions.get().log("The faction "+faction.getTag()+" ("+faction.getId()+") was disbanded by "+(senderIsConsole ? "console command" : fme.getName())+"."); + Factions.get().log("The faction "+faction.getName()+" ("+faction.getId()+") was disbanded by "+(senderIsConsole ? "console command" : fme.getName())+"."); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java index bfaa74d0..a3cef0d5 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java @@ -36,7 +36,7 @@ public class CmdFactionsInvite extends FCommand // Allready member? if (uplayer.getFaction() == myFaction) { - msg("%s is already a member of %s", uplayer.getName(), myFaction.getTag()); + msg("%s is already a member of %s", uplayer.getName(), myFaction.getName()); msg("You might want to: " + Factions.get().getOuterCmdFactions().cmdFactionsKick.getUseageTemplate(false)); return; } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java index f76888f6..198d56ea 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java @@ -46,13 +46,13 @@ public class CmdFactionsJoin extends FCommand if (faction == uplayerFaction) { - msg("%s %s already a member of %s", uplayer.describeTo(fme, true), (samePlayer ? "are" : "is"), faction.getTag(fme)); + msg("%s %s already a member of %s", uplayer.describeTo(fme, true), (samePlayer ? "are" : "is"), faction.getName(fme)); return; } if (UConf.get(faction).factionMemberLimit > 0 && faction.getUPlayers().size() >= UConf.get(faction).factionMemberLimit) { - msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), UConf.get(faction).factionMemberLimit, uplayer.describeTo(fme, false)); + msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getName(fme), UConf.get(faction).factionMemberLimit, uplayer.describeTo(fme, false)); return; } @@ -86,10 +86,10 @@ public class CmdFactionsJoin extends FCommand // Inform if (!samePlayer) { - uplayer.msg("%s moved you into the faction %s.", fme.describeTo(uplayer, true), faction.getTag(uplayer)); + uplayer.msg("%s moved you into the faction %s.", fme.describeTo(uplayer, true), faction.getName(uplayer)); } faction.msg("%s joined your faction.", uplayer.describeTo(faction, true)); - fme.msg("%s successfully joined %s.", uplayer.describeTo(fme, true), faction.getTag(fme)); + fme.msg("%s successfully joined %s.", uplayer.describeTo(fme, true), faction.getName(fme)); // Apply uplayer.resetFactionData(); @@ -101,9 +101,9 @@ public class CmdFactionsJoin extends FCommand if (MConf.get().logFactionJoin) { if (samePlayer) - Factions.get().log("%s joined the faction %s.", uplayer.getName(), faction.getTag()); + Factions.get().log("%s joined the faction %s.", uplayer.getName(), faction.getName()); else - Factions.get().log("%s moved the player %s into the faction %s.", fme.getName(), uplayer.getName(), faction.getTag()); + Factions.get().log("%s moved the player %s into the faction %s.", fme.getName(), uplayer.getName(), faction.getName()); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index 9fced444..a6cdfda6 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -72,7 +72,7 @@ public class CmdFactionsKick extends FCommand if (MConf.get().logFactionKick) { - Factions.get().log(fme.getDisplayName() + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getTag()); + Factions.get().log(fme.getDisplayName() + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getName()); } // Apply diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/com/massivecraft/factions/cmd/CmdFactionsList.java index b50ad6ee..85c47b60 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -57,7 +57,7 @@ public class CmdFactionsList extends FCommand continue; } lines.add(Txt.parse("%s %d/%d online, %d/%d/%d", - faction.getTag(fme), + faction.getName(fme), faction.getUPlayersWhereOnline(true).size(), faction.getUPlayers().size(), faction.getLandCount(), diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTag.java b/src/com/massivecraft/factions/cmd/CmdFactionsName.java similarity index 56% rename from src/com/massivecraft/factions/cmd/CmdFactionsTag.java rename to src/com/massivecraft/factions/cmd/CmdFactionsName.java index 3de13f71..f5c43d6f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTag.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsName.java @@ -8,20 +8,20 @@ import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColls; -import com.massivecraft.factions.event.FactionsEventTagChange; +import com.massivecraft.factions.event.FactionsEventNameChange; import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.mcore.cmd.req.ReqHasPerm; -public class CmdFactionsTag extends FCommand +public class CmdFactionsName extends FCommand { - public CmdFactionsTag() + public CmdFactionsName() { - this.addAliases("tag"); + this.addAliases("name"); - this.addRequiredArg("new tag"); + this.addRequiredArg("new name"); - this.addRequirements(ReqHasPerm.get(Perm.TAG.node)); + this.addRequirements(ReqHasPerm.get(Perm.NAME.node)); this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER)); } @@ -29,19 +29,19 @@ public class CmdFactionsTag extends FCommand public void perform() { // Arg - String newTag = this.arg(0); + String newName = this.arg(0); // TODO does not first test cover selfcase? FactionColl factionColl = FactionColls.get().get(myFaction); - if (factionColl.isTagTaken(newTag) && ! MiscUtil.getComparisonString(newTag).equals(myFaction.getComparisonTag())) + if (factionColl.isNameTaken(newName) && ! MiscUtil.getComparisonString(newName).equals(myFaction.getComparisonName())) { - msg("That tag is already taken"); + msg("That name is already taken"); return; } ArrayList errors = new ArrayList(); - errors.addAll(factionColl.validateTag(newTag)); + errors.addAll(factionColl.validateName(newName)); if (errors.size() > 0) { sendMessage(errors); @@ -49,24 +49,24 @@ public class CmdFactionsTag extends FCommand } // Event - FactionsEventTagChange event = new FactionsEventTagChange(sender, myFaction, newTag); + FactionsEventNameChange event = new FactionsEventNameChange(sender, myFaction, newName); event.run(); if (event.isCancelled()) return; - newTag = event.getNewTag(); + newName = event.getNewName(); // Apply - String oldtag = myFaction.getTag(); - myFaction.setTag(newTag); + String oldName = myFaction.getName(); + myFaction.setName(newName); // Inform - myFaction.msg("%s changed your faction tag to %s", fme.describeTo(myFaction, true), myFaction.getTag(myFaction)); + myFaction.msg("%s changed your faction name to %s", fme.describeTo(myFaction, true), myFaction.getName(myFaction)); for (Faction faction : FactionColls.get().get(myFaction).getAll()) { if (faction == myFaction) { continue; } - faction.msg("The faction %s changed their name to %s.", fme.getColorTo(faction)+oldtag, myFaction.getTag(faction)); + faction.msg("The faction %s changed their name to %s.", fme.getColorTo(faction)+oldName, myFaction.getName(faction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java index 2e997309..ef1b6384 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java @@ -30,9 +30,9 @@ public class CmdFactionsPowerBoost extends FCommand faction.setPowerBoost(amount); - msg(""+faction.getTag()+" now has a power bonus/penalty of "+amount+" to min and max power levels."); + msg(""+faction.getName()+" now has a power bonus/penalty of "+amount+" to min and max power levels."); // TODO: Inconsistent. Why is there no boolean to toggle this logging of? - Factions.get().log(fme.getName()+" has set the power bonus/penalty for "+faction.getTag()+" to "+amount+"."); + Factions.get().log(fme.getName()+" has set the power bonus/penalty for "+faction.getName()+" to "+amount+"."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java index 2e630a35..6173826e 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java @@ -47,7 +47,7 @@ public abstract class CmdFactionsRelationAbstract extends FCommand if (myFaction.getRelationWish(otherFaction) == newRelation) { - msg("You already have that relation wish set with %s.", otherFaction.getTag()); + msg("You already have that relation wish set with %s.", otherFaction.getName()); return; } @@ -71,7 +71,7 @@ public abstract class CmdFactionsRelationAbstract extends FCommand else { otherFaction.msg("%s wishes to be %s.", myFaction.describeTo(otherFaction, true), newRelation.getColor()+newRelation.getDescFactionOne()); - otherFaction.msg("Type /"+ConfServer.baseCommandAliases.get(0)+" "+newRelation+" "+myFaction.getTag()+" to accept."); + otherFaction.msg("Type /"+ConfServer.baseCommandAliases.get(0)+" "+newRelation+" "+myFaction.getName()+" to accept."); myFaction.msg("%s were informed that you wish to be %s.", otherFaction.describeTo(myFaction, true), newRelation.getColor()+newRelation.getDescFactionOne()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java index 6d6dde07..7a22e935 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java @@ -63,7 +63,7 @@ public class CmdFactionsSethome extends FCommand faction.sendMessage(Factions.get().getOuterCmdFactions().cmdFactionsHome.getUseageTemplate()); if (faction != myFaction) { - fme.msg("You have set the home for the "+faction.getTag(fme)+" faction."); + fme.msg("You have set the home for the "+faction.getName(fme)+" faction."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java index 03806361..3e301cff 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java @@ -43,7 +43,7 @@ public class CmdFactionsShow extends FCommand Collection normals = faction.getUPlayersWhereRole(Rel.MEMBER); Collection recruits = faction.getUPlayersWhereRole(Rel.RECRUIT); - msg(Txt.titleize(faction.getTag(fme))); + msg(Txt.titleize(faction.getName(fme))); msg("Description: %s", faction.getDescription()); // Display important flags @@ -99,7 +99,7 @@ public class CmdFactionsShow extends FCommand String sepparator = Txt.parse("")+", "; // List the relations to other factions - Map> relationTags = faction.getFactionTagsPerRelation(fme, true); + Map> relationNames = faction.getFactionNamesPerRelation(fme, true); if (faction.getFlag(FFlag.PEACEFUL)) { @@ -107,11 +107,11 @@ public class CmdFactionsShow extends FCommand } else { - sendMessage(Txt.parse("In Truce with: ") + Txt.implode(relationTags.get(Rel.TRUCE), sepparator)); + sendMessage(Txt.parse("In Truce with: ") + Txt.implode(relationNames.get(Rel.TRUCE), sepparator)); } - sendMessage(Txt.parse("Allied to: ") + Txt.implode(relationTags.get(Rel.ALLY), sepparator)); - sendMessage(Txt.parse("Enemies: ") + Txt.implode(relationTags.get(Rel.ENEMY), sepparator)); + sendMessage(Txt.parse("Allied to: ") + Txt.implode(relationNames.get(Rel.ALLY), sepparator)); + sendMessage(Txt.parse("Enemies: ") + Txt.implode(relationNames.get(Rel.ENEMY), sepparator)); // List the members... List memberOnlineNames = new ArrayList(); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java index b5fae03b..3ebd0a6e 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java @@ -30,15 +30,6 @@ public class CmdFactionsUnclaim extends FCommand // Apply if (fme.tryClaim(newFaction, chunk, true, true)) return; - - // Inform - // TODO: Move the logging stuff into the try-method - /*myFaction.msg("%s unclaimed some land.", fme.describeTo(myFaction, true)); - - if (MConf.get().logLandUnclaims) - { - Factions.get().log(fme.getName()+" unclaimed land at ("+chunk.getChunkX()+","+chunk.getChunkZ()+") from the faction: "+oldFaction.getTag()); - }*/ } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java index e3a8f242..03805136 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java @@ -63,7 +63,7 @@ public class CmdFactionsUnclaimall extends FCommand // Log if (MConf.get().logLandUnclaims) { - Factions.get().log(fme.getName()+" unclaimed everything for the faction: "+myFaction.getTag()); + Factions.get().log(fme.getName()+" unclaimed everything for the faction: "+myFaction.getName()); } } diff --git a/src/com/massivecraft/factions/cmd/arg/ARFaction.java b/src/com/massivecraft/factions/cmd/arg/ARFaction.java index 6a4ade32..57eb5313 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARFaction.java +++ b/src/com/massivecraft/factions/cmd/arg/ARFaction.java @@ -39,12 +39,12 @@ public class ARFaction extends ArgReaderAbstract { ArgResult result = new ArgResult(); - // Faction Tag Exact - result.setResult(this.getColl().getByTag(str)); + // Faction Name Exact + result.setResult(this.getColl().getByName(str)); if (result.hasResult()) return result; - // Faction Tag Match - result.setResult(this.getColl().getBestTagMatch(str)); + // Faction Name Match + result.setResult(this.getColl().getBestNameMatch(str)); if (result.hasResult()) return result; // UPlayer Name Exact diff --git a/src/com/massivecraft/factions/entity/Board.java b/src/com/massivecraft/factions/entity/Board.java index 1f4ac266..5354f6c8 100644 --- a/src/com/massivecraft/factions/entity/Board.java +++ b/src/com/massivecraft/factions/entity/Board.java @@ -270,7 +270,7 @@ public class Board extends Entity implements BoardInterface ArrayList ret = new ArrayList(); Faction centerFaction = this.getFactionAt(centerPs); - ret.add(Txt.titleize("("+centerPs.getChunkX() + "," + centerPs.getChunkZ()+") "+centerFaction.getTag(observer))); + ret.add(Txt.titleize("("+centerPs.getChunkX() + "," + centerPs.getChunkZ()+") "+centerFaction.getName(observer))); int halfWidth = Const.MAP_WIDTH / 2; int halfHeight = Const.MAP_HEIGHT / 2; @@ -280,7 +280,7 @@ public class Board extends Entity implements BoardInterface int width = halfWidth * 2 + 1; int height = halfHeight * 2 + 1; - //Make room for the list of tags + // Make room for the list of names height--; Map fList = new HashMap(); @@ -327,7 +327,7 @@ public class Board extends Entity implements BoardInterface String fRow = ""; for (Faction keyfaction : fList.keySet()) { - fRow += ""+keyfaction.getColorTo(observer) + fList.get(keyfaction) + ": " + keyfaction.getTag() + " "; + fRow += ""+keyfaction.getColorTo(observer) + fList.get(keyfaction) + ": " + keyfaction.getName() + " "; } fRow = fRow.trim(); ret.add(fRow); diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index da3b2b97..64b3ffe5 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -43,7 +43,7 @@ public class Faction extends Entity implements EconomyParticipator @Override public Faction load(Faction that) { - this.setTag(that.tag); + this.setName(that.name); this.setDescription(that.description); this.setHome(that.home); this.setPowerBoost(that.powerBoost); @@ -62,11 +62,11 @@ public class Faction extends Entity implements EconomyParticipator // In this section of the source code we place the field declarations only. // Each field has it's own section further down since just the getter and setter logic takes up quite some place. - // TODO: The faction "tag" could/should also have been called "name". // The actual faction id looks something like "54947df8-0e9e-4471-a2f9-9af509fb5889" and that is not too easy to remember for humans. // Thus we make use of a name. Since the id is used in all foreign key situations changing the name is fine. - // Null should never happen. The tag must not be null. - private String tag = null; + // Null should never happen. The name must not be null. + @SerializedName("tag") + private String name = null; // Factions can optionally set a description for themselves. // This description can for example be seen in territorial alerts. @@ -124,18 +124,17 @@ public class Faction extends Entity implements EconomyParticipator } // -------------------------------------------- // - // FIELD: tag + // FIELD: name // -------------------------------------------- // - // TODO: Rename tag --> name ? // RAW - public String getTag() + public String getName() { - String ret = this.tag; + String ret = this.name; UConf uconf = UConf.get(this); - if (uconf != null && UConf.get(this).factionTagForceUpperCase) + if (uconf != null && UConf.get(this).factionNameForceUpperCase) { ret = ret.toUpperCase(); } @@ -143,34 +142,34 @@ public class Faction extends Entity implements EconomyParticipator return ret; } - public void setTag(String str) + public void setName(String str) { UConf uconf = UConf.get(this); - if (uconf != null && UConf.get(this).factionTagForceUpperCase) + if (uconf != null && UConf.get(this).factionNameForceUpperCase) { str = str.toUpperCase(); } - this.tag = str; + this.name = str; this.changed(); } // FINER - public String getComparisonTag() + public String getComparisonName() { - return MiscUtil.getComparisonString(this.getTag()); + return MiscUtil.getComparisonString(this.getName()); } - public String getTag(String prefix) + public String getName(String prefix) { - return prefix + this.getTag(); + return prefix + this.getName(); } - public String getTag(RelationParticipator observer) + public String getName(RelationParticipator observer) { - if (observer == null) return getTag(); - return this.getTag(this.getColorTo(observer).toString()); + if (observer == null) return getName(); + return this.getName(this.getColorTo(observer).toString()); } // -------------------------------------------- // @@ -411,13 +410,13 @@ public class Faction extends Entity implements EconomyParticipator // TODO: What is this and where is it used? - public Map> getFactionTagsPerRelation(RelationParticipator rp) + public Map> getFactionNamesPerRelation(RelationParticipator rp) { - return getFactionTagsPerRelation(rp, false); + return getFactionNamesPerRelation(rp, false); } // onlyNonNeutral option provides substantial performance boost on large servers for listing only non-neutral factions - public Map> getFactionTagsPerRelation(RelationParticipator rp, boolean onlyNonNeutral) + public Map> getFactionNamesPerRelation(RelationParticipator rp, boolean onlyNonNeutral) { Map> ret = new HashMap>(); for (Rel rel : Rel.values()) @@ -428,7 +427,7 @@ public class Faction extends Entity implements EconomyParticipator { Rel relation = faction.getRelationTo(this); if (onlyNonNeutral && relation == Rel.NEUTRAL) continue; - ret.get(relation).add(faction.getTag(rp)); + ret.get(relation).add(faction.getName(rp)); } return ret; } @@ -815,12 +814,12 @@ public class Faction extends Entity implements EconomyParticipator // no members left and faction isn't permanent, so disband it if (MConf.get().logFactionDisband) { - Factions.get().log("The faction "+this.getTag()+" ("+this.getId()+") has been disbanded since it has no members left."); + Factions.get().log("The faction "+this.getName()+" ("+this.getId()+") has been disbanded since it has no members left."); } for (UPlayer uplayer : UPlayerColls.get().get(this).getAllOnline()) { - uplayer.msg("The faction %s was disbanded.", this.getTag(uplayer)); + uplayer.msg("The faction %s was disbanded.", this.getName(uplayer)); } this.detach(); @@ -834,7 +833,7 @@ public class Faction extends Entity implements EconomyParticipator replacements.get(0).setRole(Rel.LEADER); this.msg("Faction leader %s has been removed. %s has been promoted as the new faction leader.", oldLeader == null ? "" : oldLeader.getName(), replacements.get(0).getName()); - Factions.get().log("Faction "+this.getTag()+" ("+this.getId()+") leader was removed. Replacement leader: "+replacements.get(0).getName()); + Factions.get().log("Faction "+this.getName()+" ("+this.getId()+") leader was removed. Replacement leader: "+replacements.get(0).getName()); } } diff --git a/src/com/massivecraft/factions/entity/FactionColl.java b/src/com/massivecraft/factions/entity/FactionColl.java index 98fa697b..9ebfff29 100644 --- a/src/com/massivecraft/factions/entity/FactionColl.java +++ b/src/com/massivecraft/factions/entity/FactionColl.java @@ -129,7 +129,7 @@ public class FactionColl extends Coll faction = this.create(id); - faction.setTag(ChatColor.DARK_GREEN+"Wilderness"); + faction.setName(ChatColor.DARK_GREEN+"Wilderness"); faction.setDescription(null); faction.setOpen(false); @@ -161,7 +161,7 @@ public class FactionColl extends Coll faction = this.create(id); - faction.setTag("SafeZone"); + faction.setName("SafeZone"); faction.setDescription("Free from PVP and monsters"); faction.setOpen(false); @@ -193,7 +193,7 @@ public class FactionColl extends Coll faction = this.create(id); - faction.setTag("WarZone"); + faction.setName("WarZone"); faction.setDescription("Not the safest place to be"); faction.setOpen(false); @@ -246,40 +246,40 @@ public class FactionColl extends Coll } // -------------------------------------------- // - // FACTION TAG + // FACTION NAME // -------------------------------------------- // - public ArrayList validateTag(String str) + public ArrayList validateName(String str) { ArrayList errors = new ArrayList(); - if (MiscUtil.getComparisonString(str).length() < UConf.get(this).factionTagLengthMin) + if (MiscUtil.getComparisonString(str).length() < UConf.get(this).factionNameLengthMin) { - errors.add(Txt.parse("The faction tag can't be shorter than %s chars.", UConf.get(this).factionTagLengthMin)); + errors.add(Txt.parse("The faction name can't be shorter than %s chars.", UConf.get(this).factionNameLengthMin)); } - if (str.length() > UConf.get(this).factionTagLengthMax) + if (str.length() > UConf.get(this).factionNameLengthMax) { - errors.add(Txt.parse("The faction tag can't be longer than %s chars.", UConf.get(this).factionTagLengthMax)); + errors.add(Txt.parse("The faction name can't be longer than %s chars.", UConf.get(this).factionNameLengthMax)); } for (char c : str.toCharArray()) { if ( ! MiscUtil.substanceChars.contains(String.valueOf(c))) { - errors.add(Txt.parse("Faction tag must be alphanumeric. \"%s\" is not allowed.", c)); + errors.add(Txt.parse("Faction name must be alphanumeric. \"%s\" is not allowed.", c)); } } return errors; } - public Faction getByTag(String str) + public Faction getByName(String str) { String compStr = MiscUtil.getComparisonString(str); for (Faction faction : this.getAll()) { - if (faction.getComparisonTag().equals(compStr)) + if (faction.getComparisonName().equals(compStr)) { return faction; } @@ -287,24 +287,24 @@ public class FactionColl extends Coll return null; } - public Faction getBestTagMatch(String searchFor) + public Faction getBestNameMatch(String searchFor) { - Map tag2faction = new HashMap(); + Map name2faction = new HashMap(); // TODO: Slow index building for (Faction faction : this.getAll()) { - tag2faction.put(ChatColor.stripColor(faction.getTag()), faction); + name2faction.put(ChatColor.stripColor(faction.getName()), faction); } - String tag = Txt.getBestCIStart(tag2faction.keySet(), searchFor); + String tag = Txt.getBestCIStart(name2faction.keySet(), searchFor); if (tag == null) return null; - return tag2faction.get(tag); + return name2faction.get(tag); } - public boolean isTagTaken(String str) + public boolean isNameTaken(String str) { - return this.getByTag(str) != null; + return this.getByName(str) != null; } } diff --git a/src/com/massivecraft/factions/entity/MConf.java b/src/com/massivecraft/factions/entity/MConf.java index 96332e82..3fdc35f9 100644 --- a/src/com/massivecraft/factions/entity/MConf.java +++ b/src/com/massivecraft/factions/entity/MConf.java @@ -58,7 +58,7 @@ public class MConf extends Entity // We offer a simple standard way to set the format public boolean chatSetFormat = false; public EventPriority chatSetFormatAt = EventPriority.LOWEST; - public String chatSetFormatTo = "<{factions_relcolor}§l{factions_roleprefix}§r{factions_relcolor}{factions_tag|rp}§f%1$s> %2$s"; + public String chatSetFormatTo = "<{factions_relcolor}§l{factions_roleprefix}§r{factions_relcolor}{factions_name|rp}§f%1$s> %2$s"; // We offer a simple standard way to parse the chat tags public boolean chatParseTags = true; @@ -78,7 +78,7 @@ public class MConf extends Entity // HeroChat: The Allies Channel public String herochatAlliesName = "Allies"; public String herochatAlliesNick = "A"; - public String herochatAlliesFormat = "{color}[&l{nick}&r&f {factions_relcolor}&l{factions_roleprefix}&r{factions_relcolor}{factions_tag|rp}{sender}{color}] &f{msg}"; + public String herochatAlliesFormat = "{color}[&l{nick}&r&f {factions_relcolor}&l{factions_roleprefix}&r{factions_relcolor}{factions_name|rp}{sender}{color}] &f{msg}"; public ChatColor herochatAlliesColor = ChatColor.DARK_PURPLE; public int herochatAlliesDistance = 0; public boolean herochatAlliesIsShortcutAllowed = false; diff --git a/src/com/massivecraft/factions/entity/UConf.java b/src/com/massivecraft/factions/entity/UConf.java index a4793e44..805e681c 100644 --- a/src/com/massivecraft/factions/entity/UConf.java +++ b/src/com/massivecraft/factions/entity/UConf.java @@ -62,9 +62,9 @@ public class UConf extends Entity public int factionMemberLimit = 0; public double factionPowerMax = 1000.0; - public int factionTagLengthMin = 3; - public int factionTagLengthMax = 10; - public boolean factionTagForceUpperCase = false; + public int factionNameLengthMin = 3; + public int factionNameLengthMax = 16; + public boolean factionNameForceUpperCase = false; // -------------------------------------------- // // CLAIMS @@ -154,7 +154,7 @@ public class UConf extends Entity public double econCostInvite = 0.0; public double econCostDeinvite = 0.0; public double econCostHome = 0.0; - public double econCostTag = 0.0; + public double econCostName = 0.0; public double econCostDescription = 0.0; public double econCostTitle = 0.0; public double econCostOpen = 0.0; diff --git a/src/com/massivecraft/factions/entity/UPlayer.java b/src/com/massivecraft/factions/entity/UPlayer.java index fb63f713..c4c68cd3 100644 --- a/src/com/massivecraft/factions/entity/UPlayer.java +++ b/src/com/massivecraft/factions/entity/UPlayer.java @@ -332,7 +332,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato } // -------------------------------------------- // - // TITLE, NAME, FACTION TAG AND CHAT + // TITLE, NAME, FACTION NAME AND CHAT // -------------------------------------------- // public String getName() @@ -340,11 +340,11 @@ public class UPlayer extends SenderEntity implements EconomyParticipato return this.getFixedId(); } - public String getTag() + public String getFactionName() { Faction faction = this.getFaction(); if (faction.isNone()) return ""; - return faction.getTag(); + return faction.getName(); } // Base concatenations: @@ -372,9 +372,9 @@ public class UPlayer extends SenderEntity implements EconomyParticipato } } - public String getNameAndTag() + public String getNameAndFactionName() { - return this.getNameAndSomething(this.getTag()); + return this.getNameAndSomething(this.getFactionName()); } // Colored concatenations: @@ -498,7 +498,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato if (MConf.get().logFactionLeave) { - Factions.get().log(this.getName()+" left the faction: "+myFaction.getTag()); + Factions.get().log(this.getName()+" left the faction: "+myFaction.getName()); } } @@ -515,7 +515,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato myFaction.detach(); if (MConf.get().logFactionDisband) { - Factions.get().log("The faction "+myFaction.getTag()+" ("+myFaction.getId()+") was disbanded due to the last player ("+this.getName()+") leaving."); + Factions.get().log("The faction "+myFaction.getName()+" ("+myFaction.getId()+") was disbanded due to the last player ("+this.getName()+") leaving."); } } } @@ -596,7 +596,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato if (!oldFaction.hasLandInflation()) { - msg("%s owns this land and is strong enough to keep it.", oldFaction.getTag(this)); + msg("%s owns this land and is strong enough to keep it.", oldFaction.getName(this)); return false; } diff --git a/src/com/massivecraft/factions/event/FactionsEventCreate.java b/src/com/massivecraft/factions/event/FactionsEventCreate.java index 329b1ce6..e570641c 100644 --- a/src/com/massivecraft/factions/event/FactionsEventCreate.java +++ b/src/com/massivecraft/factions/event/FactionsEventCreate.java @@ -23,19 +23,19 @@ public class FactionsEventCreate extends FactionsEventAbstractSender private final String factionId; public final String getFactionId() { return this.factionId; } - private final String factionTag; - public final String getFactionTag() { return this.factionTag; } + private final String factionName; + public final String getFactionName() { return this.factionName; } // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // - public FactionsEventCreate(CommandSender sender, String universe, String factionId, String factionTag) + public FactionsEventCreate(CommandSender sender, String universe, String factionId, String factionName) { super(sender); this.universe = universe; this.factionId = factionId; - this.factionTag = factionTag; + this.factionName = factionName; } } \ No newline at end of file diff --git a/src/com/massivecraft/factions/event/FactionsEventTagChange.java b/src/com/massivecraft/factions/event/FactionsEventNameChange.java similarity index 72% rename from src/com/massivecraft/factions/event/FactionsEventTagChange.java rename to src/com/massivecraft/factions/event/FactionsEventNameChange.java index 8957e589..d4c2abc2 100644 --- a/src/com/massivecraft/factions/event/FactionsEventTagChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventNameChange.java @@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList; import com.massivecraft.factions.entity.Faction; -public class FactionsEventTagChange extends FactionsEventAbstractSender +public class FactionsEventNameChange extends FactionsEventAbstractSender { // -------------------------------------------- // // REQUIRED EVENT CODE @@ -22,19 +22,19 @@ public class FactionsEventTagChange extends FactionsEventAbstractSender private final Faction faction; public Faction getFaction() { return this.faction; } - private String newTag; - public String getNewTag() { return this.newTag; } - public void setNewTag(String newTag) { this.newTag = newTag; } + private String newName; + public String getNewName() { return this.newName; } + public void setNewName(String newName) { this.newName = newName; } // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // - public FactionsEventTagChange(CommandSender sender, Faction faction, String newTag) + public FactionsEventNameChange(CommandSender sender, Faction faction, String newName) { super(sender); this.faction = faction; - this.newTag = newTag; + this.newName = newName; } } diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java b/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java index 8b7c325c..175bcc19 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java @@ -22,7 +22,7 @@ import com.massivecraft.factions.event.FactionsEventMembershipChange; import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.FactionsEventOpenChange; import com.massivecraft.factions.event.FactionsEventRelationChange; -import com.massivecraft.factions.event.FactionsEventTagChange; +import com.massivecraft.factions.event.FactionsEventNameChange; import com.massivecraft.factions.event.FactionsEventTitleChange; import com.massivecraft.factions.integration.Econ; import com.massivecraft.mcore.money.Money; @@ -88,7 +88,7 @@ public class FactionsListenerEcon implements Listener Econ.transferMoney(usender, faction, usender, amount, false); usender.msg("You have been given the disbanded faction's bank, totaling %s.", amountString); - Factions.get().log(usender.getName() + " has been given bank holdings of "+amountString+" from disbanding "+faction.getTag()+"."); + Factions.get().log(usender.getName() + " has been given bank holdings of "+amountString+" from disbanding "+faction.getName()+"."); } // -------------------------------------------- // @@ -191,10 +191,10 @@ public class FactionsListenerEcon implements Listener } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) - public void payForCommand(FactionsEventTagChange event) + public void payForCommand(FactionsEventNameChange event) { - Double cost = UConf.get(event.getSender()).econCostTag; - String desc = Factions.get().getOuterCmdFactions().cmdFactionsTag.getDesc(); + Double cost = UConf.get(event.getSender()).econCostName; + String desc = Factions.get().getOuterCmdFactions().cmdFactionsName.getDesc(); payForAction(event, cost, desc); } diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java index 23b02128..4f19c4ae 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java @@ -125,7 +125,7 @@ public class FactionsListenerMain implements Listener } else if (factionFrom != factionTo) { - String msg = Txt.parse("") + " ~ " + factionTo.getTag(uplayer); + String msg = Txt.parse("") + " ~ " + factionTo.getName(uplayer); if (factionTo.hasDescription()) { msg += " - " + factionTo.getDescription(); diff --git a/src/com/massivecraft/factions/util/MiscUtil.java b/src/com/massivecraft/factions/util/MiscUtil.java index a144619f..6dd6e81e 100644 --- a/src/com/massivecraft/factions/util/MiscUtil.java +++ b/src/com/massivecraft/factions/util/MiscUtil.java @@ -24,7 +24,7 @@ public class MiscUtil return values; } - /// TODO create tag whitelist!! + /// TODO create name whitelist!!? public static HashSet substanceChars = new HashSet(Arrays.asList(new String []{ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", diff --git a/src/com/massivecraft/factions/util/RelationUtil.java b/src/com/massivecraft/factions/util/RelationUtil.java index 4882ed00..84d5a147 100644 --- a/src/com/massivecraft/factions/util/RelationUtil.java +++ b/src/com/massivecraft/factions/util/RelationUtil.java @@ -35,7 +35,7 @@ public class RelationUtil } else { - ret = thatFaction.getTag(); + ret = thatFaction.getName(); } } else if (that instanceof UPlayer) @@ -51,7 +51,7 @@ public class RelationUtil } else { - ret = uplayerthat.getNameAndTag(); + ret = uplayerthat.getNameAndFactionName(); } }