Java 类net.minecraft.network.play.client.C02PacketUseEntity 实例源码

项目:BaseClient    文件:Aura.java   
private void attack(final EntityLivingBase ent, final boolean crit) {
    this.swingItem();
    if (crit) {
        this.crit();
    }
    else {
        this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer());
    }
    final float sharpLevel = EnchantmentHelper.func_152377_a(this.mc.thePlayer.getHeldItem(), ent.getCreatureAttribute());
    final boolean vanillaCrit = this.mc.thePlayer.fallDistance > 0.0f && !this.mc.thePlayer.onGround && !this.mc.thePlayer.isOnLadder() && !this.mc.thePlayer.isInWater() && !this.mc.thePlayer.isPotionActive(Potion.blindness) && this.mc.thePlayer.ridingEntity == null;
    this.mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(ent, C02PacketUseEntity.Action.ATTACK));
    if (crit || vanillaCrit) {
        this.mc.thePlayer.onCriticalHit(ent);
    }
    if (sharpLevel > 0.0f) {
        this.mc.thePlayer.onEnchantmentCritical(ent);
    }
}
项目:DecompiledMinecraft    文件:PlayerControllerMP.java   
/**
 * Attacks an entity
 */
public void attackEntity(EntityPlayer playerIn, Entity targetEntity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK));

    if (this.currentGameType != WorldSettings.GameType.SPECTATOR)
    {
        playerIn.attackTargetEntityWithCurrentItem(targetEntity);
    }
}
项目:DecompiledMinecraft    文件:PlayerControllerMP.java   
/**
 * Send packet to server - player is interacting with another entity (left click)
 */
public boolean interactWithEntitySendPacket(EntityPlayer playerIn, Entity targetEntity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.INTERACT));
    return this.currentGameType != WorldSettings.GameType.SPECTATOR && playerIn.interactWith(targetEntity);
}
项目:DecompiledMinecraft    文件:PlayerControllerMP.java   
public boolean func_178894_a(EntityPlayer p_178894_1_, Entity p_178894_2_, MovingObjectPosition p_178894_3_)
{
    this.syncCurrentPlayItem();
    Vec3 vec3 = new Vec3(p_178894_3_.hitVec.xCoord - p_178894_2_.posX, p_178894_3_.hitVec.yCoord - p_178894_2_.posY, p_178894_3_.hitVec.zCoord - p_178894_2_.posZ);
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_178894_2_, vec3));
    return this.currentGameType != WorldSettings.GameType.SPECTATOR && p_178894_2_.interactAt(p_178894_1_, vec3);
}
项目:BaseClient    文件:TriggerBot.java   
@EventTarget
private void onPostUpdate(UpdateEvent event) {
    if (event.state == Event.State.POST && (autoclicker && Mouse.isButtonDown((int)0) || !autoclicker) && this.mc.objectMouseOver != null && this.mc.objectMouseOver.entityHit != null && this.attackChecks(this.mc.objectMouseOver.entityHit) && this.timer.delay((float)(1000.0 / this.speed))) {
        if (this.criticals) {
            this.crit();
        }
        this.mc.thePlayer.swingItem();
        this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C02PacketUseEntity(this.mc.objectMouseOver.entityHit, C02PacketUseEntity.Action.ATTACK));
        this.timer.reset();
    }
}
项目:BaseClient    文件:Blink.java   
@EventTarget
private void onPacketSend(PacketSendEvent event) {
    if (event.packet instanceof C0BPacketEntityAction || event.packet instanceof C03PacketPlayer || event.packet instanceof C02PacketUseEntity || event.packet instanceof C0APacketAnimation || event.packet instanceof C08PacketPlayerBlockPlacement) {
        this.packetList.add(event.packet);
        event.setCancelled(true);
    }
}
项目:BaseClient    文件:PlayerControllerMP.java   
/**
 * Attacks an entity
 */
public void attackEntity(EntityPlayer playerIn, Entity targetEntity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK));

    if (this.currentGameType != WorldSettings.GameType.SPECTATOR)
    {
        playerIn.attackTargetEntityWithCurrentItem(targetEntity);
    }
}
项目:BaseClient    文件:PlayerControllerMP.java   
/**
 * Send packet to server - player is interacting with another entity (left click)
 */
