本文整理匯總了Java中net.minecraft.util.text.TextFormatting.RESET屬性的典型用法代碼示例。如果您正苦於以下問題:Java TextFormatting.RESET屬性的具體用法?Java TextFormatting.RESET怎麽用?Java TextFormatting.RESET使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.util.text.TextFormatting
的用法示例。
在下文中一共展示了TextFormatting.RESET屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getName
public String getName() {
if(this.world.isRemote && ClientProxy.getLocalPlayer() != null && this.getWepCapability().isDisguised()) {
String username=this.getWepCapability().getDisguiseType().substring(2);
if(TF2Util.isOnSameTeam(ClientProxy.getLocalPlayer(), this)) {
return super.getName()+" ["+username+"]";
}
else {
if(this.getWepCapability().getDisguiseType().startsWith("M:")) {
return TextFormatting.RESET+I18n.format("entity."+username+".name");
}
else
return ScorePlayerTeam.formatPlayerName(Minecraft.getMinecraft().world.getScoreboard().getPlayersTeam(username), username);
}
}
else
return super.getName();
}
示例2: getObjectiveDisplaySlot
/**
* Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2, otherwise null.
*/
public static String getObjectiveDisplaySlot(int id)
{
switch (id)
{
case 0:
return "list";
case 1:
return "sidebar";
case 2:
return "belowName";
default:
if (id >= 3 && id <= 18)
{
TextFormatting textformatting = TextFormatting.fromColorIndex(id - 3);
if (textformatting != null && textformatting != TextFormatting.RESET)
{
return "sidebar.team." + textformatting.getFriendlyName();
}
}
return null;
}
}
示例3: getObjectiveDisplaySlot
/**
* Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2, otherwise null.
*/
public static String getObjectiveDisplaySlot(int id)
{
switch (id)
{
case 0:
return "list";
case 1:
return "sidebar";
case 2:
return "belowName";
default:
if (id >= 3 && id <= 18)
{
TextFormatting textformatting = TextFormatting.fromColorIndex(id - 3);
if (textformatting != null && textformatting != TextFormatting.RESET)
{
return "sidebar.team." + textformatting.getFriendlyName();
}
}
return null;
}
}
示例4: loadWorld
@SubscribeEvent
public void loadWorld(WorldEvent.Load event) {
/*if (!event.getWorld().isRemote && event.getWorld().getPerWorldStorage().getOrLoadData(TF2WorldStorage.class, TF2weapons.MOD_ID)==null){
event.getWorld().getPerWorldStorage().setData(TF2weapons.MOD_ID, new TF2WorldStorage());
dummyEnt = new EntityCreeper(null);
}*/
TF2weapons.dummyEnt = new EntityCreeper(event.getWorld());
if(!event.getWorld().getGameRules().hasRule("doTF2AI"))
event.getWorld().getGameRules().addGameRule("doTF2AI", "true", ValueType.BOOLEAN_VALUE);
if (!event.getWorld().isRemote && event.getWorld().getScoreboard().getTeam("RED") == null) {
ScorePlayerTeam teamRed = event.getWorld().getScoreboard().createTeam("RED");
ScorePlayerTeam teamBlu = event.getWorld().getScoreboard().createTeam("BLU");
teamRed.setSeeFriendlyInvisiblesEnabled(true);
teamRed.setAllowFriendlyFire(false);
teamBlu.setSeeFriendlyInvisiblesEnabled(true);
teamBlu.setAllowFriendlyFire(false);
teamRed.setPrefix(TextFormatting.RED.toString());
teamBlu.setPrefix(TextFormatting.BLUE.toString());
teamRed.setColor(TextFormatting.RED);
teamBlu.setColor(TextFormatting.BLUE);
event.getWorld().getScoreboard().broadcastTeamInfoUpdate(teamRed);
event.getWorld().getScoreboard().broadcastTeamInfoUpdate(teamBlu);
}
if (!event.getWorld().isRemote && event.getWorld().getScoreboard().getTeam("TF2Bosses") == null) {
ScorePlayerTeam teamBosses = event.getWorld().getScoreboard().createTeam("TF2Bosses");
teamBosses.setSeeFriendlyInvisiblesEnabled(true);
teamBosses.setAllowFriendlyFire(false);
teamBosses.setPrefix(TextFormatting.DARK_PURPLE.toString());
teamBosses.setColor(TextFormatting.DARK_PURPLE);
event.getWorld().getScoreboard().broadcastTeamInfoUpdate(teamBosses);
}
if (!event.getWorld().isRemote && event.getWorld().getScoreboard().getTeam("RED").getColor() == TextFormatting.RESET) {
event.getWorld().getScoreboard().getTeam("RED").setColor(TextFormatting.RED);
event.getWorld().getScoreboard().getTeam("BLU").setColor(TextFormatting.BLUE);
}
}
示例5: usage
public String usage()
{
return TextFormatting.RESET + Stream.concat(
params.get(null).usage(),
params.entrySet().stream()
.filter(e -> e.getKey() != null)
.filter(e -> e.getKey().equals(e.getValue().name))
.flatMap(e -> flags.contains(e.getKey()) ? Stream.of(keyRepresentation(e.getKey())) : e.getValue().usage()
.map(desc -> String.format("%s %s", keyRepresentation(e.getKey()), desc)))
).reduce("", NaP::join);
}
示例6: bold
public static String bold(String s) {
return TextFormatting.GOLD + s + TextFormatting.RESET + COLOR;
}
示例7: getName
private String getName(ItemStack stack)
{
return TextFormatting.RESET + new TextComponentTranslation(getUnlocalizedName() + ".name",
GlassContainer.getGlassContaining(ItemLiquidTypeset.getFromMeta(stack.getMetadata()).getType())).getUnformattedText();
}
示例8: commandEmphasized
public String commandEmphasized(String text)
{
return C_CMD + TextFormatting.UNDERLINE + text + TextFormatting.RESET + " ";
}