From 1d00a0aa54e26fa85742189b68c731de43e096db Mon Sep 17 00:00:00 2001 From: korikisulda Date: Tue, 27 Jan 2015 15:46:56 +0000 Subject: [PATCH] Yet more TL. Hi @Bonkozorus --- .../factions/listeners/FactionsEntityListener.java | 4 ++-- .../com/massivecraft/factions/util/RelationUtil.java | 6 ++++-- .../java/com/massivecraft/factions/zcore/util/TL.java | 11 +++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java index d982ec18..b8518145 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -283,7 +283,7 @@ public class FactionsEntityListener implements Listener { if (damager instanceof Player) { if (notify) { FPlayer attacker = FPlayers.getInstance().getByPlayer((Player) damager); - attacker.msg("You can't hurt other players in " + (defLocFaction.isSafeZone() ? "a SafeZone." : "peaceful territory.")); + attacker.msg(TL.PLAYER_CANTHURT, (defLocFaction.isSafeZone() ? TL.REGION_SAFEZONE.toString() : TL.REGION_PEACEFUL.toString())); } return false; } @@ -316,7 +316,7 @@ public class FactionsEntityListener implements Listener { // so we know from above that the defender isn't in a safezone... what about the attacker, sneaky dog that he might be? if (locFaction.noPvPInTerritory()) { if (notify) { - attacker.msg("You can't hurt other players while you are in " + (locFaction.isSafeZone() ? "a SafeZone." : "peaceful territory.")); + attacker.msg(TL.PLAYER_CANTHURT, (locFaction.isSafeZone() ? TL.REGION_SAFEZONE.toString() : TL.REGION_PEACEFUL.toString())); } return false; } diff --git a/src/main/java/com/massivecraft/factions/util/RelationUtil.java b/src/main/java/com/massivecraft/factions/util/RelationUtil.java index b84d5176..2a56e28d 100644 --- a/src/main/java/com/massivecraft/factions/util/RelationUtil.java +++ b/src/main/java/com/massivecraft/factions/util/RelationUtil.java @@ -5,7 +5,9 @@ import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.iface.RelationParticipator; import com.massivecraft.factions.struct.Relation; +import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TextUtil; + import org.bukkit.ChatColor; public class RelationUtil { @@ -23,14 +25,14 @@ public class RelationUtil { if (that instanceof Faction) { if (me instanceof FPlayer && myFaction == thatFaction) { - ret = "your faction"; + ret = TL.GENERIC_YOURFACTION.toString(); } else { ret = thatFaction.getTag(); } } else if (that instanceof FPlayer) { FPlayer fplayerthat = (FPlayer) that; if (that == me) { - ret = "you"; + ret = TL.GENERIC_YOU.toString(); } else if (thatFaction == myFaction) { ret = fplayerthat.getNameAndTitle(); } else { diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index 365a68c1..a0627b64 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -543,6 +543,8 @@ public enum TL { /** * More generic, or less easily categorisable translations, which may apply to more than one class */ + GENERIC_YOU("you"), + GENERIC_YOURFACTION("your faction"), GENERIC_NOPERMISSION("You don't have permission to %1$s."), GENERIC_DOTHAT("do that"), //Ugh nuke this from high orbit GENERIC_NOPLAYERMATCH("No player match found for \"

%1$s\"."), @@ -605,9 +607,18 @@ public enum TL { ROLE_MODERATOR("moderator"), ROLE_NORMAL("normal member"), + /** + * Region types. + */ + REGION_SAFEZONE("safezone"), + REGION_WARZONE("warzone"), + REGION_WILDERNESS("wilderness"), + + REGION_PEACEFUL("peaceful territory"), /** * In the player and entity listeners */ + PLAYER_CANTHURT("You may not harm other players in %s"), PLAYER_SAFEAUTO("This land is now a safe zone."), PLAYER_WARAUTO("This land is now a war zone."), PLAYER_OUCH("Ouch, that is starting to hurt. You should give it a rest."),