mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-05 01:59:46 +01:00
Territory info using 1.8 Titles.
This commit is contained in:
parent
15dab6e5f7
commit
df90260030
@ -691,12 +691,17 @@ public class EngineMain extends EngineAbstract
|
||||
}
|
||||
else if (factionFrom != factionTo)
|
||||
{
|
||||
String msg = Txt.parse("<i>") + " ~ " + factionTo.getName(mplayer);
|
||||
if (factionTo.hasDescription())
|
||||
if (this.isTerritoryInfoUsingScreen())
|
||||
{
|
||||
msg += " - " + factionTo.getDescription();
|
||||
String maintitle = parseTerritoryInfo(MConf.get().territoryInfoScreenMaintitle, mplayer, factionTo);
|
||||
String subtitle = parseTerritoryInfo(MConf.get().territoryInfoScreenSubtitle, mplayer, factionTo);
|
||||
Mixin.sendTitleMessage(player, MConf.get().territoryInfoScreenTicksIn, MConf.get().territoryInfoScreenTicksStay, MConf.get().territoryInfoScreenTicksOut, maintitle, subtitle);
|
||||
}
|
||||
else
|
||||
{
|
||||
String message = parseTerritoryInfo(MConf.get().territoryInfoChat, mplayer, factionTo);
|
||||
player.sendMessage(message);
|
||||
}
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
||||
// Show access level message if it changed.
|
||||
@ -706,7 +711,7 @@ public class EngineMain extends EngineAbstract
|
||||
TerritoryAccess accessTo = BoardColl.get().getTerritoryAccessAt(chunkTo);
|
||||
Boolean hasTerritoryAccessTo = accessTo.hasTerritoryAccess(mplayer);
|
||||
|
||||
if (!MUtil.equals(hasTerritoryAccessFrom, hasTerritoryAccessTo))
|
||||
if ( ! MUtil.equals(hasTerritoryAccessFrom, hasTerritoryAccessTo))
|
||||
{
|
||||
if (hasTerritoryAccessTo == null)
|
||||
{
|
||||
@ -723,6 +728,24 @@ public class EngineMain extends EngineAbstract
|
||||
}
|
||||
}
|
||||
|
||||
public String parseTerritoryInfo(String string, MPlayer mplayer, Faction faction)
|
||||
{
|
||||
string = Txt.parse(string);
|
||||
|
||||
string = string.replace("{name}", faction.getName());
|
||||
string = string.replace("{relcolor}", faction.getColorTo(mplayer).toString());
|
||||
string = string.replace("{desc}", faction.getDescription());
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
public boolean isTerritoryInfoUsingScreen()
|
||||
{
|
||||
if ( ! MConf.get().territoryInfoUseScreen) return false;
|
||||
if ( ! Mixin.isTitlesAvailable()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CHUNK CHANGE: AUTO CLAIM
|
||||
// -------------------------------------------- //
|
||||
|
@ -266,6 +266,20 @@ public class MConf extends Entity<MConf>
|
||||
// Choose between: LOWEST, LOW, NORMAL, HIGH, HIGHEST and MONITOR.
|
||||
public EventPriority homesTeleportToOnDeathPriority = EventPriority.NORMAL;
|
||||
|
||||
// -------------------------------------------- //
|
||||
// TERRITORY INFO
|
||||
// -------------------------------------------- //
|
||||
|
||||
public boolean territoryInfoUseScreen = true;
|
||||
|
||||
public String territoryInfoScreenMaintitle = "{relcolor}{name}";
|
||||
public String territoryInfoScreenSubtitle = "<i>{desc}";
|
||||
public int territoryInfoScreenTicksIn = 5;
|
||||
public int territoryInfoScreenTicksStay = 60;
|
||||
public int territoryInfoScreenTicksOut = 5;
|
||||
|
||||
public String territoryInfoChat = "<i> ~ {relcolor}{name} <i>{desc}";
|
||||
|
||||
// -------------------------------------------- //
|
||||
// ASSORTED
|
||||
// -------------------------------------------- //
|
||||
|
Loading…
Reference in New Issue
Block a user