Enum TagReplacer
- java.lang.Object
-
- java.lang.Enum<TagReplacer>
-
- com.massivecraft.factions.zcore.util.TagReplacer
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TagReplacer>
,java.lang.constant.Constable
public enum TagReplacer extends java.lang.Enum<TagReplacer>
Link between config and in-game messages
Changes based on faction / player
Interfaces the config lists with {} variables to plugin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TagReplacer.TagType
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLIES_COUNT
ALLIES_LIST
Fancy variables, used by f showALTS
BANK_BALANCE
CHUNKS
CREATE_DATE
DESCRIPTION
ENEMIES_COUNT
ENEMIES_LIST
FACTION
FACTION_BANCOUNT
FACTION_DEATHS
FACTION_KILLS
FACTION_POINTS
FACTION_SIZE
FACTION_STRIKES
FACTIONLESS
HEADER
HOME_WORLD
HOME_X
Faction variables, require at least a playerHOME_Y
HOME_Z
JOINING
LAND_REFUND
LAND_VALUE
LAST_SEEN
LEADER
MAX_ALLIES
MAX_ENEMIES
MAX_POWER
MAX_TRUCES
MAX_WARPS
General variables, require no faction or playerOFFLINE_COUNT
OFFLINE_LIST
ONLINE_COUNT
ONLINE_LIST
PEACEFUL
PERMANENT
PLAYER_BALANCE
PLAYER_DEATHS
PLAYER_GROUP
Player variables, require a playerPLAYER_KILLS
PLAYER_MAXPOWER
PLAYER_NAME
PLAYER_POWER
POWER
POWER_BOOST
RAIDABLE
TIME_LEFT
TOTAL_ONLINE
TRUCES_COUNT
TRUCES_LIST
WARPS
-
Method Summary
Modifier and Type Method Description boolean
contains(java.lang.String toSearch)
protected static java.util.List<TagReplacer>
getByType(TagReplacer.TagType type)
Returns a list of all the variables we can use for this typejava.lang.String
getTag()
Gets the tag associated with this enum that we should replaceprotected java.lang.String
getValue()
Protected access to this generic server related variableprotected java.lang.String
getValue(Faction fac, FPlayer fp)
Gets the value for this (as in the instance this is called from) variable!java.lang.String
replace(java.lang.String original, java.lang.String value)
static TagReplacer
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TagReplacer[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ALLIES_LIST
public static final TagReplacer ALLIES_LIST
Fancy variables, used by f show
-
ONLINE_LIST
public static final TagReplacer ONLINE_LIST
-
ENEMIES_LIST
public static final TagReplacer ENEMIES_LIST
-
TRUCES_LIST
public static final TagReplacer TRUCES_LIST
-
OFFLINE_LIST
public static final TagReplacer OFFLINE_LIST
-
ALTS
public static final TagReplacer ALTS
-
PLAYER_GROUP
public static final TagReplacer PLAYER_GROUP
Player variables, require a player
-
LAST_SEEN
public static final TagReplacer LAST_SEEN
-
PLAYER_BALANCE
public static final TagReplacer PLAYER_BALANCE
-
PLAYER_POWER
public static final TagReplacer PLAYER_POWER
-
PLAYER_MAXPOWER
public static final TagReplacer PLAYER_MAXPOWER
-
PLAYER_KILLS
public static final TagReplacer PLAYER_KILLS
-
PLAYER_DEATHS
public static final TagReplacer PLAYER_DEATHS
-
HOME_X
public static final TagReplacer HOME_X
Faction variables, require at least a player
-
HOME_Y
public static final TagReplacer HOME_Y
-
HOME_Z
public static final TagReplacer HOME_Z
-
CHUNKS
public static final TagReplacer CHUNKS
-
WARPS
public static final TagReplacer WARPS
-
HEADER
public static final TagReplacer HEADER
-
POWER
public static final TagReplacer POWER
-
MAX_POWER
public static final TagReplacer MAX_POWER
-
POWER_BOOST
public static final TagReplacer POWER_BOOST
-
LEADER
public static final TagReplacer LEADER
-
JOINING
public static final TagReplacer JOINING
-
FACTION
public static final TagReplacer FACTION
-
PLAYER_NAME
public static final TagReplacer PLAYER_NAME
-
HOME_WORLD
public static final TagReplacer HOME_WORLD
-
RAIDABLE
public static final TagReplacer RAIDABLE
-
PEACEFUL
public static final TagReplacer PEACEFUL
-
PERMANENT
public static final TagReplacer PERMANENT
-
TIME_LEFT
public static final TagReplacer TIME_LEFT
-
LAND_VALUE
public static final TagReplacer LAND_VALUE
-
DESCRIPTION
public static final TagReplacer DESCRIPTION
-
CREATE_DATE
public static final TagReplacer CREATE_DATE
-
LAND_REFUND
public static final TagReplacer LAND_REFUND
-
BANK_BALANCE
public static final TagReplacer BANK_BALANCE
-
ALLIES_COUNT
public static final TagReplacer ALLIES_COUNT
-
ENEMIES_COUNT
public static final TagReplacer ENEMIES_COUNT
-
TRUCES_COUNT
public static final TagReplacer TRUCES_COUNT
-
ONLINE_COUNT
public static final TagReplacer ONLINE_COUNT
-
OFFLINE_COUNT
public static final TagReplacer OFFLINE_COUNT
-
FACTION_SIZE
public static final TagReplacer FACTION_SIZE
-
FACTION_KILLS
public static final TagReplacer FACTION_KILLS
-
FACTION_DEATHS
public static final TagReplacer FACTION_DEATHS
-
FACTION_BANCOUNT
public static final TagReplacer FACTION_BANCOUNT
-
FACTION_STRIKES
public static final TagReplacer FACTION_STRIKES
-
FACTION_POINTS
public static final TagReplacer FACTION_POINTS
-
MAX_WARPS
public static final TagReplacer MAX_WARPS
General variables, require no faction or player
-
MAX_ALLIES
public static final TagReplacer MAX_ALLIES
-
MAX_ENEMIES
public static final TagReplacer MAX_ENEMIES
-
MAX_TRUCES
public static final TagReplacer MAX_TRUCES
-
FACTIONLESS
public static final TagReplacer FACTIONLESS
-
TOTAL_ONLINE
public static final TagReplacer TOTAL_ONLINE
-
-
Method Detail
-
values
public static TagReplacer[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TagReplacer valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getByType
protected static java.util.List<TagReplacer> getByType(TagReplacer.TagType type)
Returns a list of all the variables we can use for this type- Parameters:
type
- the type we want- Returns:
- a list of all the variables with this type
-
getValue
protected java.lang.String getValue()
Protected access to this generic server related variable- Returns:
- value for this generic server related variable
-
getValue
protected java.lang.String getValue(Faction fac, FPlayer fp)
Gets the value for this (as in the instance this is called from) variable!- Parameters:
fac
- Target factionfp
- Target player (can be null)- Returns:
- the value for this enum!
-
replace
public java.lang.String replace(java.lang.String original, java.lang.String value)
- Parameters:
original
- raw line with variablesvalue
- what to replace var in raw line with- Returns:
- the string with the new value
-
contains
public boolean contains(java.lang.String toSearch)
- Parameters:
toSearch
- raw line with variables- Returns:
- if the raw line contains this enums variable
-
getTag
public java.lang.String getTag()
Gets the tag associated with this enum that we should replace- Returns:
- the {....} variable that is located in config
-
-