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

项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72490_a(Packet103SetSlot p_72490_1_) {
   EntityClientPlayerMP var2 = this.field_72563_h.field_71439_g;
   if(p_72490_1_.field_73637_a == -1) {
      var2.field_71071_by.func_70437_b(p_72490_1_.field_73636_c);
   } else {
      boolean var3 = false;
      if(this.field_72563_h.field_71462_r instanceof GuiContainerCreative) {
         GuiContainerCreative var4 = (GuiContainerCreative)this.field_72563_h.field_71462_r;
         var3 = var4.func_74230_h() != CreativeTabs.field_78036_m.func_78021_a();
      }

      if(p_72490_1_.field_73637_a == 0 && p_72490_1_.field_73635_b >= 36 && p_72490_1_.field_73635_b < 45) {
         ItemStack var5 = var2.field_71069_bz.func_75139_a(p_72490_1_.field_73635_b).func_75211_c();
         if(p_72490_1_.field_73636_c != null && (var5 == null || var5.field_77994_a < p_72490_1_.field_73636_c.field_77994_a)) {
            p_72490_1_.field_73636_c.field_77992_b = 5;
         }

         var2.field_71069_bz.func_75141_a(p_72490_1_.field_73635_b, p_72490_1_.field_73636_c);
      } else if(p_72490_1_.field_73637_a == var2.field_71070_bA.field_75152_c && (p_72490_1_.field_73637_a != 0 || !var3)) {
         var2.field_71070_bA.func_75141_a(p_72490_1_.field_73635_b, p_72490_1_.field_73636_c);
      }
   }

}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71111_a(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) {
   if(!(p_71111_1_.func_75139_a(p_71111_2_) instanceof SlotCrafting)) {
      if(!this.field_71137_h) {
         this.field_71135_a.func_72567_b(new Packet103SetSlot(p_71111_1_.field_75152_c, p_71111_2_, p_71111_3_));
      }
   }
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual
 * contents of that slot. Args: Container, slot number, slot contents
 */
public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack)
{
    if (!(par1Container.getSlot(par2) instanceof SlotCrafting))
    {
        if (!this.playerInventoryBeingManipulated)
        {
            this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack));
        }
    }
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * updates item held by mouse
 */
