Search in sources :

Example 61 with ChatComponentText

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);
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) Entity(net.minecraft.entity.Entity) TileEntity(net.minecraft.tileentity.TileEntity) OpenChatGui(logisticspipes.network.packets.gui.OpenChatGui) Block(net.minecraft.block.Block) ChatComponentText(net.minecraft.util.ChatComponentText)

Example 62 with ChatComponentText

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);
}
Also used : ChatStyle(net.minecraft.util.ChatStyle) ChatComponentText(net.minecraft.util.ChatComponentText)

Example 63 with ChatComponentText

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);
    }
}
Also used : ChatComponentText(net.minecraft.util.ChatComponentText) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 64 with ChatComponentText

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")));
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) ChatComponentText(net.minecraft.util.ChatComponentText)

Example 65 with ChatComponentText

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");
    }
}
Also used : ChatStyle(net.minecraft.util.ChatStyle) ClickEvent(net.minecraft.event.ClickEvent) IChatComponent(net.minecraft.util.IChatComponent) ChatComponentText(net.minecraft.util.ChatComponentText)

Aggregations

ChatComponentText (net.minecraft.util.ChatComponentText)108 EntityPlayer (net.minecraft.entity.player.EntityPlayer)19 ItemStack (net.minecraft.item.ItemStack)16 TileEntity (net.minecraft.tileentity.TileEntity)9 Entity (net.minecraft.entity.Entity)8 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)7 ArrayList (java.util.ArrayList)7 Block (net.minecraft.block.Block)6 AMVector3 (am2.api.math.AMVector3)4 AccessGroup (com.builtbroken.mc.framework.access.AccessGroup)4 Pos (com.builtbroken.mc.imp.transform.vector.Pos)4 OpenChatGui (logisticspipes.network.packets.gui.OpenChatGui)4 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)4 ChatStyle (net.minecraft.util.ChatStyle)4 IPowerNode (am2.api.power.IPowerNode)3 IItemActivationListener (com.builtbroken.mc.api.items.listeners.IItemActivationListener)3 IItemEventListener (com.builtbroken.mc.api.items.listeners.IItemEventListener)3 AbstractCommand (com.builtbroken.mc.core.commands.prefab.AbstractCommand)3 ItemListenerIterator (com.builtbroken.mc.prefab.items.listeners.ItemListenerIterator)3 EntityLivingBase (net.minecraft.entity.EntityLivingBase)3