use of net.minecraft.util.text.ITextComponent in project Overloaded by CJ-MC-Mods.
the class AbstractMultiArmor method getName.
@Override
@Nonnull
public ITextComponent getName(@Nonnull ItemStack stack) {
ITextComponent name = super.getName(stack);
name.getStyle().applyFormat(TextFormatting.GOLD);
return name;
}
use of net.minecraft.util.text.ITextComponent in project MorePlanets by SteveKunG.
the class EntityNibiruVillager method getDisplayName.
@Override
public ITextComponent getDisplayName() {
Team team = this.getTeam();
String customName = this.getCustomNameTag();
if (customName != null && !customName.isEmpty()) {
TextComponentString component = new TextComponentString(ScorePlayerTeam.formatPlayerName(team, customName));
component.getStyle().setHoverEvent(this.getHoverEvent());
component.getStyle().setInsertion(this.getCachedUniqueIdString());
return component;
} else {
if (this.buyingList == null) {
this.populateBuyingList();
}
String name = null;
String type = this.getProfession() > 2 ? "green_vein" : "infected";
switch(this.getProfession()) {
case 0:
case 3:
name = "farmer";
break;
case 1:
case 4:
name = "librarian";
break;
case 2:
case 5:
name = "medic";
break;
}
if (name != null) {
ITextComponent component = new TextComponentTranslation("entity.nibiru_villager." + type + "_" + name);
component.getStyle().setHoverEvent(this.getHoverEvent());
component.getStyle().setInsertion(this.getCachedUniqueIdString());
if (team != null) {
component.getStyle().setColor(team.getColor());
}
return component;
} else {
return super.getDisplayName();
}
}
}
use of net.minecraft.util.text.ITextComponent in project Realistic-Terrain-Generation by Team-RTG.
the class RTGCommandTree method getUsage.
@Override
public String getUsage(ICommandSender sender) {
final ITextComponent ret = new TextComponentString("");
getSubCommands().forEach(cmd -> {
if (cmd instanceof CommandTreeBase) {
((CommandTreeBase) cmd).getSubCommands().forEach(rcmd -> ret.appendText("\n").appendText(rcmd.getUsage(sender)));
} else {
ret.appendText("\n").appendText(cmd.getUsage(sender));
}
});
return ret.getFormattedText();
}
use of net.minecraft.util.text.ITextComponent in project AgriCraft by AgriCraft.
the class JournalDataDrawerIntroduction method drawRightSheet.
@Override
public void drawRightSheet(IntroductionPage page, IPageRenderContext context, MatrixStack transforms, ItemStack stack, IAgriJournalItem journal) {
float dy = 10;
float dx = 6;
float spacing = 4;
// Title
dy += context.drawText(transforms, INTRODUCTION, dx, dy);
dy += spacing;
// First paragraph
dy += context.drawText(transforms, PARAGRAPH_1, dx, dy, 0.70F);
dy += spacing;
// Second paragraph
dy += context.drawText(transforms, PARAGRAPH_2, dx, dy, 0.70F);
dy += spacing;
// Third paragraph
dy += context.drawText(transforms, PARAGRAPH_3, dx, dy, 0.70F);
dy += spacing;
dy += spacing;
// Final paragraph:
ITextComponent discovered = new StringTextComponent("").appendSibling(DISCOVERED).appendString(": " + journal.getDiscoveredSeeds(stack).size() + " / " + AgriApi.getPlantRegistry().count());
context.drawText(transforms, discovered, dx, dy, 0.70F);
}
use of net.minecraft.util.text.ITextComponent in project RFTools by McJty.
the class CmdListReceivers method execute.
@Override
public void execute(ICommandSender sender, String[] args) {
TeleportDestinations destinations = TeleportDestinations.getDestinations(sender.getEntityWorld());
Collection<TeleportDestinationClientInfo> validDestinations = destinations.getValidDestinations(sender.getEntityWorld(), null);
for (TeleportDestinationClientInfo clientInfo : validDestinations) {
int id = clientInfo.getDimension();
ITextComponent component = new TextComponentString(" Receiver: dimension=" + id + ", location=" + BlockPosTools.toString(clientInfo.getCoordinate()));
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
}
}
Aggregations