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

项目:DecompiledMinecraft    文件:PlayerControllerMP.java   
/**
 * Handles slot clicks sends a packet to the server.
 */
public ItemStack windowClick(int windowId, int slotId, int mouseButtonClicked, int mode, EntityPlayer playerIn)
{
    short short1 = playerIn.openContainer.getNextTransactionID(playerIn.inventory);
    ItemStack itemstack = playerIn.openContainer.slotClick(slotId, mouseButtonClicked, mode, playerIn);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(windowId, slotId, mouseButtonClicked, mode, itemstack, short1));
    return itemstack;
}
项目:BaseClient    文件:PlayerControllerMP.java   
/**
 * Handles slot clicks sends a packet to the server.
 */
public ItemStack windowClick(int windowId, int slotId, int mouseButtonClicked, int mode, EntityPlayer playerIn)
{
    short short1 = playerIn.openContainer.getNextTransactionID(playerIn.inventory);
    ItemStack itemstack = playerIn.openContainer.slotClick(slotId, mouseButtonClicked, mode, playerIn);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(windowId, slotId, mouseButtonClicked, mode, itemstack, short1));
    return itemstack;
}
项目:BaseClient    文件:PlayerControllerMP.java   
public ItemStack windowClick(int windowId, int slotId, int mouseButtonClicked, int p_78753_4_, EntityPlayer playerIn, boolean packet)
   {
short var6 = playerIn.openContainer.getNextTransactionID(playerIn.inventory);
ItemStack var7 = playerIn.openContainer.slotClick(slotId, mouseButtonClicked, p_78753_4_, playerIn);
if (packet) this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(windowId, slotId, mouseButtonClicked, p_78753_4_, var7, var6));
return var7;
   }
项目:BaseClient    文件:PlayerControllerMP.java   
/**
 * Handles slot clicks sends a packet to the server.
 */
