當前位置: 首頁>>代碼示例>>Java>>正文


Java TextFormatting.RESET屬性代碼示例

本文整理匯總了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();
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:18,代碼來源:EntitySpy.java

示例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;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:28,代碼來源:Scoreboard.java

示例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;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:30,代碼來源:Scoreboard.java

示例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);
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:38,代碼來源:TF2EventsCommon.java

示例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);
}
 
開發者ID:Ivorforce,項目名稱:MCOpts,代碼行數:11,代碼來源:Expect.java

示例6: bold

public static String bold(String s) {
    return TextFormatting.GOLD + s + TextFormatting.RESET + COLOR;
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:3,代碼來源:PageText.java

示例7: getName

private String getName(ItemStack stack)
{
	return TextFormatting.RESET + new TextComponentTranslation(getUnlocalizedName() + ".name", 
			GlassContainer.getGlassContaining(ItemLiquidTypeset.getFromMeta(stack.getMetadata()).getType())).getUnformattedText();
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:5,代碼來源:ItemLiquid.java

示例8: commandEmphasized

public String commandEmphasized(String text)
{
    return C_CMD + TextFormatting.UNDERLINE + text + TextFormatting.RESET + " ";
}
 
開發者ID:abused,項目名稱:World-Border,代碼行數:4,代碼來源:WBCmd.java


注:本文中的net.minecraft.util.text.TextFormatting.RESET屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。