本文整理汇总了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));
}
}
}
}
示例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));
}
}
示例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));
}
}
}
}
示例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));
}
}
}
}
示例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;
}