public ItemStack windowClick(int windowId, int slotId, int mouseButtonClicked, int mode, EntityPlayer playerIn)
{
    short short1 = playerIn.openContainer.getNextTransactionID(playerIn.inventory);
    ItemStack itemstack = playerIn.openContainer.slotClick(slotId, mouseButtonClicked, mode, playerIn);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(windowId, slotId, mouseButtonClicked, mode, itemstack, short1));
    return itemstack;
}
项目:4Space-5    文件:PlayerControllerMP.java   
public ItemStack windowClick(int p_78753_1_, int p_78753_2_, int p_78753_3_, int p_78753_4_, EntityPlayer p_78753_5_)
{
    short short1 = p_78753_5_.openContainer.getNextTransactionID(p_78753_5_.inventory);
    ItemStack itemstack = p_78753_5_.openContainer.slotClick(p_78753_2_, p_78753_3_, p_78753_4_, p_78753_5_);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(p_78753_1_, p_78753_2_, p_78753_3_, p_78753_4_, itemstack, short1));
    return itemstack;
}
项目:Resilience-Client-Source    文件:NetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
public void processClickWindow(C0EPacketClickWindow p_147351_1_)
{
    this.playerEntity.func_143004_u();

    if (this.playerEntity.openContainer.windowId == p_147351_1_.func_149548_c() && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
    {
        ItemStack var2 = this.playerEntity.openContainer.slotClick(p_147351_1_.func_149544_d(), p_147351_1_.func_149543_e(), p_147351_1_.func_149542_h(), this.playerEntity);

        if (ItemStack.areItemStacksEqual(p_147351_1_.func_149546_g(), var2))
        {
            this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true));
            this.playerEntity.isChangingQuantityOnly = true;
            this.playerEntity.openContainer.detectAndSendChanges();
            this.playerEntity.updateHeldItem();
            this.playerEntity.isChangingQuantityOnly = false;
        }
        else
        {
            this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(p_147351_1_.func_149547_f()));
            this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), false));
            this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false);
            ArrayList var3 = new ArrayList();

            for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4)
            {
                var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack());
            }

            this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, var3);
        }
    }
}
项目:Resilience-Client-Source    文件:PlayerControllerMP.java   
public ItemStack windowClick(int par1, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
    short var6 = par5EntityPlayer.openContainer.getNextTransactionID(par5EntityPlayer.inventory);
    ItemStack var7 = par5EntityPlayer.openContainer.slotClick(par2, par3, par4, par5EntityPlayer);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(par1, par2, par3, par4, var7, var6));
    return var7;
}
项目:4Space-1.7    文件:PlayerControllerMP.java   
public ItemStack windowClick(int p_78753_1_, int p_78753_2_, int p_78753_3_, int p_78753_4_, EntityPlayer p_78753_5_)
{
    short short1 = p_78753_5_.openContainer.getNextTransactionID(p_78753_5_.inventory);
    ItemStack itemstack = p_78753_5_.openContainer.slotClick(p_78753_2_, p_78753_3_, p_78753_4_, p_78753_5_);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(p_78753_1_, p_78753_2_, p_78753_3_, p_78753_4_, itemstack, short1));
    return itemstack;
}
项目:ControlPack    文件:MixinGuiFurnace.java   
private void addToSendQueue(int slotNumber, int mouseButton, ItemStack stack) {
    //if (mc.isMultiplayerWorld()) {
        short actionnum = mc.player.openContainer.getNextTransactionID(mc.player.inventory);
        // i = windowid, slot num, mouse, shift, itemstack, action
        mc.getConnection().sendPacket(new C0EPacketClickWindow(inventorySlots.windowId, slotNumber, mouseButton, 0, stack, actionnum));
    //}
}
项目:Cauldron    文件:PlayerControllerMP.java   
public ItemStack windowClick(int p_78753_1_, int p_78753_2_, int p_78753_3_, int p_78753_4_, EntityPlayer p_78753_5_)
{
    short short1 = p_78753_5_.openContainer.getNextTransactionID(p_78753_5_.inventory);
    ItemStack itemstack = p_78753_5_.openContainer.slotClick(p_78753_2_, p_78753_3_, p_78753_4_, p_78753_5_);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(p_78753_1_, p_78753_2_, p_78753_3_, p_78753_4_, itemstack, short1));
    return itemstack;
}
项目:Cauldron    文件:NetHandlerPlayServer.java   
public void processClickWindow(C0EPacketClickWindow p_147351_1_)
{
    this.playerEntity.func_143004_u();

    if (this.playerEntity.openContainer.windowId == p_147351_1_.func_149548_c() && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
    {
        ItemStack itemstack = this.playerEntity.openContainer.slotClick(p_147351_1_.func_149544_d(), p_147351_1_.func_149543_e(), p_147351_1_.func_149542_h(), this.playerEntity);

        if (ItemStack.areItemStacksEqual(p_147351_1_.func_149546_g(), itemstack))
        {
            this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true));
            this.playerEntity.isChangingQuantityOnly = true;
            this.playerEntity.openContainer.detectAndSendChanges();
            this.playerEntity.updateHeldItem();
            this.playerEntity.isChangingQuantityOnly = false;
        }
        else
        {
            this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(p_147351_1_.func_149547_f()));
            this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), false));
            this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false);
            ArrayList arraylist = new ArrayList();

            for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i)
            {
                arraylist.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(i)).getStack());
            }

            this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, arraylist);
        }
    }
}
项目:Cauldron    文件:PlayerControllerMP.java   
public ItemStack windowClick(int p_78753_1_, int p_78753_2_, int p_78753_3_, int p_78753_4_, EntityPlayer p_78753_5_)
{
    short short1 = p_78753_5_.openContainer.getNextTransactionID(p_78753_5_.inventory);
    ItemStack itemstack = p_78753_5_.openContainer.slotClick(p_78753_2_, p_78753_3_, p_78753_4_, p_78753_5_);
    this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(p_78753_1_, p_78753_2_, p_78753_3_, p_78753_4_, itemstack, short1));
    return itemstack;
}
项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
public void processClickWindow(C0EPacketClickWindow packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    this.playerEntity.markPlayerActive();

    if (this.playerEntity.openContainer.windowId == packetIn.getWindowId() && this.playerEntity.openContainer.getCanCraft(this.playerEntity))
    {
        if (this.playerEntity.isSpectator())
        {
            List<ItemStack> list = Lists.<ItemStack>newArrayList();

            for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i)
            {
                list.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(i)).getStack());
            }

            this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list);
        }
        else
        {
            ItemStack itemstack = this.playerEntity.openContainer.slotClick(packetIn.getSlotId(), packetIn.getUsedButton(), packetIn.getMode(), this.playerEntity);

            if (ItemStack.areItemStacksEqual(packetIn.getClickedItem(), itemstack))
            {
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
                this.playerEntity.isChangingQuantityOnly = true;
                this.playerEntity.openContainer.detectAndSendChanges();
                this.playerEntity.updateHeldItem();
                this.playerEntity.isChangingQuantityOnly = false;
            }
            else
            {
                this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(packetIn.getActionNumber()));
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), false));
                this.playerEntity.openContainer.setCanCraft(this.playerEntity, false);
                List<ItemStack> list1 = Lists.<ItemStack>newArrayList();

                for (int j = 0; j < this.playerEntity.openContainer.inventorySlots.size(); ++j)
                {
                    list1.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(j)).getStack());
                }

                this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list1);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
