本文整理汇总了Java中codechicken.core.inventory.SlotDummy类的典型用法代码示例。如果您正苦于以下问题:Java SlotDummy类的具体用法?Java SlotDummy怎么用?Java SlotDummy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SlotDummy类属于codechicken.core.inventory包,在下文中一共展示了SlotDummy类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleDummySlotSet
import codechicken.core.inventory.SlotDummy; //导入依赖的package包/类
private void handleDummySlotSet(EntityPlayerMP sender, PacketCustom packet) {
int slotNumber = packet.readShort();
ItemStack stack = packet.readItemStack(true);
Slot slot = sender.openContainer.getSlot(slotNumber);
if (slot instanceof SlotDummy)
slot.putStack(stack);
}
示例2: handleDragNDrop
import codechicken.core.inventory.SlotDummy; //导入依赖的package包/类
@Override
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button)
{
Slot slot = gui.getSlotAtPosition(mousex, mousey);
if(slot instanceof SlotDummy && slot.isItemValid(draggedStack) && gui.inventorySlots instanceof ContainerExtended)
{
((SlotDummy)slot).slotClick(draggedStack, button, NEIClientUtils.shiftKey());
NEICPH.sendDummySlotSet(slot.slotNumber, slot.getStack());
return true;
}
return false;
}
示例3: handleDummySlotSet
import codechicken.core.inventory.SlotDummy; //导入依赖的package包/类
private void handleDummySlotSet(EntityPlayerMP sender, PacketCustom packet) {
Slot slot = sender.openContainer.getSlot(packet.readShort());
if (slot instanceof SlotDummy)
slot.putStack(packet.readItemStack());
}