本文整理汇总了Java中net.minecraft.network.play.server.S2FPacketSetSlot.func_149175_c方法的典型用法代码示例。如果您正苦于以下问题:Java S2FPacketSetSlot.func_149175_c方法的具体用法?Java S2FPacketSetSlot.func_149175_c怎么用?Java S2FPacketSetSlot.func_149175_c使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.network.play.server.S2FPacketSetSlot
的用法示例。
在下文中一共展示了S2FPacketSetSlot.func_149175_c方法的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());
}
}
}
示例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());
}
}
}
示例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());
}
}
}
示例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());
}
}
}