當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。