public void processClickWindow(C0EPacketClickWindow packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    this.playerEntity.markPlayerActive();

    if (this.playerEntity.openContainer.windowId == packetIn.getWindowId() && this.playerEntity.openContainer.getCanCraft(this.playerEntity))
    {
        if (this.playerEntity.isSpectator())
        {
            List<ItemStack> list = Lists.<ItemStack>newArrayList();

            for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i)
            {
                list.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(i)).getStack());
            }

            this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list);
        }
        else
        {
            ItemStack itemstack = this.playerEntity.openContainer.slotClick(packetIn.getSlotId(), packetIn.getUsedButton(), packetIn.getMode(), this.playerEntity);

            if (ItemStack.areItemStacksEqual(packetIn.getClickedItem(), itemstack))
            {
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
                this.playerEntity.isChangingQuantityOnly = true;
                this.playerEntity.openContainer.detectAndSendChanges();
                this.playerEntity.updateHeldItem();
                this.playerEntity.isChangingQuantityOnly = false;
            }
            else
            {
                this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(packetIn.getActionNumber()));
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), false));
                this.playerEntity.openContainer.setCanCraft(this.playerEntity, false);
                List<ItemStack> list1 = Lists.<ItemStack>newArrayList();

                for (int j = 0; j < this.playerEntity.openContainer.inventorySlots.size(); ++j)
                {
                    list1.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(j)).getStack());
                }

                this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list1);
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
public void processClickWindow(C0EPacketClickWindow packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    this.playerEntity.markPlayerActive();

    if (this.playerEntity.openContainer.windowId == packetIn.getWindowId() && this.playerEntity.openContainer.getCanCraft(this.playerEntity))
    {
        if (this.playerEntity.isSpectator())
        {
            List<ItemStack> list = Lists.<ItemStack>newArrayList();

            for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i)
            {
                list.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(i)).getStack());
            }

            this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list);
        }
        else
        {
            ItemStack itemstack = this.playerEntity.openContainer.slotClick(packetIn.getSlotId(), packetIn.getUsedButton(), packetIn.getMode(), this.playerEntity);

            if (ItemStack.areItemStacksEqual(packetIn.getClickedItem(), itemstack))
            {
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
                this.playerEntity.isChangingQuantityOnly = true;
                this.playerEntity.openContainer.detectAndSendChanges();
                this.playerEntity.updateHeldItem();
                this.playerEntity.isChangingQuantityOnly = false;
            }
            else
            {
                this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(packetIn.getActionNumber()));
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), false));
                this.playerEntity.openContainer.setCanCraft(this.playerEntity, false);
                List<ItemStack> list1 = Lists.<ItemStack>newArrayList();

                for (int j = 0; j < this.playerEntity.openContainer.inventorySlots.size(); ++j)
                {
                    list1.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(j)).getStack());
                }

                this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list1);
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
public void processClickWindow(C0EPacketClickWindow packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    this.playerEntity.markPlayerActive();

    if (this.playerEntity.openContainer.windowId == packetIn.getWindowId() && this.playerEntity.openContainer.getCanCraft(this.playerEntity))
    {
        if (this.playerEntity.isSpectator())
        {
            List<ItemStack> list = Lists.<ItemStack>newArrayList();

            for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i)
            {
                list.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(i)).getStack());
            }

            this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list);
        }
        else
        {
            ItemStack itemstack = this.playerEntity.openContainer.slotClick(packetIn.getSlotId(), packetIn.getUsedButton(), packetIn.getMode(), this.playerEntity);

            if (ItemStack.areItemStacksEqual(packetIn.getClickedItem(), itemstack))
            {
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
                this.playerEntity.isChangingQuantityOnly = true;
                this.playerEntity.openContainer.detectAndSendChanges();
                this.playerEntity.updateHeldItem();
                this.playerEntity.isChangingQuantityOnly = false;
            }
            else
            {
                this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(packetIn.getActionNumber()));
                this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), false));
                this.playerEntity.openContainer.setCanCraft(this.playerEntity, false);
                List<ItemStack> list1 = Lists.<ItemStack>newArrayList();

                for (int j = 0; j < this.playerEntity.openContainer.inventorySlots.size(); ++j)
                {
                    list1.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(j)).getStack());
                }

                this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list1);
            }
        }
    }
}
项目:Gadomancy    文件:FakeNetServerHandler.java   
@Override
public void processClickWindow(C0EPacketClickWindow p_147351_1_) {
}
项目:DecompiledMinecraft    文件:INetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
void processClickWindow(C0EPacketClickWindow packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
void processClickWindow(C0EPacketClickWindow packetIn);
项目:BaseClient    文件:INetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
void processClickWindow(C0EPacketClickWindow packetIn);
项目:BaseClient    文件:INetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
void processClickWindow(C0EPacketClickWindow packetIn);
项目:Resilience-Client-Source    文件:INetHandlerPlayServer.java   
/**
 * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they
 * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has
 * the same open container/inventory
 */
void processClickWindow(C0EPacketClickWindow var1);
项目:Cauldron    文件:INetHandlerPlayServer.java   
void processClickWindow(C0EPacketClickWindow p_147351_1_);
项目:Cauldron    文件:INetHandlerPlayServer.java   
void processClickWindow(C0EPacketClickWindow p_147351_1_);