本文整理匯總了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;
}