Java 类net.minecraft.network.play.server.SPacketDestroyEntities 实例源码

项目:Zombe-Modpack    文件:EntityPlayerMP.java   
/**
 * Sends a packet to the player to remove an entity.
 */
public void removeEntity(Entity entityIn)
{
    if (entityIn instanceof EntityPlayer)
    {
        this.connection.sendPacket(new SPacketDestroyEntities(new int[] {entityIn.getEntityId()}));
    }
    else
    {
        this.entityRemoveQueue.add(Integer.valueOf(entityIn.getEntityId()));
    }
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no
 * longer registered as required to monitor them. The latter  happens when distance between the player and item
 * increases beyond a certain treshold (typically the viewing distance)
 */
public void handleDestroyEntities(SPacketDestroyEntities packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    for (int i = 0; i < packetIn.getEntityIDs().length; ++i)
    {
        this.clientWorldController.removeEntityFromWorld(packetIn.getEntityIDs()[i]);
    }
}
项目:Backmemed    文件:EntityPlayerMP.java   
/**
 * Sends a packet to the player to remove an entity.
 */
public void removeEntity(Entity entityIn)
{
    if (entityIn instanceof EntityPlayer)
    {
        this.connection.sendPacket(new SPacketDestroyEntities(new int[] {entityIn.getEntityId()}));
    }
    else
    {
        this.entityRemoveQueue.add(Integer.valueOf(entityIn.getEntityId()));
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no
 * longer registered as required to monitor them. The latter  happens when distance between the player and item
 * increases beyond a certain treshold (typically the viewing distance)
 */
public void handleDestroyEntities(SPacketDestroyEntities packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    for (int i = 0; i < packetIn.getEntityIDs().length; ++i)
    {
        this.clientWorldController.removeEntityFromWorld(packetIn.getEntityIDs()[i]);
    }
}
项目:CustomWorldGen    文件:EntityPlayerMP.java   
/**
 * Sends a packet to the player to remove an entity.
 */
public void removeEntity(Entity entityIn)
{
    if (entityIn instanceof EntityPlayer)
    {
        this.connection.sendPacket(new SPacketDestroyEntities(new int[] {entityIn.getEntityId()}));
    }
    else
    {
        this.entityRemoveQueue.add(Integer.valueOf(entityIn.getEntityId()));
    }
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no
 * longer registered as required to monitor them. The latter  happens when distance between the player and item
 * increases beyond a certain treshold (typically the viewing distance)
 */
public void handleDestroyEntities(SPacketDestroyEntities packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    for (int i = 0; i < packetIn.getEntityIDs().length; ++i)
    {
        this.clientWorldController.removeEntityFromWorld(packetIn.getEntityIDs()[i]);
    }
}
项目:ExpandedRailsMod    文件:EntityPlayerMP.java   
/**
 * Sends a packet to the player to remove an entity.
 */
public void removeEntity(Entity entityIn)
{
    if (entityIn instanceof EntityPlayer)
    {
        this.connection.sendPacket(new SPacketDestroyEntities(new int[] {entityIn.getEntityId()}));
    }
    else
    {
        this.entityRemoveQueue.add(Integer.valueOf(entityIn.getEntityId()));
    }
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no
 * longer registered as required to monitor them. The latter  happens when distance between the player and item
 * increases beyond a certain treshold (typically the viewing distance)
 */
public void handleDestroyEntities(SPacketDestroyEntities packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    for (int i = 0; i < packetIn.getEntityIDs().length; ++i)
    {
        this.clientWorldController.removeEntityFromWorld(packetIn.getEntityIDs()[i]);
    }
}
项目:Zombe-Modpack    文件:EntityPlayerMP.java   
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.interactionManager.updateBlockRemoving();
    --this.respawnInvulnerabilityTicks;

    if (this.hurtResistantTime > 0)
    {
        --this.hurtResistantTime;
    }

    this.openContainer.detectAndSendChanges();

    if (!this.world.isRemote && !this.openContainer.canInteractWith(this))
    {
        this.closeScreen();
        this.openContainer = this.inventoryContainer;
    }

    while (!this.entityRemoveQueue.isEmpty())
    {
        int i = Math.min(this.entityRemoveQueue.size(), Integer.MAX_VALUE);
        int[] aint = new int[i];
        Iterator<Integer> iterator = this.entityRemoveQueue.iterator();
        int j = 0;

        while (iterator.hasNext() && j < i)
        {
            aint[j++] = ((Integer)iterator.next()).intValue();
            iterator.remove();
        }

        this.connection.sendPacket(new SPacketDestroyEntities(aint));
    }

    Entity entity = this.getSpectatingEntity();

    if (entity != this)
    {
        if (entity.isEntityAlive())
        {
            this.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
            this.mcServer.getPlayerList().serverUpdateMovingPlayer(this);

            if (this.isSneaking())
            {
                this.setSpectatingEntity(this);
            }
        }
        else
        {
            this.setSpectatingEntity(this);
        }
    }
}
项目:Backmemed    文件:EntityPlayerMP.java   
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.interactionManager.updateBlockRemoving();
    --this.respawnInvulnerabilityTicks;

    if (this.hurtResistantTime > 0)
    {
        --this.hurtResistantTime;
    }

    this.openContainer.detectAndSendChanges();

    if (!this.world.isRemote && !this.openContainer.canInteractWith(this))
    {
        this.closeScreen();
        this.openContainer = this.inventoryContainer;
    }

    while (!this.entityRemoveQueue.isEmpty())
    {
        int i = Math.min(this.entityRemoveQueue.size(), Integer.MAX_VALUE);
        int[] aint = new int[i];
        Iterator<Integer> iterator = this.entityRemoveQueue.iterator();
        int j = 0;

        while (iterator.hasNext() && j < i)
        {
            aint[j++] = ((Integer)iterator.next()).intValue();
            iterator.remove();
        }

        this.connection.sendPacket(new SPacketDestroyEntities(aint));
    }

    Entity entity = this.getSpectatingEntity();

    if (entity != this)
    {
        if (entity.isEntityAlive())
        {
            this.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
            this.mcServer.getPlayerList().serverUpdateMovingPlayer(this);

            if (this.isSneaking())
            {
                this.setSpectatingEntity(this);
            }
        }
        else
        {
            this.setSpectatingEntity(this);
        }
    }
}
项目:CustomWorldGen    文件:EntityPlayerMP.java   
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.interactionManager.updateBlockRemoving();
    --this.respawnInvulnerabilityTicks;

    if (this.hurtResistantTime > 0)
    {
        --this.hurtResistantTime;
    }

    this.openContainer.detectAndSendChanges();

    if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this))
    {
        this.closeScreen();
        this.openContainer = this.inventoryContainer;
    }

    while (!this.entityRemoveQueue.isEmpty())
    {
        int i = Math.min(this.entityRemoveQueue.size(), Integer.MAX_VALUE);
        int[] aint = new int[i];
        Iterator<Integer> iterator = this.entityRemoveQueue.iterator();
        int j = 0;

        while (iterator.hasNext() && j < i)
        {
            aint[j++] = ((Integer)iterator.next()).intValue();
            iterator.remove();
        }

        this.connection.sendPacket(new SPacketDestroyEntities(aint));
    }

    Entity entity = this.getSpectatingEntity();

    if (entity != this)
    {
        if (entity.isEntityAlive())
        {
            this.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
            this.mcServer.getPlayerList().serverUpdateMountedMovingPlayer(this);

            if (this.isSneaking())
            {
                this.setSpectatingEntity(this);
            }
        }
        else
        {
            this.setSpectatingEntity(this);
        }
    }
}
项目:ExpandedRailsMod    文件:EntityPlayerMP.java   
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.interactionManager.updateBlockRemoving();
    --this.respawnInvulnerabilityTicks;

    if (this.hurtResistantTime > 0)
    {
        --this.hurtResistantTime;
    }

    this.openContainer.detectAndSendChanges();

    if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this))
    {
        this.closeScreen();
        this.openContainer = this.inventoryContainer;
    }

    while (!this.entityRemoveQueue.isEmpty())
    {
        int i = Math.min(this.entityRemoveQueue.size(), Integer.MAX_VALUE);
        int[] aint = new int[i];
        Iterator<Integer> iterator = this.entityRemoveQueue.iterator();
        int j = 0;

        while (iterator.hasNext() && j < i)
        {
            aint[j++] = ((Integer)iterator.next()).intValue();
            iterator.remove();
        }

        this.connection.sendPacket(new SPacketDestroyEntities(aint));
    }

    Entity entity = this.getSpectatingEntity();

    if (entity != this)
    {
        if (entity.isEntityAlive())
        {
            this.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
            this.mcServer.getPlayerList().serverUpdateMountedMovingPlayer(this);

            if (this.isSneaking())
            {
                this.setSpectatingEntity(this);
            }
        }
        else
        {
            this.setSpectatingEntity(this);
        }
    }
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
/**
 * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no
 * longer registered as required to monitor them. The latter  happens when distance between the player and item
 * increases beyond a certain treshold (typically the viewing distance)
 */
void handleDestroyEntities(SPacketDestroyEntities packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
/**
 * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no
 * longer registered as required to monitor them. The latter  happens when distance between the player and item
 * increases beyond a certain treshold (typically the viewing distance)
 */
void handleDestroyEntities(SPacketDestroyEntities packetIn);