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


Java EntityPlayer.getTeam方法代码示例

本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.getTeam方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.getTeam方法的具体用法?Java EntityPlayer.getTeam怎么用?Java EntityPlayer.getTeam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.player.EntityPlayer的用法示例。


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

示例1: sendMessageToAllTeamMembers

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void sendMessageToAllTeamMembers(EntityPlayer player, IChatComponent message)
{
    Team team = player.getTeam();

    if (team != null)
    {
        for (String s : team.getMembershipCollection())
        {
            EntityPlayerMP entityplayermp = this.getPlayerByUsername(s);

            if (entityplayermp != null && entityplayermp != player)
            {
                entityplayermp.addChatMessage(message);
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:ServerConfigurationManager.java

示例2: sendMessageToTeamOrEvryPlayer

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void sendMessageToTeamOrEvryPlayer(EntityPlayer player, IChatComponent message)
{
    Team team = player.getTeam();

    if (team == null)
    {
        this.sendChatMsg(message);
    }
    else
    {
        for (int i = 0; i < this.playerEntityList.size(); ++i)
        {
            EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i);

            if (entityplayermp.getTeam() != team)
            {
                entityplayermp.addChatMessage(message);
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:ServerConfigurationManager.java

示例3: sendMessageToAllTeamMembers

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void sendMessageToAllTeamMembers(EntityPlayer player, ITextComponent message)
{
    Team team = player.getTeam();

    if (team != null)
    {
        for (String s : team.getMembershipCollection())
        {
            EntityPlayerMP entityplayermp = this.getPlayerByUsername(s);

            if (entityplayermp != null && entityplayermp != player)
            {
                entityplayermp.addChatMessage(message);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:PlayerList.java

示例4: sendMessageToTeamOrAllPlayers

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void sendMessageToTeamOrAllPlayers(EntityPlayer player, ITextComponent message)
{
    Team team = player.getTeam();

    if (team == null)
    {
        this.sendChatMsg(message);
    }
    else
    {
        for (int i = 0; i < this.playerEntityList.size(); ++i)
        {
            EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i);

            if (entityplayermp.getTeam() != team)
            {
                entityplayermp.addChatMessage(message);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:PlayerList.java

示例5: processInteract

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
	if (!(player.getHeldItemMainhand() != null
			&& player.getHeldItemMainhand().getItem() instanceof ItemMonsterPlacerPlus)
			&& (this.getOwner() == player || this.getAttackTarget() == null || this.friendly) && this.isEntityAlive() && !this.isTrading()
			&& !this.isChild() && !player.isSneaking()) {
		if (this.world.isRemote && player.getTeam() == null
				&& ((this.getCapability(TF2weapons.WEAPONS_CAP, null).state & 1) == 0 || this.friendly)
				&& !player.isCreative())
			ClientProxy.displayScreenConfirm("Choose a team to interact",
					"Visit the Mann Co. Store located in a village");
		if (!this.world.isRemote && (TF2Util.isOnSameTeam(this, player) || player.isCreative())
				&& (this.tradeOffers == null || !this.tradeOffers.isEmpty())) {
			this.setCustomer(player);
			FMLNetworkHandler.openGui(player, TF2weapons.instance, 4, world, this.getEntityId(), 0, 0);
		}

		player.addStat(StatList.TALKED_TO_VILLAGER);
		return true;
	} else
		return super.processInteract(player, hand);
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:23,代码来源:EntityTF2Character.java

示例6: processInteract

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
	if (!(player.getHeldItemMainhand() != null
			&& player.getHeldItemMainhand().getItem() instanceof ItemMonsterPlacerPlus)
			&& this.getAttackTarget() == null && this.isEntityAlive() && !this.isTrading() && !this.isChild()
			&& !player.isSneaking()) {
		if (this.world.isRemote && player.getTeam() == null && !player.isCreative())
			ClientProxy.displayScreenJoinTeam();
		else if (!this.world.isRemote && (player.getTeam() != null || player.isCreative())
				&& (this.tradeOffers == null || !this.tradeOffers.isEmpty())) {
			this.setCustomer(player);
			player.displayVillagerTradeGui(this);
		}

		player.addStat(StatList.TALKED_TO_VILLAGER);
		return true;
	} else
		return super.processInteract(player, hand);
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:20,代码来源:EntitySaxtonHale.java

示例7: isInvisibleToPlayer

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
 * Only used by renderer in EntityLivingBase subclasses.
 * Determines if an entity is visible or not to a specfic player, if the entity is normally invisible.
 * For EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent.
 */
public boolean isInvisibleToPlayer(EntityPlayer player)
{
    if (player.isSpectator())
    {
        return false;
    }
    else
    {
        Team team = this.getTeam();
        return team != null && player != null && player.getTeam() == team && team.getSeeFriendlyInvisiblesEnabled() ? false : this.isInvisible();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:Entity.java

示例8: getReplacement

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public static ItemStack getReplacement(EntityPlayer player, ItemStack stack) {
	if (!stack.isEmpty() && stack.getItem() instanceof ItemBuildingBox
			&& player.getTeam() == player.world.getScoreboard().getTeam("BLU"))
		stack.setItemDamage(stack.getItemDamage() + 1);
	if (!stack.isEmpty() && stack.getItem() instanceof ItemBanner){
		NBTTagCompound pattern=new NBTTagCompound();
		if(player.getTeam() == player.world.getScoreboard().getTeam("BLU")){
			stack.setItemDamage(EnumDyeColor.BLUE.getDyeDamage());
			pattern.setString("Pattern", "bb");
			pattern.setInteger("Color", 15);
		}
		else{
			pattern.setString("Pattern", "rb");
			pattern.setInteger("Color", 15);
		}
		
		stack.getSubCompound("BlockEntityTag").getTagList("Patterns", 10).appendTag(pattern);
	}
	if (!stack.isEmpty() && stack.getItem() instanceof ItemBuildingBox && stack.getItemDamage()/2 == 11) {
		ItemStack wrench=TF2Util.getFirstItem(player.inventory, stackL ->{
			return TF2Attribute.getModifier("Teleporter Cost", stackL, 1, player) != 1;
		});
		if(!wrench.isEmpty()) {
			stack.setCount((int) TF2Attribute.getModifier("Teleporter Cost", wrench, 1, player));
		}
	}
	return stack;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:29,代码来源:ContainerTF2Workbench.java

示例9: isInvisibleToPlayer

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
 * Only used by renderer in EntityLivingBase subclasses.
 * Determines if an entity is visible or not to a specfic player, if the entity is normally invisible.
 * For EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent.
 */
@SideOnly(Side.CLIENT)
public boolean isInvisibleToPlayer(EntityPlayer player)
{
    if (player.isSpectator())
    {
        return false;
    }
    else
    {
        Team team = this.getTeam();
        return team != null && player != null && player.getTeam() == team && team.getSeeFriendlyInvisiblesEnabled() ? false : this.isInvisible();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:Entity.java

示例10: onPlayerDeath

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerDeath(LivingDeathEvent event) {
	if (event.getEntityLiving() instanceof EntityPlayerMP) {
		EntityPlayer player = (EntityPlayer) event.getEntityLiving();

		// If the player fell into the void, there's no rescuing
		if (event.getSource() == DamageSource.OUT_OF_WORLD) {
			player.getEntityData().setBoolean(IGNORE_REVIVAL_DEATH, true);
			NetworkHandler.instance.sendTo(new MessageDie(), (EntityPlayerMP) player);
			return;
		}

		// If IGNORE_REVIVAL_DEATH is set, this should be treated as a normal death
		if (event.getSource() == HardcoreRevival.notRescuedInTime || player.getEntityData().getBoolean(IGNORE_REVIVAL_DEATH)) {
			return;
		}

		// Fire event for compatibility addons
		MinecraftForge.EVENT_BUS.post(new PlayerKnockedOutEvent(player, event.getSource()));

		// Dead players glow
		if (ModConfig.glowOnDeath) {
			player.setGlowing(true);
		}

		// Cancel event - we're taking over from here
		event.setCanceled(true);

		// If enabled, show a death message
		if (player.world.getGameRules().getBoolean("showDeathMessages")) {
			MinecraftServer server = player.world.getMinecraftServer();
			if (server != null) {
				Team team = player.getTeam();
				if (team != null && team.getDeathMessageVisibility() != Team.EnumVisible.ALWAYS) {
					if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OTHER_TEAMS) {
						server.getPlayerList().sendMessageToAllTeamMembers(player, player.getCombatTracker().getDeathMessage());
					} else if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OWN_TEAM) {
						server.getPlayerList().sendMessageToTeamOrAllPlayers(player, player.getCombatTracker().getDeathMessage());
					}
				} else {
					server.getPlayerList().sendMessage(player.getCombatTracker().getDeathMessage());
				}
			}
		}
	}
}
 
开发者ID:blay09,项目名称:HardcoreRevival,代码行数:47,代码来源:DeathHandler.java


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