public boolean interactWithEntitySendPacket(EntityPlayer playerIn, Entity targetEntity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.INTERACT));
    return this.currentGameType != WorldSettings.GameType.SPECTATOR && playerIn.interactWith(targetEntity);
}
项目:BaseClient    文件:PlayerControllerMP.java   
public boolean func_178894_a(EntityPlayer p_178894_1_, Entity p_178894_2_, MovingObjectPosition p_178894_3_)
{
    this.syncCurrentPlayItem();
    Vec3 vec3 = new Vec3(p_178894_3_.hitVec.xCoord - p_178894_2_.posX, p_178894_3_.hitVec.yCoord - p_178894_2_.posY, p_178894_3_.hitVec.zCoord - p_178894_2_.posZ);
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_178894_2_, vec3));
    return this.currentGameType != WorldSettings.GameType.SPECTATOR && p_178894_2_.interactAt(p_178894_1_, vec3);
}
项目:BaseClient    文件:PlayerControllerMP.java   
/**
 * Attacks an entity
 */
public void attackEntity(EntityPlayer playerIn, Entity targetEntity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK));

    if (this.currentGameType != WorldSettings.GameType.SPECTATOR)
    {
        playerIn.attackTargetEntityWithCurrentItem(targetEntity);
    }
}
项目:BaseClient    文件:PlayerControllerMP.java   
/**
 * Send packet to server - player is interacting with another entity (left click)
 */
public boolean interactWithEntitySendPacket(EntityPlayer playerIn, Entity targetEntity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.INTERACT));
    return this.currentGameType != WorldSettings.GameType.SPECTATOR && playerIn.interactWith(targetEntity);
}
项目:BaseClient    文件:PlayerControllerMP.java   
public boolean func_178894_a(EntityPlayer p_178894_1_, Entity p_178894_2_, MovingObjectPosition p_178894_3_)
{
    this.syncCurrentPlayItem();
    Vec3 vec3 = new Vec3(p_178894_3_.hitVec.xCoord - p_178894_2_.posX, p_178894_3_.hitVec.yCoord - p_178894_2_.posY, p_178894_3_.hitVec.zCoord - p_178894_2_.posZ);
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_178894_2_, vec3));
    return this.currentGameType != WorldSettings.GameType.SPECTATOR && p_178894_2_.interactAt(p_178894_1_, vec3);
}
项目:SerenityCE    文件:FriendProtect.java   
public FriendProtect() {
    super("Friend Protect", 0xFFF6194A, ModuleCategory.COMBAT);
    setHidden(true);

    listeners.add(new Listener<SendPacket>() {
        @Override
        public void call(SendPacket event) {
            if (event.getPacket() instanceof C02PacketUseEntity) {
                C02PacketUseEntity useEntity = (C02PacketUseEntity) event.getPacket();
                Entity entity = useEntity.getEntityFromWorld(mc.theWorld);

                if (useEntity.getAction() == C02PacketUseEntity.Action.ATTACK && Serenity.getInstance().getFriendManager().isFriend(entity.getCommandSenderName())) {
                    ItemStack currentItem = mc.thePlayer.getCurrentEquippedItem();
                    Item item = currentItem == null ? null : currentItem.getItem();

                    if (minezHealing.getValue()) {
                        if (item != null && (item == Items.paper || (item == Items.dye) || item == Items.shears)) {
                            return;
                        }
                    }

                    if (swordsOnly.getValue() && (item instanceof ItemSword)) {
                        return;
                    }

                    if (notify.getValue()) {
                        Serenity.getInstance().addChatMessage(String.format("%s is your friend.", entity.getCommandSenderName()));
                    }
                    event.setCancelled(true);
                }
            }
        }
    });
    setState(true);
}
项目:Resilience-Client-Source    文件:NetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
public void processUseEntity(C02PacketUseEntity p_147340_1_)
{
    WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    Entity var3 = p_147340_1_.func_149564_a(var2);
    this.playerEntity.func_143004_u();

    if (var3 != null)
    {
        boolean var4 = this.playerEntity.canEntityBeSeen(var3);
        double var5 = 36.0D;

        if (!var4)
        {
            var5 = 9.0D;
        }

        if (this.playerEntity.getDistanceSqToEntity(var3) < var5)
        {
            if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.INTERACT)
            {
                this.playerEntity.interactWith(var3);
            }
            else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK)
            {
                if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity)
                {
                    this.kickPlayerFromServer("Attempting to attack an invalid entity");
                    this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity");
                    return;
                }

                this.playerEntity.attackTargetEntityWithCurrentItem(var3);
            }
        }
    }
}
项目:Resilience-Client-Source    文件:PlayerControllerMP.java   
/**
 * Attacks an entity
 */
