Package net.minecraft.util

Examples of net.minecraft.util.ChatStyle


  public static boolean spawn(EntityPlayer player, ItemStack par1ItemStack, World par3World, int par4, int par5, int par6) {
    Block block = par3World.getBlock(par4, par5, par6);
    if(block == Blocks.beacon && !par3World.isRemote) {
      if(par3World.difficultySetting == EnumDifficulty.PEACEFUL) {
        player.addChatMessage(new ChatComponentTranslation("botaniamisc.peacefulNoob").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
        return false;
      }

      for(int[] coords : PYLON_LOCATIONS) {
        int x = par4 + coords[0];
        int y = par5 + coords[1];
        int z = par6 + coords[2];

        Block blockat = par3World.getBlock(x, y, z);
        int meta = par3World.getBlockMetadata(x, y, z);
        if(blockat != ModBlocks.pylon || meta != 2) {
          player.addChatMessage(new ChatComponentTranslation("botaniamisc.needsCatalysts").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
          return false;
        }
      }

      par1ItemStack.stackSize--;
View Full Code Here


    String force = getForcedPage(par1ItemStack);
    if(force != null && !force.isEmpty()) {
      LexiconEntry entry = getEntryFromForce(par1ItemStack);
      if(entry != null)
        Botania.proxy.setEntryToOpen(entry);
      else par3EntityPlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.cantOpen").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
      setForcedPage(par1ItemStack, "");
    }

    par3EntityPlayer.openGui(Botania.instance, LibGuiIDs.LEXICON, par2World, 0, 0, 0);
    if(!par2World.isRemote && !skipSound)
View Full Code Here

      if(!onlineVersion.isEmpty()) {
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        int onlineBuild = Integer.parseInt(onlineVersion.split("-")[1]);
        int clientBuild = LibMisc.BUILD.contains("GRADLE") ? Integer.MAX_VALUE : Integer.parseInt(LibMisc.BUILD);
        if(onlineBuild > clientBuild) {
          player.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.flavour" + player.worldObj.rand.nextInt(FLAVOUR_MESSAGES)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE)));
          player.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild));

          IChatComponent component = IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion));
          player.addChatComponentMessage(component);
        }
View Full Code Here

        buffer = new byte[10240];
        totalBytesDownloaded += bytesJustDownloaded;
      }

      if(Minecraft.getMinecraft().thePlayer != null)
        Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentTranslation("botania.versioning.doneDownloading", fileName).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));

      Desktop.getDesktop().open(dir);
      VersionChecker.downloadedFile = true;

      outputStream.close();
View Full Code Here

    }
  }

  private void sendError() {
    if(Minecraft.getMinecraft().thePlayer != null)
      Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
  }
View Full Code Here

      EntityPlayer player = (EntityPlayer) sender;
      ItemStack stack = player.getCurrentEquippedItem();
      if(stack != null && stack.getItem() instanceof ItemLexicon) {
        ItemLexicon.setForcedPage(stack, args[0]);
        ItemLexicon.setQueueTicks(stack, 3);
      } else sender.addChatMessage(new ChatComponentTranslation("botaniamisc.noLexicon").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
    }
  }
View Full Code Here

  }

  @Override
  public void processCommand(ICommandSender var1, String[] var2) {
    if(!ENABLED)
      var1.addChatMessage(new ChatComponentTranslation("botania.versioning.disabled").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));

    else if(var2.length == 1)
      if(VersionChecker.downloadedFile)
        var1.addChatMessage(new ChatComponentTranslation("botania.versioning.downloadedAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
      else if(VersionChecker.startedDownload)
        var1.addChatMessage(new ChatComponentTranslation("botania.versioning.downloadingAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
      else new ThreadDownloadMod("Botania " + var2[0] + ".jar");
  }
View Full Code Here

     */
    private void sendMessage(EnumChatFormatting color, String message)
    {
        IChatComponent chat = new ChatComponentText(PluginStandardValues.PLUGIN_NAME + ": " + message);

        ChatStyle chatStyle = new ChatStyle();
        chatStyle.setColor(color);
        chat.setChatStyle(chatStyle);

        Minecraft.getMinecraft().thePlayer.addChatMessage(chat);
    }
View Full Code Here

                    String[] teamNameSplit = race.getTeamName().split(" ");
                    for (String teamNamePart : teamNameSplit)
                    {
                        teamNameTotal = teamNameTotal.concat(dB + teamNamePart + " ");
                    }
                    playerInvited.addChatMessage(new ChatComponentText(dA + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.inviteReceived", bG + player.getGameProfile().getName() + dA) + "  " + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.toJoin", teamNameTotal, EnumColor.AQUA + "/joinrace" + dA)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_AQUA)));
                }
            }
            break;
        case S_REMOVE_RACE_PLAYER:
            Integer teamInvitedTo = (Integer) this.data.get(1);
            SpaceRace race = SpaceRaceManager.getSpaceRaceFromID(teamInvitedTo);

            if (race != null)
            {
                String playerToRemove = (String) this.data.get(0);

                if (!race.getPlayerNames().remove(playerToRemove))
                {
                    player.addChatMessage(new ChatComponentText(GCCoreUtil.translateWithFormat("gui.spaceRace.chat.notFound", playerToRemove)));
                }
                else
                {
                    SpaceRaceManager.onPlayerRemoval(playerToRemove, race);
                }
            }
            break;
        case S_ADD_RACE_PLAYER:
            Integer teamToAddPlayer = (Integer) this.data.get(1);
            SpaceRace spaceRaceToAddPlayer = SpaceRaceManager.getSpaceRaceFromID(teamToAddPlayer);

            if (spaceRaceToAddPlayer != null)
            {
                String playerToAdd = (String) this.data.get(0);

                if (!spaceRaceToAddPlayer.getPlayerNames().contains(playerToAdd))
                {
                    SpaceRace oldRace = null;
                    while ((oldRace = SpaceRaceManager.getSpaceRaceFromPlayer(playerToAdd)) != null)
                    {
                        SpaceRaceManager.removeSpaceRace(oldRace);
                    }

                    spaceRaceToAddPlayer.getPlayerNames().add(playerToAdd);
                    SpaceRaceManager.sendSpaceRaceData(null, spaceRaceToAddPlayer);

                    for (String member : spaceRaceToAddPlayer.getPlayerNames())
                    {
                        EntityPlayerMP memberObj = PlayerUtil.getPlayerForUsernameVanilla(MinecraftServer.getServer(), member);

                        if (memberObj != null)
                        {
                            memberObj.addChatMessage(new ChatComponentText(EnumColor.DARK_AQUA + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.addSuccess", EnumColor.BRIGHT_GREEN + playerToAdd + EnumColor.DARK_AQUA)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_AQUA)));
                        }
                    }
                }
                else
                {
                    player.addChatMessage(new ChatComponentText(GCCoreUtil.translate("gui.spaceRace.chat.alreadyPart")).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED)));
                }
            }
            break;
        case S_COMPLETE_CBODY_HANDSHAKE:
            String completeList = (String) this.data.get(0);
View Full Code Here

        {
            EntityPlayerMP memberObj = PlayerUtil.getPlayerForUsernameVanilla(MinecraftServer.getServer(), member);

            if (memberObj != null)
            {
                memberObj.addChatMessage(new ChatComponentText(EnumColor.DARK_AQUA + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.removeSuccess", EnumColor.RED + player + EnumColor.DARK_AQUA)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_AQUA)));
            }
        }

        List<String> playerList = new ArrayList<String>();
        playerList.add(player);
View Full Code Here

TOP

Related Classes of net.minecraft.util.ChatStyle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.