use of net.minecraft.util.ChatComponentText in project LogisticsPipes by RS485.
the class DebugTargetResponse method processPacket.
@Override
public void processPacket(final EntityPlayer player) {
if (mode == TargetMode.None) {
player.addChatComponentMessage(new ChatComponentText(ChatColor.RED + "No Target Found"));
} else if (mode == TargetMode.Block) {
int x = additions[0];
int y = additions[1];
int z = additions[2];
player.addChatComponentMessage(new ChatComponentText("Checking Block at: x:" + x + " y:" + y + " z:" + z));
Block id = player.worldObj.getBlock(x, y, z);
player.addChatComponentMessage(new ChatComponentText("Found Block with Id: " + id.getClass()));
final TileEntity tile = player.worldObj.getTileEntity(x, y, z);
if (tile == null) {
player.addChatComponentMessage(new ChatComponentText(ChatColor.RED + "No TileEntity found"));
} else {
LPChatListener.addTask(() -> {
player.addChatComponentMessage(new ChatComponentText(ChatColor.GREEN + "Starting debuging of TileEntity: " + ChatColor.BLUE + ChatColor.UNDERLINE + tile.getClass().getSimpleName()));
DebugGuiController.instance().startWatchingOf(tile, player);
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OpenChatGui.class), player);
return true;
}, player);
player.addChatComponentMessage(new ChatComponentText(ChatColor.AQUA + "Start debuging of TileEntity: " + ChatColor.BLUE + ChatColor.UNDERLINE + tile.getClass().getSimpleName() + ChatColor.AQUA + "? " + ChatColor.RESET + "<" + ChatColor.GREEN + "yes" + ChatColor.RESET + "/" + ChatColor.RED + "no" + ChatColor.RESET + ">"));
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OpenChatGui.class), player);
}
} else if (mode == TargetMode.Entity) {
int entityId = additions[0];
final Entity entity = player.worldObj.getEntityByID(entityId);
if (entity == null) {
player.addChatComponentMessage(new ChatComponentText(ChatColor.RED + "No Entity found"));
} else {
LPChatListener.addTask(() -> {
player.addChatComponentMessage(new ChatComponentText(ChatColor.GREEN + "Starting debuging of Entity: " + ChatColor.BLUE + ChatColor.UNDERLINE + entity.getClass().getSimpleName()));
DebugGuiController.instance().startWatchingOf(entity, player);
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OpenChatGui.class), player);
return true;
}, player);
player.addChatComponentMessage(new ChatComponentText(ChatColor.AQUA + "Start debuging of Entity: " + ChatColor.BLUE + ChatColor.UNDERLINE + entity.getClass().getSimpleName() + ChatColor.AQUA + "? " + ChatColor.RESET + "<" + ChatColor.GREEN + "yes" + ChatColor.RESET + "/" + ChatColor.RED + "no" + ChatColor.RESET + ">"));
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OpenChatGui.class), player);
}
}
}
use of net.minecraft.util.ChatComponentText in project malmo by Microsoft.
the class AgentQuitFromTimeUpImplementation method drawCountDown.
@Override
protected void drawCountDown(int secondsRemaining) {
ChatComponentText text = new ChatComponentText("" + secondsRemaining + "...");
ChatStyle style = new ChatStyle();
style.setBold(true);
if (secondsRemaining <= 5)
style.setColor(EnumChatFormatting.RED);
text.setChatStyle(style);
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(text, 1);
}
use of net.minecraft.util.ChatComponentText in project PneumaticCraft by MineMaarten.
the class IGWMod method notifyOutdatedIGW.
@SubscribeEvent
public void notifyOutdatedIGW(TickEvent.PlayerTickEvent event) {
if (event.player.worldObj.isRemote && event.player == FMLClientHandler.instance().getClientPlayerEntity()) {
event.player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "You are running an outdated version of IGW-Mod which will not work properly with PneumaticCraft!:( Please update!"));
FMLCommonHandler.instance().bus().unregister(this);
}
}
use of net.minecraft.util.ChatComponentText in project SimplyJetpacks by Tonius.
the class Jetpack method doEHover.
public void doEHover(ItemStack armor, EntityLivingBase user) {
NBTHelper.getNBT(armor).setBoolean(TAG_ON, true);
NBTHelper.getNBT(armor).setBoolean(TAG_HOVERMODE_ON, true);
if (user instanceof EntityPlayer) {
((EntityPlayer) user).addChatMessage(new ChatComponentText(StringHelper.LIGHT_RED + SJStringHelper.localize("chat.jetpack.emergencyHoverMode.msg")));
}
}
use of net.minecraft.util.ChatComponentText in project watson by totemo.
the class WatsonCommand method help.
// handleConfigCommand
// --------------------------------------------------------------------------
/**
* Show a help message.
*/
public void help(ICommandSender sender) {
String w = Configuration.instance.getWatsonPrefix();
localOutput(sender, "Usage:");
localOutput(sender, " /" + w + " help");
localOutput(sender, " /" + w + " display [on|off]");
localOutput(sender, " /" + w + " outline [on|off]");
localOutput(sender, " /" + w + " anno [on|off]");
localOutput(sender, " /" + w + " vector [on|off]");
localOutput(sender, " /" + w + " vector (creations|destructions) [on|off]");
localOutput(sender, " /" + w + " vector length <decimal>");
localOutput(sender, " /" + w + " label [on|off]");
localOutput(sender, " /" + w + " clear");
localOutput(sender, " /" + w + " pre [<count>]");
localOutput(sender, " /" + w + " post [<count>]");
localOutput(sender, " /" + w + " ore [<page>]");
localOutput(sender, " /" + w + " ratio");
localOutput(sender, " /" + w + " tp [next|prev|<number>]");
localOutput(sender, " /" + w + " edits [list]");
localOutput(sender, " /" + w + " edits (hide|show|remove) <player> ...");
localOutput(sender, " /" + w + " filter [list|clear]");
localOutput(sender, " /" + w + " filter (add|remove) <player> ...");
localOutput(sender, " /" + w + " servertime");
localOutput(sender, " /" + w + " file list [*|<playername>] [<page>]");
localOutput(sender, " /" + w + " file delete *|<filename>|<playername>");
localOutput(sender, " /" + w + " file expire <YYYY-MM-DD>");
localOutput(sender, " /" + w + " file load <filename>|<playername>");
localOutput(sender, " /" + w + " file save [<filename>]");
localOutput(sender, " /" + w + " config <name> [<value>]");
localOutput(sender, " /hl help");
localOutput(sender, " /anno help");
// Make the documentation link clickable.
IChatComponent docs = new ChatComponentText("Documentation: ");
ChatStyle style = new ChatStyle().setColor(EnumChatFormatting.AQUA);
docs.setChatStyle(style);
String url = "http://github.com/totemo/watson";
IChatComponent link = new ChatComponentText(url);
ChatStyle linkStyle = new ChatStyle();
linkStyle.setUnderlined(true);
link.setChatStyle(linkStyle);
linkStyle.setChatClickEvent(new ClickEvent(Action.OPEN_URL, url));
docs.appendSibling(link);
sender.addChatMessage(docs);
if (!Configuration.instance.isEnabled()) {
localOutput(sender, "Watson is currently disabled.");
localOutput(sender, "To re-enable, use: /" + w + " config watson on");
}
}
Aggregations