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


Java EntityPlayerMP.getEntityId方法代码示例

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


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

示例1: sendBlockBreakProgress

import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
{
    for (EntityPlayerMP entityplayermp : this.mcServer.getConfigurationManager().func_181057_v())
    {
        if (entityplayermp != null && entityplayermp.worldObj == this.theWorldServer && entityplayermp.getEntityId() != breakerId)
        {
            double d0 = (double)pos.getX() - entityplayermp.posX;
            double d1 = (double)pos.getY() - entityplayermp.posY;
            double d2 = (double)pos.getZ() - entityplayermp.posZ;

            if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D)
            {
                entityplayermp.playerNetServerHandler.sendPacket(new S25PacketBlockBreakAnim(breakerId, pos, progress));
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:WorldManager.java

示例2: sendBlockBreakProgress

import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
@Override
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) {
	EntityPlayerMP player = null;
	for (EntityPlayerMP entityplayermp : this.mcServer.getPlayerList().getPlayers()) {
		if (entityplayermp != null && entityplayermp.getEntityId() == breakerId) {
			player = entityplayermp;
		}
	}
	if (player == null) {
		return;
	}
	if (player.getHeldItemMainhand().getItem() == ModItems.hammer) {
		RayTraceResult rt = ModItems.hammer.rayTraceBlocks(world, player);
		List<BlockPos> positions = ModItems.hammer.getExtraBlocks(world, rt, player);

        PacketHandler.INSTANCE.sendToAllAround(new MessageExtraBlockBreak(player.getEntityId(), positions.toArray(new BlockPos[positions.size()]), progress - 1), new TargetPoint(player.dimension, player.posX, player.posY, player.posZ, 32D));
	}
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:19,代码来源:WorldListener.java

示例3: sendBlockBreakProgress

import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
{
    for (EntityPlayerMP entityplayermp : this.mcServer.getPlayerList().getPlayerList())
    {
        if (entityplayermp != null && entityplayermp.world == this.theWorldServer && entityplayermp.getEntityId() != breakerId)
        {
            double d0 = (double)pos.getX() - entityplayermp.posX;
            double d1 = (double)pos.getY() - entityplayermp.posY;
            double d2 = (double)pos.getZ() - entityplayermp.posZ;

            if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D)
            {
                entityplayermp.connection.sendPacket(new SPacketBlockBreakAnim(breakerId, pos, progress));
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:ServerWorldEventHandler.java

示例4: sendBlockBreakProgress

import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
{
    for (EntityPlayerMP entityplayermp : this.mcServer.getPlayerList().getPlayerList())
    {
        if (entityplayermp != null && entityplayermp.worldObj == this.theWorldServer && entityplayermp.getEntityId() != breakerId)
        {
            double d0 = (double)pos.getX() - entityplayermp.posX;
            double d1 = (double)pos.getY() - entityplayermp.posY;
            double d2 = (double)pos.getZ() - entityplayermp.posZ;

            if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D)
            {
                entityplayermp.connection.sendPacket(new SPacketBlockBreakAnim(breakerId, pos, progress));
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:ServerWorldEventHandler.java

示例5: isPlayerLeader_2

import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
private static boolean isPlayerLeader_2(int worldID, int entityID)
{
	//List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
	//List players = MinecraftServer.getServer().getPlayerList();
	World world = DimensionManager.getWorld(worldID);

	if (world == null) { return false; }	// Don't know where you are.

	List players = world.playerEntities;

	if (players.isEmpty()) { return false; }	// No players? Who called this? D:

	Iterator<EntityPlayerMP> it = players.iterator();
	EntityPlayerMP player;

	while (it.hasNext())
	{
		player = it.next();

		if (player.getEntityId() == entityID)
		{
			// Found 'em!
			if (TerritoryHandler.getFactionPlayerIsLeaderOf(player) == null)
			{
				return false;
			}
			else
			{
				return true;
			}
		}
		// else, not the one I'm looking for
	}

	return false;
}
 
开发者ID:Domochevsky,项目名称:minecraft-territorialdealings,代码行数:37,代码来源:ServerHelper.java


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