public void updateHeldItem()
{
    if (!this.playerInventoryBeingManipulated)
    {
        this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot)
{
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;

    if (par1Packet103SetSlot.windowId == -1)
    {
        entityclientplayermp.inventory.setItemStack(par1Packet103SetSlot.myItemStack);
    }
    else
    {
        boolean flag = false;

        if (this.mc.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.mc.currentScreen;
            flag = guicontainercreative.getCurrentTabIndex() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (par1Packet103SetSlot.windowId == 0 && par1Packet103SetSlot.itemSlot >= 36 && par1Packet103SetSlot.itemSlot < 45)
        {
            ItemStack itemstack = entityclientplayermp.inventoryContainer.getSlot(par1Packet103SetSlot.itemSlot).getStack();

            if (par1Packet103SetSlot.myItemStack != null && (itemstack == null || itemstack.stackSize < par1Packet103SetSlot.myItemStack.stackSize))
            {
                par1Packet103SetSlot.myItemStack.animationsToGo = 5;
            }

            entityclientplayermp.inventoryContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack);
        }
        else if (par1Packet103SetSlot.windowId == entityclientplayermp.openContainer.windowId && (par1Packet103SetSlot.windowId != 0 || !flag))
        {
            entityclientplayermp.openContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack);
        }
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual
 * contents of that slot. Args: Container, slot number, slot contents
 */
public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack)
{
    if (!(par1Container.getSlot(par2) instanceof SlotCrafting))
    {
        if (!this.playerInventoryBeingManipulated)
        {
            this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack));
        }
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * updates item held by mouse
 */
public void updateHeldItem()
{
    if (!this.playerInventoryBeingManipulated)
    {
        this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot)
{
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;

    if (par1Packet103SetSlot.windowId == -1)
    {
        entityclientplayermp.inventory.setItemStack(par1Packet103SetSlot.myItemStack);
    }
    else
    {
        boolean flag = false;

        if (this.mc.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.mc.currentScreen;
            flag = guicontainercreative.getCurrentTabIndex() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (par1Packet103SetSlot.windowId == 0 && par1Packet103SetSlot.itemSlot >= 36 && par1Packet103SetSlot.itemSlot < 45)
        {
            ItemStack itemstack = entityclientplayermp.inventoryContainer.getSlot(par1Packet103SetSlot.itemSlot).getStack();

            if (par1Packet103SetSlot.myItemStack != null && (itemstack == null || itemstack.stackSize < par1Packet103SetSlot.myItemStack.stackSize))
            {
                par1Packet103SetSlot.myItemStack.animationsToGo = 5;
            }

            entityclientplayermp.inventoryContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack);
        }
        else if (par1Packet103SetSlot.windowId == entityclientplayermp.openContainer.windowId && (par1Packet103SetSlot.windowId != 0 || !flag))
        {
            entityclientplayermp.openContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack);
        }
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot)
{
    nch.handleSetSlot(par1Packet103SetSlot);        
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71110_a(Container p_71110_1_, List p_71110_2_) {
   this.field_71135_a.func_72567_b(new Packet104WindowItems(p_71110_1_.field_75152_c, p_71110_2_));
   this.field_71135_a.func_72567_b(new Packet103SetSlot(-1, -1, this.field_71071_by.func_70445_o()));
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71113_k() {
   if(!this.field_71137_h) {
      this.field_71135_a.func_72567_b(new Packet103SetSlot(-1, -1, this.field_71071_by.func_70445_o()));
   }
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72490_a(Packet103SetSlot p_72490_1_) {
   this.func_72509_a(p_72490_1_);
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72472_a(Packet15Place p_72472_1_) {
   WorldServer var2 = this.field_72573_d.func_71218_a(this.field_72574_e.field_71093_bK);
   ItemStack var3 = this.field_72574_e.field_71071_by.func_70448_g();
   boolean var4 = false;
   int var5 = p_72472_1_.func_73403_d();
   int var6 = p_72472_1_.func_73402_f();
   int var7 = p_72472_1_.func_73407_g();
   int var8 = p_72472_1_.func_73401_h();
   this.field_72574_e.func_143004_u();
   if(p_72472_1_.func_73401_h() == 255) {
      if(var3 == null) {
         return;
      }

      this.field_72574_e.field_71134_c.func_73085_a(this.field_72574_e, var2, var3);
   } else if(p_72472_1_.func_73402_f() >= this.field_72573_d.func_71207_Z() - 1 && (p_72472_1_.func_73401_h() == 1 || p_72472_1_.func_73402_f() >= this.field_72573_d.func_71207_Z())) {
      this.field_72574_e.field_71135_a.func_72567_b(new Packet3Chat(ChatMessageComponent.func_111082_b("build.tooHigh", new Object[]{Integer.valueOf(this.field_72573_d.func_71207_Z())}).func_111059_a(EnumChatFormatting.RED)));
      var4 = true;
   } else {
      if(this.field_72587_r && this.field_72574_e.func_70092_e((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.field_72573_d.func_96290_a(var2, var5, var6, var7, this.field_72574_e)) {
         this.field_72574_e.field_71134_c.func_73078_a(this.field_72574_e, var2, var3, var5, var6, var7, var8, p_72472_1_.func_73406_j(), p_72472_1_.func_73404_l(), p_72472_1_.func_73408_m());
      }

      var4 = true;
   }

   if(var4) {
      this.field_72574_e.field_71135_a.func_72567_b(new Packet53BlockChange(var5, var6, var7, var2));
      if(var8 == 0) {
         --var6;
      }

      if(var8 == 1) {
         ++var6;
      }

      if(var8 == 2) {
         --var7;
      }

      if(var8 == 3) {
         ++var7;
      }

      if(var8 == 4) {
         --var5;
      }

      if(var8 == 5) {
         ++var5;
      }

      this.field_72574_e.field_71135_a.func_72567_b(new Packet53BlockChange(var5, var6, var7, var2));
   }

   var3 = this.field_72574_e.field_71071_by.func_70448_g();
   if(var3 != null && var3.field_77994_a == 0) {
      this.field_72574_e.field_71071_by.field_70462_a[this.field_72574_e.field_71071_by.field_70461_c] = null;
      var3 = null;
   }

   if(var3 == null || var3.func_77988_m() == 0) {
      this.field_72574_e.field_71137_h = true;
      this.field_72574_e.field_71071_by.field_70462_a[this.field_72574_e.field_71071_by.field_70461_c] = ItemStack.func_77944_b(this.field_72574_e.field_71071_by.field_70462_a[this.field_72574_e.field_71071_by.field_70461_c]);
      Slot var9 = this.field_72574_e.field_71070_bA.func_75147_a(this.field_72574_e.field_71071_by, this.field_72574_e.field_71071_by.field_70461_c);
      this.field_72574_e.field_71070_bA.func_75142_b();
      this.field_72574_e.field_71137_h = false;
      if(!ItemStack.func_77989_b(this.field_72574_e.field_71071_by.func_70448_g(), p_72472_1_.func_73405_i())) {
         this.func_72567_b(new Packet103SetSlot(this.field_72574_e.field_71070_bA.field_75152_c, var9.field_75222_d, this.field_72574_e.field_71071_by.func_70448_g()));
      }
   }

}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void sendContainerAndContentsToPlayer(Container par1Container, List par2List)
{
    this.playerNetServerHandler.sendPacketToPlayer(new Packet104WindowItems(par1Container.windowId, par2List));
    this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
public void sendContainerAndContentsToPlayer(Container par1Container, List par2List)
{
    this.playerNetServerHandler.sendPacketToPlayer(new Packet104WindowItems(par1Container.windowId, par2List));
    this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
}