当前位置: 首页>>代码示例>>Java>>正文


Java ScorePlayerTeam类代码示例

本文整理汇总了Java中net.minecraft.scoreboard.ScorePlayerTeam的典型用法代码示例。如果您正苦于以下问题:Java ScorePlayerTeam类的具体用法?Java ScorePlayerTeam怎么用?Java ScorePlayerTeam使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ScorePlayerTeam类属于net.minecraft.scoreboard包,在下文中一共展示了ScorePlayerTeam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: S3EPacketTeams

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
public S3EPacketTeams(ScorePlayerTeam p_i45225_1_, int p_i45225_2_)
{
    this.field_179816_e = Team.EnumVisible.ALWAYS.field_178830_e;
    this.field_179815_f = -1;
    this.field_149317_e = Lists.<String>newArrayList();
    this.field_149320_a = p_i45225_1_.getRegisteredName();
    this.field_149314_f = p_i45225_2_;

    if (p_i45225_2_ == 0 || p_i45225_2_ == 2)
    {
        this.field_149318_b = p_i45225_1_.getTeamName();
        this.field_149319_c = p_i45225_1_.getColorPrefix();
        this.field_149316_d = p_i45225_1_.getColorSuffix();
        this.field_149315_g = p_i45225_1_.func_98299_i();
        this.field_179816_e = p_i45225_1_.getNameTagVisibility().field_178830_e;
        this.field_179815_f = p_i45225_1_.getChatFormat().getColorIndex();
    }

    if (p_i45225_2_ == 0)
    {
        this.field_149317_e.addAll(p_i45225_1_.getMembershipCollection());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:S3EPacketTeams.java

示例2: sendScoreboard

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
protected void sendScoreboard(ServerScoreboard scoreboardIn, EntityPlayerMP playerIn)
{
    Set<ScoreObjective> set = Sets.<ScoreObjective>newHashSet();

    for (ScorePlayerTeam scoreplayerteam : scoreboardIn.getTeams())
    {
        playerIn.playerNetServerHandler.sendPacket(new S3EPacketTeams(scoreplayerteam, 0));
    }

    for (int i = 0; i < 19; ++i)
    {
        ScoreObjective scoreobjective = scoreboardIn.getObjectiveInDisplaySlot(i);

        if (scoreobjective != null && !set.contains(scoreobjective))
        {
            for (Packet packet : scoreboardIn.func_96550_d(scoreobjective))
            {
                playerIn.playerNetServerHandler.sendPacket(packet);
            }

            set.add(scoreobjective);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:ServerConfigurationManager.java

示例3: emptyTeam

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
protected void emptyTeam(ICommandSender p_147188_1_, String[] p_147188_2_, int p_147188_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    ScorePlayerTeam scoreplayerteam = this.getTeam(p_147188_2_[p_147188_3_]);

    if (scoreplayerteam != null)
    {
        Collection<String> collection = Lists.newArrayList(scoreplayerteam.getMembershipCollection());
        p_147188_1_.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, collection.size());

        if (collection.isEmpty())
        {
            throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[] {scoreplayerteam.getRegisteredName()});
        }
        else
        {
            for (String s : collection)
            {
                scoreboard.removePlayerFromTeam(s, scoreplayerteam);
            }

            notifyOperators(p_147188_1_, this, "commands.scoreboard.teams.empty.success", new Object[] {Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName()});
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:CommandScoreboard.java

示例4: TeamSelectionObject

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
public TeamSelectionObject(ScorePlayerTeam p_i45492_2_)
{
    this.field_178676_b = p_i45492_2_;
    this.field_178675_d = Lists.<NetworkPlayerInfo>newArrayList();

    for (String s : p_i45492_2_.getMembershipCollection())
    {
        NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(s);

        if (networkplayerinfo != null)
        {
            this.field_178675_d.add(networkplayerinfo);
        }
    }

    if (!this.field_178675_d.isEmpty())
    {
        String s1 = ((NetworkPlayerInfo)this.field_178675_d.get((new Random()).nextInt(this.field_178675_d.size()))).getGameProfile().getName();
        this.field_178677_c = AbstractClientPlayer.getLocationSkin(s1);
        AbstractClientPlayer.getDownloadImageSkin(this.field_178677_c, s1);
    }
    else
    {
        this.field_178677_c = DefaultPlayerSkin.getDefaultSkinLegacy();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:TeleportToTeam.java

示例5: emptyTeam

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
protected void emptyTeam(ICommandSender sender, String[] p_184917_2_, int p_184917_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);
    ScorePlayerTeam scoreplayerteam = this.convertToTeam(p_184917_2_[p_184917_3_], server);

    if (scoreplayerteam != null)
    {
        Collection<String> collection = Lists.newArrayList(scoreplayerteam.getMembershipCollection());
        sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, collection.size());

        if (collection.isEmpty())
        {
            throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[] {scoreplayerteam.getRegisteredName()});
        }
        else
        {
            for (String s : collection)
            {
                scoreboard.removePlayerFromTeam(s, scoreplayerteam);
            }

            notifyCommandListener(sender, this, "commands.scoreboard.teams.empty.success", new Object[] {Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName()});
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:CommandScoreboard.java

示例6: SPacketTeams

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
public SPacketTeams(ScorePlayerTeam teamIn, int actionIn)
{
    this.nameTagVisibility = Team.EnumVisible.ALWAYS.internalName;
    this.collisionRule = Team.CollisionRule.ALWAYS.name;
    this.color = -1;
    this.players = Lists.<String>newArrayList();
    this.name = teamIn.getRegisteredName();
    this.action = actionIn;

    if (actionIn == 0 || actionIn == 2)
    {
        this.displayName = teamIn.getTeamName();
        this.prefix = teamIn.getColorPrefix();
        this.suffix = teamIn.getColorSuffix();
        this.friendlyFlags = teamIn.getFriendlyFlags();
        this.nameTagVisibility = teamIn.getNameTagVisibility().internalName;
        this.collisionRule = teamIn.getCollisionRule().name;
        this.color = teamIn.getChatFormat().getColorIndex();
    }

    if (actionIn == 0)
    {
        this.players.addAll(teamIn.getMembershipCollection());
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:SPacketTeams.java

示例7: getTeamColor

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
protected int getTeamColor(T entityIn)
{
    int i = 16777215;
    ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)entityIn.getTeam();

    if (scoreplayerteam != null)
    {
        String s = FontRenderer.getFormatFromString(scoreplayerteam.getColorPrefix());

        if (s.length() >= 2)
        {
            i = this.getFontRendererFromRenderManager().getColorCode(s.charAt(1));
        }
    }

    return i;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:Render.java

示例8: TeamSelectionObject

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
public TeamSelectionObject(ScorePlayerTeam p_i45492_2_)
{
    this.team = p_i45492_2_;
    this.players = Lists.<NetworkPlayerInfo>newArrayList();

    for (String s : p_i45492_2_.getMembershipCollection())
    {
        NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getConnection().getPlayerInfo(s);

        if (networkplayerinfo != null)
        {
            this.players.add(networkplayerinfo);
        }
    }

    if (this.players.isEmpty())
    {
        this.location = DefaultPlayerSkin.getDefaultSkinLegacy();
    }
    else
    {
        String s1 = ((NetworkPlayerInfo)this.players.get((new Random()).nextInt(this.players.size()))).getGameProfile().getName();
        this.location = AbstractClientPlayer.getLocationSkin(s1);
        AbstractClientPlayer.getDownloadImageSkin(this.location, s1);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:TeleportToTeam.java

示例9: sendScoreboard

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
protected void sendScoreboard(ServerScoreboard scoreboardIn, EntityPlayerMP playerIn)
{
    Set<ScoreObjective> set = Sets.<ScoreObjective>newHashSet();

    for (ScorePlayerTeam scoreplayerteam : scoreboardIn.getTeams())
    {
        playerIn.connection.sendPacket(new SPacketTeams(scoreplayerteam, 0));
    }

    for (int i = 0; i < 19; ++i)
    {
        ScoreObjective scoreobjective = scoreboardIn.getObjectiveInDisplaySlot(i);

        if (scoreobjective != null && !set.contains(scoreobjective))
        {
            for (Packet<?> packet : scoreboardIn.getCreatePackets(scoreobjective))
            {
                playerIn.connection.sendPacket(packet);
            }

            set.add(scoreobjective);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:PlayerList.java

示例10: playerName

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
@SubscribeEvent
public void playerName(PlayerEvent.NameFormat event) {
	if(Minecraft.getMinecraft().player != null && WeaponsCapability.get(event.getEntityPlayer()).isDisguised()) {
		String username=WeaponsCapability.get(event.getEntityPlayer()).getDisguiseType().substring(2);
		
		if(TF2Util.isOnSameTeam(Minecraft.getMinecraft().player, event.getEntityPlayer())) {
			event.setDisplayname(event.getDisplayname()+" ["+username+"]");
		}
		else {
			if(WeaponsCapability.get(event.getEntityPlayer()).getDisguiseType().startsWith("M:")) {
				if(event.getEntityPlayer().getCapability(TF2weapons.WEAPONS_CAP, null).entityDisguise != null){
					event.setDisplayname(TextFormatting.RESET+event.getEntityPlayer().getCapability(TF2weapons.WEAPONS_CAP, null).entityDisguise.getDisplayName().getFormattedText());
				}
				else
					event.setDisplayname(TextFormatting.RESET+I18n.format("entity."+username+".name"));
				
			}
			else
				event.setDisplayname(ScorePlayerTeam.formatPlayerName(Minecraft.getMinecraft().world.getScoreboard().getPlayersTeam(username), username));
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:23,代码来源:TF2EventsClient.java

示例11: getName

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
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,代码行数:19,代码来源:EntitySpy.java

示例12: func_175137_e

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
private Collection<ScoreObjective> func_175137_e(Entity p_175137_1_)
{
    ScorePlayerTeam scoreplayerteam = this.getWorldScoreboard().getPlayersTeam(this.getName());

    if (scoreplayerteam != null)
    {
        int i = scoreplayerteam.getChatFormat().getColorIndex();

        if (i >= 0 && i < IScoreObjectiveCriteria.field_178793_i.length)
        {
            for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178793_i[i]))
            {
                Score score = this.getWorldScoreboard().getValueFromObjective(p_175137_1_.getName(), scoreobjective);
                score.func_96648_a();
            }
        }
    }

    ScorePlayerTeam scoreplayerteam1 = this.getWorldScoreboard().getPlayersTeam(p_175137_1_.getName());

    if (scoreplayerteam1 != null)
    {
        int j = scoreplayerteam1.getChatFormat().getColorIndex();

        if (j >= 0 && j < IScoreObjectiveCriteria.field_178792_h.length)
        {
            return this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178792_h[j]);
        }
    }

    return Lists.<ScoreObjective>newArrayList();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:EntityPlayer.java

示例13: getDisplayName

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
/**
 * Get the formatted ChatComponent that will be used for the sender's username in chat
 */
public IChatComponent getDisplayName()
{
    IChatComponent ichatcomponent = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getName()));
    ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getName() + " "));
    ichatcomponent.getChatStyle().setChatHoverEvent(this.getHoverEvent());
    ichatcomponent.getChatStyle().setInsertion(this.getName());
    return ichatcomponent;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:EntityPlayer.java

示例14: getTeam

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
protected ScorePlayerTeam getTeam(String name) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    ScorePlayerTeam scoreplayerteam = scoreboard.getTeam(name);

    if (scoreplayerteam == null)
    {
        throw new CommandException("commands.scoreboard.teamNotFound", new Object[] {name});
    }
    else
    {
        return scoreplayerteam;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:CommandScoreboard.java

示例15: removeTeam

import net.minecraft.scoreboard.ScorePlayerTeam; //导入依赖的package包/类
protected void removeTeam(ICommandSender p_147194_1_, String[] p_147194_2_, int p_147194_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    ScorePlayerTeam scoreplayerteam = this.getTeam(p_147194_2_[p_147194_3_]);

    if (scoreplayerteam != null)
    {
        scoreboard.removeTeam(scoreplayerteam);
        notifyOperators(p_147194_1_, this, "commands.scoreboard.teams.remove.success", new Object[] {scoreplayerteam.getRegisteredName()});
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:CommandScoreboard.java


注:本文中的net.minecraft.scoreboard.ScorePlayerTeam类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。