当前位置: 首页>>代码示例>>Java>>正文


Java S2FPacketSetSlot.func_149173_d方法代码示例

本文整理汇总了Java中net.minecraft.network.play.server.S2FPacketSetSlot.func_149173_d方法的典型用法代码示例。如果您正苦于以下问题:Java S2FPacketSetSlot.func_149173_d方法的具体用法?Java S2FPacketSetSlot.func_149173_d怎么用?Java S2FPacketSetSlot.func_149173_d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.network.play.server.S2FPacketSetSlot的用法示例。


在下文中一共展示了S2FPacketSetSlot.func_149173_d方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleSetSlot

import net.minecraft.network.play.server.S2FPacketSetSlot; //导入方法依赖的package包/类
/**
 * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container
 */
public void handleSetSlot(S2FPacketSetSlot packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;

    if (packetIn.func_149175_c() == -1)
    {
        entityplayer.inventory.setItemStack(packetIn.func_149174_e());
    }
    else
    {
        boolean flag = false;

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

        if (packetIn.func_149175_c() == 0 && packetIn.func_149173_d() >= 36 && packetIn.func_149173_d() < 45)
        {
            ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack();

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

            entityplayer.inventoryContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        }
        else if (packetIn.func_149175_c() == entityplayer.openContainer.windowId && (packetIn.func_149175_c() != 0 || !flag))
        {
            entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:NetHandlerPlayClient.java

示例2: handleSetSlot

import net.minecraft.network.play.server.S2FPacketSetSlot; //导入方法依赖的package包/类
/**
 * Handles pickin up an ItemStack or dropping one in your inventory or an open
 * (non-creative) container
 */
public void handleSetSlot(S2FPacketSetSlot packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	EntityPlayer entityplayer = this.gameController.thePlayer;

	if (packetIn.func_149175_c() == -1) {
		entityplayer.inventory.setItemStack(packetIn.func_149174_e());
	} else {
		boolean flag = false;

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

		if (packetIn.func_149175_c() == 0 && packetIn.func_149173_d() >= 36 && packetIn.func_149173_d() < 45) {
			ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack();

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

			entityplayer.inventoryContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
		} else if (packetIn.func_149175_c() == entityplayer.openContainer.windowId
				&& (packetIn.func_149175_c() != 0 || !flag)) {
			entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:NetHandlerPlayClient.java

示例3: handleSetSlot

import net.minecraft.network.play.server.S2FPacketSetSlot; //导入方法依赖的package包/类
/**
 * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container
 */
public void handleSetSlot(S2FPacketSetSlot p_147266_1_)
{
    EntityClientPlayerMP var2 = this.gameController.thePlayer;

    if (p_147266_1_.func_149175_c() == -1)
    {
        var2.inventory.setItemStack(p_147266_1_.func_149174_e());
    }
    else
    {
        boolean var3 = false;

        if (this.gameController.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative var4 = (GuiContainerCreative)this.gameController.currentScreen;
            var3 = var4.func_147056_g() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && p_147266_1_.func_149173_d() < 45)
        {
            ItemStack var5 = var2.inventoryContainer.getSlot(p_147266_1_.func_149173_d()).getStack();

            if (p_147266_1_.func_149174_e() != null && (var5 == null || var5.stackSize < p_147266_1_.func_149174_e().stackSize))
            {
                p_147266_1_.func_149174_e().animationsToGo = 5;
            }

            var2.inventoryContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
        else if (p_147266_1_.func_149175_c() == var2.openContainer.windowId && (p_147266_1_.func_149175_c() != 0 || !var3))
        {
            var2.openContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:39,代码来源:NetHandlerPlayClient.java

示例4: handleSetSlot

import net.minecraft.network.play.server.S2FPacketSetSlot; //导入方法依赖的package包/类
public void handleSetSlot(S2FPacketSetSlot p_147266_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;

    if (p_147266_1_.func_149175_c() == -1)
    {
        entityclientplayermp.inventory.setItemStack(p_147266_1_.func_149174_e());
    }
    else
    {
        boolean flag = false;

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

        if (p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && p_147266_1_.func_149173_d() < 45)
        {
            ItemStack itemstack = entityclientplayermp.inventoryContainer.getSlot(p_147266_1_.func_149173_d()).getStack();

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

            entityclientplayermp.inventoryContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
        else if (p_147266_1_.func_149175_c() == entityclientplayermp.openContainer.windowId && (p_147266_1_.func_149175_c() != 0 || !flag))
        {
            entityclientplayermp.openContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:36,代码来源:NetHandlerPlayClient.java


注:本文中的net.minecraft.network.play.server.S2FPacketSetSlot.func_149173_d方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。