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

项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
public void handleConfirmTransaction(S32PacketConfirmTransaction packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Container container = null;
    EntityPlayer entityplayer = this.gameController.thePlayer;

    if (packetIn.getWindowId() == 0)
    {
        container = entityplayer.inventoryContainer;
    }
    else if (packetIn.getWindowId() == entityplayer.openContainer.windowId)
    {
        container = entityplayer.openContainer;
    }

    if (container != null && !packetIn.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
public void handleConfirmTransaction(S32PacketConfirmTransaction packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Container container = null;
    EntityPlayer entityplayer = this.gameController.thePlayer;

    if (packetIn.getWindowId() == 0)
    {
        container = entityplayer.inventoryContainer;
    }
    else if (packetIn.getWindowId() == entityplayer.openContainer.windowId)
    {
        container = entityplayer.openContainer;
    }

    if (container != null && !packetIn.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the
 * inventory/container opened by the player and confirms if it is the case.
 */
public void handleConfirmTransaction(S32PacketConfirmTransaction packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Container container = null;
    EntityPlayer entityplayer = this.gameController.thePlayer;

    if (packetIn.getWindowId() == 0) {
        container = entityplayer.inventoryContainer;
    } else if (packetIn.getWindowId() == entityplayer.openContainer.windowId) {
        container = entityplayer.openContainer;
    }

    if (container != null && !packetIn.func_148888_e()) {
        this.addToSendQueue(
                new C0FPacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
    }
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_)
{
    Container var2 = null;
    EntityClientPlayerMP var3 = this.gameController.thePlayer;

    if (p_147239_1_.func_148889_c() == 0)
    {
        var2 = var3.inventoryContainer;
    }
    else if (p_147239_1_.func_148889_c() == var3.openContainer.windowId)
    {
        var2 = var3.openContainer;
    }

    if (var2 != null && !p_147239_1_.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;

    if (p_147239_1_.func_148889_c() == 0)
    {
        container = entityclientplayermp.inventoryContainer;
    }
    else if (p_147239_1_.func_148889_c() == entityclientplayermp.openContainer.windowId)
    {
        container = entityclientplayermp.openContainer;
    }

    if (container != null && !p_147239_1_.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;

    if (p_147239_1_.func_148889_c() == 0)
    {
        container = entityclientplayermp.inventoryContainer;
    }
    else if (p_147239_1_.func_148889_c() == entityclientplayermp.openContainer.windowId)
    {
        container = entityclientplayermp.openContainer;
    }

    if (container != null && !p_147239_1_.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
    }
}
项目: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);
        }
    }
}
项目: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);
        }
    }
}
项目: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);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
void handleConfirmTransaction(S32PacketConfirmTransaction packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
void handleConfirmTransaction(S32PacketConfirmTransaction packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
void handleConfirmTransaction(S32PacketConfirmTransaction packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
void handleConfirmTransaction(S32PacketConfirmTransaction packetIn);
项目:Resilience-Client-Source    文件:INetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
void handleConfirmTransaction(S32PacketConfirmTransaction var1);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_);