public void attackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(par2Entity, C02PacketUseEntity.Action.ATTACK));
    par1EntityPlayer.attackTargetEntityWithCurrentItem(par2Entity);
}
项目:Resilience-Client-Source    文件:PlayerControllerMP.java   
/**
 * Send packet to server - player is interacting with another entity (left click)
 */
public boolean interactWithEntitySendPacket(EntityPlayer par1EntityPlayer, Entity par2Entity)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(par2Entity, C02PacketUseEntity.Action.INTERACT));
    return par1EntityPlayer.interactWith(par2Entity);
}
项目:Cauldron    文件:NetHandlerPlayServer.java   
public void processUseEntity(C02PacketUseEntity p_147340_1_)
{
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    Entity entity = p_147340_1_.func_149564_a(worldserver);
    this.playerEntity.func_143004_u();

    if (entity != null)
    {
        boolean flag = this.playerEntity.canEntityBeSeen(entity);
        double d0 = 36.0D;

        if (!flag)
        {
            d0 = 9.0D;
        }

        if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
        {
            if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.INTERACT)
            {
                this.playerEntity.interactWith(entity);
            }
            else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK)
            {
                if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity)
                {
                    this.kickPlayerFromServer("Attempting to attack an invalid entity");
                    this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity");
                    return;
                }

                this.playerEntity.attackTargetEntityWithCurrentItem(entity);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
public void processUseEntity(C02PacketUseEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    Entity entity = packetIn.getEntityFromWorld(worldserver);
    this.playerEntity.markPlayerActive();

    if (entity != null)
    {
        boolean flag = this.playerEntity.canEntityBeSeen(entity);
        double d0 = 36.0D;

        if (!flag)
        {
            d0 = 9.0D;
        }

        if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
        {
            if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT)
            {
                this.playerEntity.interactWith(entity);
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT_AT)
            {
                entity.interactAt(this.playerEntity, packetIn.getHitVec());
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.ATTACK)
            {
                if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity)
                {
                    this.kickPlayerFromServer("Attempting to attack an invalid entity");
                    this.serverController.logWarning("Player " + this.playerEntity.getName() + " tried to attack an invalid entity");
                    return;
                }

                this.playerEntity.attackTargetEntityWithCurrentItem(entity);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
public void processUseEntity(C02PacketUseEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    Entity entity = packetIn.getEntityFromWorld(worldserver);
    this.playerEntity.markPlayerActive();

    if (entity != null)
    {
        boolean flag = this.playerEntity.canEntityBeSeen(entity);
        double d0 = 36.0D;

        if (!flag)
        {
            d0 = 9.0D;
        }

        if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
        {
            if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT)
            {
                this.playerEntity.interactWith(entity);
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT_AT)
            {
                entity.interactAt(this.playerEntity, packetIn.getHitVec());
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.ATTACK)
            {
                if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity)
                {
                    this.kickPlayerFromServer("Attempting to attack an invalid entity");
                    this.serverController.logWarning("Player " + this.playerEntity.getName() + " tried to attack an invalid entity");
                    return;
                }

                this.playerEntity.attackTargetEntityWithCurrentItem(entity);
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
public void processUseEntity(C02PacketUseEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    Entity entity = packetIn.getEntityFromWorld(worldserver);
    this.playerEntity.markPlayerActive();

    if (entity != null)
    {
        boolean flag = this.playerEntity.canEntityBeSeen(entity);
        double d0 = 36.0D;

        if (!flag)
        {
            d0 = 9.0D;
        }

        if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
        {
            if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT)
            {
                this.playerEntity.interactWith(entity);
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT_AT)
            {
                entity.interactAt(this.playerEntity, packetIn.getHitVec());
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.ATTACK)
            {
                if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity)
                {
                    this.kickPlayerFromServer("Attempting to attack an invalid entity");
                    this.serverController.logWarning("Player " + this.playerEntity.getName() + " tried to attack an invalid entity");
                    return;
                }

                this.playerEntity.attackTargetEntityWithCurrentItem(entity);
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
public void processUseEntity(C02PacketUseEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    Entity entity = packetIn.getEntityFromWorld(worldserver);
    this.playerEntity.markPlayerActive();

    if (entity != null)
    {
        boolean flag = this.playerEntity.canEntityBeSeen(entity);
        double d0 = 36.0D;

        if (!flag)
        {
            d0 = 9.0D;
        }

        if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
        {
            if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT)
            {
                this.playerEntity.interactWith(entity);
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT_AT)
            {
                entity.interactAt(this.playerEntity, packetIn.getHitVec());
            }
            else if (packetIn.getAction() == C02PacketUseEntity.Action.ATTACK)
            {
                if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity)
                {
                    this.kickPlayerFromServer("Attempting to attack an invalid entity");
                    this.serverController.logWarning("Player " + this.playerEntity.getName() + " tried to attack an invalid entity");
                    return;
                }

                this.playerEntity.attackTargetEntityWithCurrentItem(entity);
            }
        }
    }
}
项目:4Space-5    文件:PlayerControllerMP.java   
public void attackEntity(EntityPlayer p_78764_1_, Entity p_78764_2_)
{
    syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78764_2_, C02PacketUseEntity.Action.ATTACK));
    p_78764_1_.attackTargetEntityWithCurrentItem(p_78764_2_);
}
项目:4Space-5    文件:PlayerControllerMP.java   
public boolean interactWithEntitySendPacket(EntityPlayer p_78768_1_, Entity p_78768_2_)
{
    syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78768_2_, C02PacketUseEntity.Action.INTERACT));
    return p_78768_1_.interactWith(p_78768_2_);
}
项目:Gadomancy    文件:FakeNetServerHandler.java   
@Override
public void processUseEntity(C02PacketUseEntity p_147340_1_) {
}
项目:4Space-1.7    文件:PlayerControllerMP.java   
public void attackEntity(EntityPlayer p_78764_1_, Entity p_78764_2_)
{
    syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78764_2_, C02PacketUseEntity.Action.ATTACK));
    p_78764_1_.attackTargetEntityWithCurrentItem(p_78764_2_);
}
项目:4Space-1.7    文件:PlayerControllerMP.java   
public boolean interactWithEntitySendPacket(EntityPlayer p_78768_1_, Entity p_78768_2_)
{
    syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78768_2_, C02PacketUseEntity.Action.INTERACT));
    return p_78768_1_.interactWith(p_78768_2_);
}
项目:Cauldron    文件:PlayerControllerMP.java   
public void attackEntity(EntityPlayer p_78764_1_, Entity p_78764_2_)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78764_2_, C02PacketUseEntity.Action.ATTACK));
    p_78764_1_.attackTargetEntityWithCurrentItem(p_78764_2_);
}
项目:Cauldron    文件:PlayerControllerMP.java   
public boolean interactWithEntitySendPacket(EntityPlayer p_78768_1_, Entity p_78768_2_)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78768_2_, C02PacketUseEntity.Action.INTERACT));
    return p_78768_1_.interactWith(p_78768_2_);
}
项目:Cauldron    文件:PlayerControllerMP.java   
public void attackEntity(EntityPlayer p_78764_1_, Entity p_78764_2_)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78764_2_, C02PacketUseEntity.Action.ATTACK));
    p_78764_1_.attackTargetEntityWithCurrentItem(p_78764_2_);
}
项目:Cauldron    文件:PlayerControllerMP.java   
public boolean interactWithEntitySendPacket(EntityPlayer p_78768_1_, Entity p_78768_2_)
{
    this.syncCurrentPlayItem();
    this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78768_2_, C02PacketUseEntity.Action.INTERACT));
    return p_78768_1_.interactWith(p_78768_2_);
}
项目:DecompiledMinecraft    文件:INetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
void processUseEntity(C02PacketUseEntity packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
void processUseEntity(C02PacketUseEntity packetIn);
项目:BaseClient    文件:INetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
void processUseEntity(C02PacketUseEntity packetIn);
项目:BaseClient    文件:INetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
void processUseEntity(C02PacketUseEntity packetIn);
项目:Resilience-Client-Source    文件:INetHandlerPlayServer.java   
/**
 * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
 * equipped item
 */
void processUseEntity(C02PacketUseEntity var1);
项目:Cauldron    文件:INetHandlerPlayServer.java   
void processUseEntity(C02PacketUseEntity p_147340_1_);
项目:Cauldron    文件:INetHandlerPlayServer.java   
void processUseEntity(C02PacketUseEntity p_147340_1_);