Add consoleColorsEnabled configuration option

This commit is contained in:
Olof Larsson 2017-07-02 17:20:51 +02:00
parent f0658af566
commit d47d6ed4a1
4 changed files with 14 additions and 7 deletions

View File

@ -11,6 +11,7 @@ import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsHomeTeleport; import com.massivecraft.factions.event.EventFactionsHomeTeleport;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.mixin.MixinMessage;
import com.massivecraft.massivecore.mixin.MixinTeleport; import com.massivecraft.massivecore.mixin.MixinTeleport;
import com.massivecraft.massivecore.mixin.TeleporterException; import com.massivecraft.massivecore.mixin.TeleporterException;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
@ -148,7 +149,8 @@ public class CmdFactionsHome extends FactionsCommandHome
} }
catch (TeleporterException e) catch (TeleporterException e)
{ {
me.sendMessage(e.getMessage()); String message = e.getMessage();
MixinMessage.get().messageOne(me, message);
} }
} }

View File

@ -7,6 +7,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.Engine; import com.massivecraft.massivecore.Engine;
import com.massivecraft.massivecore.mixin.MixinMessage;
import com.massivecraft.massivecore.mixin.MixinTitle; import com.massivecraft.massivecore.mixin.MixinTitle;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
@ -77,7 +78,7 @@ public class EngineMoveChunk extends Engine
else else
{ {
String message = parseTerritoryInfo(MConf.get().territoryInfoChat, mplayer, factionTo); String message = parseTerritoryInfo(MConf.get().territoryInfoChat, mplayer, factionTo);
player.sendMessage(message); MixinMessage.get().messageOne(player, message);
} }
} }

View File

@ -11,6 +11,7 @@ import com.dthielke.herochat.MessageNotFoundException;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.mixin.MixinMessage;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.chat.Chat;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -112,7 +113,8 @@ public abstract class ChannelFactionsAbstract implements Channel
message = applyFormat(this.getFormatSupplier().getAnnounceFormat(), "").replace("%2$s", colorized); message = applyFormat(this.getFormatSupplier().getAnnounceFormat(), "").replace("%2$s", colorized);
for (Chatter member : this.getMembers()) for (Chatter member : this.getMembers())
{ {
member.getPlayer().sendMessage(message); Player player = member.getPlayer();
MixinMessage.get().messageOne(player, message);
} }
Herochat.logChat(ChatColor.stripColor(message)); Herochat.logChat(ChatColor.stripColor(message));
} }
@ -210,7 +212,7 @@ public abstract class ChannelFactionsAbstract implements Channel
for (Player recipient : recipients) for (Player recipient : recipients)
{ {
recipient.sendMessage(message); MixinMessage.get().messageOne(recipient, message);
} }
} }
@ -256,7 +258,7 @@ public abstract class ChannelFactionsAbstract implements Channel
String msg = String.format(format, new Object[] { player.getDisplayName(), event.getMessage() }); String msg = String.format(format, new Object[] { player.getDisplayName(), event.getMessage() });
for (Player recipient : recipients) for (Player recipient : recipients)
{ {
recipient.sendMessage(msg); MixinMessage.get().messageOne(recipient, msg);
} }
Bukkit.getPluginManager().callEvent(new ChatCompleteEvent(sender, this, msg)); Bukkit.getPluginManager().callEvent(new ChatCompleteEvent(sender, this, msg));
@ -362,7 +364,8 @@ public abstract class ChannelFactionsAbstract implements Channel
{ {
for (Chatter member : this.getMembers()) for (Chatter member : this.getMembers())
{ {
member.getPlayer().sendMessage(rawMessage); Player player = member.getPlayer();
MixinMessage.get().messageOne(player, rawMessage);
} }
} }
} }

View File

@ -10,6 +10,7 @@ import com.massivecraft.factions.engine.EnginePermBuild;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.SoundEffect; import com.massivecraft.massivecore.SoundEffect;
import com.massivecraft.massivecore.mixin.MixinMessage;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.IdUtil;
import com.massivecraft.massivecore.util.SmokeUtil; import com.massivecraft.massivecore.util.SmokeUtil;
@ -97,7 +98,7 @@ public class FactionsLwcModule extends JavaModule
// ... and inform. // ... and inform.
Player player = event.getPlayer(); Player player = event.getPlayer();
String message = Txt.parse("<i>Factions removed <h>%s's <i>LWC. They lacked build rights.", mowner.getDisplayName(player)); String message = Txt.parse("<i>Factions removed <h>%s's <i>LWC. They lacked build rights.", mowner.getDisplayName(player));
player.sendMessage(message); MixinMessage.get().messageOne(player, message);
} }
} }