From f32af6e02f65a2758fd90146325059cbf6d1acc6 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Fri, 24 Mar 2017 14:29:26 +0100 Subject: [PATCH] Remove Lang class. Constants belong in Factions and MPlayer accordingly. --- src/com/massivecraft/factions/Lang.java | 10 ---------- .../massivecraft/factions/entity/Faction.java | 16 +++++++++++----- .../massivecraft/factions/entity/MPlayer.java | 9 +++++++-- 3 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 src/com/massivecraft/factions/Lang.java diff --git a/src/com/massivecraft/factions/Lang.java b/src/com/massivecraft/factions/Lang.java deleted file mode 100644 index bd513278..00000000 --- a/src/com/massivecraft/factions/Lang.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.massivecraft.factions; - -import com.massivecraft.massivecore.util.Txt; - -public class Lang -{ - public static final String FACTION_NODESCRIPTION = Txt.parse("no description set"); - public static final String FACTION_NOMOTD = Txt.parse("no message of the day set"); - public static final String PLAYER_NOTITLE = Txt.parse("no title set"); -} diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index 63f9c508..dad3c343 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -1,12 +1,11 @@ package com.massivecraft.factions.entity; -import com.massivecraft.factions.predicate.PredicateCommandSenderFaction; import com.massivecraft.factions.Factions; import com.massivecraft.factions.FactionsParticipator; -import com.massivecraft.factions.Lang; -import com.massivecraft.factions.predicate.PredicateMPlayerRole; import com.massivecraft.factions.Rel; import com.massivecraft.factions.RelationParticipator; +import com.massivecraft.factions.predicate.PredicateCommandSenderFaction; +import com.massivecraft.factions.predicate.PredicateMPlayerRole; import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.factions.util.RelationUtil; import com.massivecraft.massivecore.collections.MassiveList; @@ -44,6 +43,13 @@ import java.util.TreeSet; public class Faction extends Entity implements FactionsParticipator { + // -------------------------------------------- // + // CONSTANTS + // -------------------------------------------- // + + public static final transient String NODESCRIPTION = Txt.parse("no description set"); + public static final transient String NOMOTD = Txt.parse("no message of the day set"); + // -------------------------------------------- // // META // -------------------------------------------- // @@ -236,7 +242,7 @@ public class Faction extends Entity implements FactionsParticipator public String getDescription() { if (this.hasDescription()) return this.description; - return Lang.FACTION_NODESCRIPTION; + return NODESCRIPTION; } public void setDescription(String description) @@ -277,7 +283,7 @@ public class Faction extends Entity implements FactionsParticipator public String getMotd() { if (this.hasMotd()) return Txt.parse(this.motd); - return Lang.FACTION_NOMOTD; + return NOMOTD; } public void setMotd(String description) diff --git a/src/com/massivecraft/factions/entity/MPlayer.java b/src/com/massivecraft/factions/entity/MPlayer.java index bb888ccc..474f3a51 100644 --- a/src/com/massivecraft/factions/entity/MPlayer.java +++ b/src/com/massivecraft/factions/entity/MPlayer.java @@ -2,7 +2,6 @@ package com.massivecraft.factions.entity; import com.massivecraft.factions.Factions; import com.massivecraft.factions.FactionsParticipator; -import com.massivecraft.factions.Lang; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; import com.massivecraft.factions.RelationParticipator; @@ -38,6 +37,12 @@ public class MPlayer extends SenderEntity implements FactionsParticipat // -------------------------------------------- // // META // -------------------------------------------- // + + public static final transient String NOTITLE = Txt.parse("no title set"); + + // -------------------------------------------- // + // META + // -------------------------------------------- // public static MPlayer get(Object oid) { @@ -353,7 +358,7 @@ public class MPlayer extends SenderEntity implements FactionsParticipat public String getTitle() { if (this.hasTitle()) return this.title; - return Lang.PLAYER_NOTITLE; + return NOTITLE; } public void setTitle(String title)