Java 类net.minecraft.network.packet.Packet106Transaction 实例源码

项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72523_a(Packet102WindowClick p_72523_1_) {
   this.field_72574_e.func_143004_u();
   if(this.field_72574_e.field_71070_bA.field_75152_c == p_72523_1_.field_73444_a && this.field_72574_e.field_71070_bA.func_75129_b(this.field_72574_e)) {
      ItemStack var2 = this.field_72574_e.field_71070_bA.func_75144_a(p_72523_1_.field_73442_b, p_72523_1_.field_73443_c, p_72523_1_.field_73439_f, this.field_72574_e);
      if(ItemStack.func_77989_b(p_72523_1_.field_73441_e, var2)) {
         this.field_72574_e.field_71135_a.func_72567_b(new Packet106Transaction(p_72523_1_.field_73444_a, p_72523_1_.field_73440_d, true));
         this.field_72574_e.field_71137_h = true;
         this.field_72574_e.field_71070_bA.func_75142_b();
         this.field_72574_e.func_71113_k();
         this.field_72574_e.field_71137_h = false;
      } else {
         this.field_72586_s.func_76038_a(this.field_72574_e.field_71070_bA.field_75152_c, Short.valueOf(p_72523_1_.field_73440_d));
         this.field_72574_e.field_71135_a.func_72567_b(new Packet106Transaction(p_72523_1_.field_73444_a, p_72523_1_.field_73440_d, false));
         this.field_72574_e.field_71070_bA.func_75128_a(this.field_72574_e, false);
         ArrayList var3 = new ArrayList();

         for(int var4 = 0; var4 < this.field_72574_e.field_71070_bA.field_75151_b.size(); ++var4) {
            var3.add(((Slot)this.field_72574_e.field_71070_bA.field_75151_b.get(var4)).func_75211_c());
         }

         this.field_72574_e.func_71110_a(this.field_72574_e.field_71070_bA, var3);
      }
   }

}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;

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

    if (container != null && !par1Packet106Transaction.accepted)
    {
        this.addToSendQueue(new Packet106Transaction(par1Packet106Transaction.windowId, par1Packet106Transaction.shortWindowId, true));
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;

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

    if (container != null && !par1Packet106Transaction.accepted)
    {
        this.addToSendQueue(new Packet106Transaction(par1Packet106Transaction.windowId, par1Packet106Transaction.shortWindowId, true));
    }
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72476_a(Packet106Transaction p_72476_1_) {
   Short var2 = (Short)this.field_72586_s.func_76041_a(this.field_72574_e.field_71070_bA.field_75152_c);
   if(var2 != null && p_72476_1_.field_73433_b == var2.shortValue() && this.field_72574_e.field_71070_bA.field_75152_c == p_72476_1_.field_73435_a && !this.field_72574_e.field_71070_bA.func_75129_b(this.field_72574_e)) {
      this.field_72574_e.field_71070_bA.func_75128_a(this.field_72574_e, true);
   }

}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72476_a(Packet106Transaction p_72476_1_) {
   Container var2 = null;
   EntityClientPlayerMP var3 = this.field_72563_h.field_71439_g;
   if(p_72476_1_.field_73435_a == 0) {
      var2 = var3.field_71069_bz;
   } else if(p_72476_1_.field_73435_a == var3.field_71070_bA.field_75152_c) {
      var2 = var3.field_71070_bA;
   }

   if(var2 != null && !p_72476_1_.field_73434_c) {
      this.func_72552_c(new Packet106Transaction(p_72476_1_.field_73435_a, p_72476_1_.field_73433_b, true));
   }

}
项目:RuneCraftery    文件:NetServerHandler.java   
public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick)
{
    this.playerEntity.func_143004_u();

    if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
    {
        ItemStack itemstack = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity);

        if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, itemstack))
        {
            this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true));
            this.playerEntity.playerInventoryBeingManipulated = true;
            this.playerEntity.openContainer.detectAndSendChanges();
            this.playerEntity.updateHeldItem();
            this.playerEntity.playerInventoryBeingManipulated = false;
        }
        else
        {
            this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action));
            this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, 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);
        }
    }
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
{
    Short oshort = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId);

    if (oshort != null && par1Packet106Transaction.shortWindowId == oshort.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
    {
        this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true);
    }
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick)
{
    this.playerEntity.func_143004_u();

    if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
    {
        ItemStack itemstack = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity);

        if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, itemstack))
        {
            this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true));
            this.playerEntity.playerInventoryBeingManipulated = true;
            this.playerEntity.openContainer.detectAndSendChanges();
            this.playerEntity.updateHeldItem();
            this.playerEntity.playerInventoryBeingManipulated = false;
        }
        else
        {
            this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action));
            this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, 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);
        }
    }
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
{
    Short oshort = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId);

    if (oshort != null && par1Packet106Transaction.shortWindowId == oshort.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
    {
        this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true);
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
{
    nch.handleTransaction(par1Packet106Transaction);        
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72476_a(Packet106Transaction p_72476_1_) {
   this.func_72509_a(p_72476_1_);
}