Java Code Examples for net.minecraft.util.IChatComponent#appendSibling()
The following examples show how to use
net.minecraft.util.IChatComponent#appendSibling() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommandsEveryone.java From MyTown2 with The Unlicense | 6 votes |
@Command( name = "list", permission = "mytown.cmd.everyone.blocks.list", parentName = "mytown.cmd.everyone.blocks", syntax = "/town blocks list") public static CommandResponse blocksListCommand(ICommandSender sender, List<String> args) { Resident res = MyTownUniverse.instance.getOrMakeResident(sender); Town town = getTownFromResident(res); IChatComponent root = new ChatComponentList(); root.appendSibling(LocalManager.get("myessentials.format.list.header", new ChatComponentFormatted("{9|CLAIMS}"))); root.appendSibling(town.townBlocksContainer.toChatMessage()); ChatManager.send(sender, root); return CommandResponse.DONE; }
Example 2
Source File: CommandsEveryone.java From MyTown2 with The Unlicense | 6 votes |
@Command( name = "list", permission = "mytown.cmd.everyone.ranks.list", parentName = "mytown.cmd.everyone.ranks", syntax = "/town ranks list") public static CommandResponse listRanksCommand(ICommandSender sender, List<String> args) { Resident res = MyTownUniverse.instance.getOrMakeResident(sender); Town town = getTownFromResident(res); IChatComponent root = new ChatComponentList(); root.appendSibling(LocalManager.get("myessentials.format.list.header", new ChatComponentFormatted("{9|RANKS}"))); for (Rank rank : town.ranksContainer) { root.appendSibling(new ChatComponentFormatted("{7| - }").appendSibling(LocalManager.get("mytown.format.rank.long", rank.getName(), rank.getType()))); } ChatManager.send(sender, root); return CommandResponse.DONE; }
Example 3
Source File: ResidentRankMap.java From MyTown2 with The Unlicense | 5 votes |
@Override public IChatComponent toChatMessage() { IChatComponent root = new ChatComponentText(""); for (Map.Entry<Resident, Rank> entry : entrySet()) { if (root.getSiblings().size() > 0) { root.appendSibling(new ChatComponentFormatted("{7|, }")); } root.appendSibling(LocalManager.get("mytown.format.resident.withRank", entry.getKey(), entry.getValue())); } return root; }
Example 4
Source File: Plot.java From MyTown2 with The Unlicense | 5 votes |
@Override public IChatComponent toChatMessage() { IChatComponent root = new ChatComponentText(""); for (Plot plot : this) { if (root.getSiblings().size() > 0) { root.appendSibling(new ChatComponentFormatted("{7|, }")); } root.appendSibling(plot.toChatMessage()); } return root; }
Example 5
Source File: Flag.java From MyTown2 with The Unlicense | 5 votes |
@Override public IChatComponent toChatMessage() { IChatComponent root = new ChatComponentList(); root.appendSibling(LocalManager.get("myessentials.format.list.header", new ChatComponentFormatted("{9|FLAGS}"))); for (Flag flag : this) { root.appendSibling(flag.toChatMessage()); } return root; }
Example 6
Source File: Town.java From MyTown2 with The Unlicense | 5 votes |
@Override public IChatComponent toChatMessage() { IChatComponent root = new ChatComponentText(""); for (Town town : this) { if (root.getSiblings().size() > 0) { root.appendSibling(new ChatComponentFormatted("{7|, }")); } root.appendSibling(town.toChatMessage()); } return root; }
Example 7
Source File: Resident.java From MyTown2 with The Unlicense | 5 votes |
@Override public IChatComponent toChatMessage() { IChatComponent root = new ChatComponentText(""); for (Resident res : this) { if (root.getSiblings().size() > 0) { root.appendSibling(new ChatComponentFormatted("{7|, }")); } root.appendSibling(res.toChatMessage()); } return root; }
Example 8
Source File: TownBlock.java From MyTown2 with The Unlicense | 5 votes |
@Override public IChatComponent toChatMessage() { IChatComponent root = new ChatComponentText(""); for (TownBlock block : values()) { root.appendSibling(block.toChatMessage()); root.appendSibling(new ChatComponentText(" ")); } return root; }
Example 9
Source File: Rank.java From MyTown2 with The Unlicense | 5 votes |
@Override public IChatComponent toChatMessage() { IChatComponent root = new ChatComponentText(""); for (Rank rank : this) { if (root.getSiblings().size() > 0) { root.appendSibling(new ChatComponentFormatted("{7|, }")); } root.appendSibling(rank.toChatMessage()); } return root; }