类net.minecraft.inventory.ClickType源码实例Demo

下面列出了怎么用net.minecraft.inventory.ClickType的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: seppuku   文件: AutoTotemModule.java
@Listener
public void onUpdate(EventPlayerUpdate event) {
    if (event.getStage() == EventStageable.EventStage.PRE) {
        final Minecraft mc = Minecraft.getMinecraft();

        if(mc.currentScreen == null || mc.currentScreen instanceof GuiInventory) {
            if(mc.player.getHealth() <= this.health.getValue()) {
                final ItemStack offHand = mc.player.getHeldItemOffhand();

                if (offHand.getItem() == Items.TOTEM_OF_UNDYING) {
                    return;
                }

                final int slot = this.getItemSlot(Items.TOTEM_OF_UNDYING);

                if(slot != -1) {
                    mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
                    mc.playerController.windowClick(mc.player.inventoryContainer.windowId, 45, 0, ClickType.PICKUP, mc.player);
                    mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
                    mc.playerController.updateController();
                }
            }
        }
    }
}
 
源代码2 项目: seppuku   文件: QuickCraftModule.java
@Listener
public void onReceivePacket (EventReceivePacket event) {
    if (event.getStage() == EventStageable.EventStage.PRE) {
        if (event.getPacket() instanceof SPacketSetSlot) {
            // Check if this packet updates the recipe result and if the result is not empty
            if (((SPacketSetSlot) event.getPacket()).getSlot() == 0 && ((SPacketSetSlot) event.getPacket()).getStack().getItem() != Items.AIR) {
                Minecraft mc = Minecraft.getMinecraft();

                if (mc.currentScreen instanceof GuiInventory || mc.currentScreen instanceof GuiCrafting) {
                    mc.playerController.windowClick(mc.player.openContainer.windowId, 0, 0, ClickType.QUICK_MOVE, mc.player);
                    mc.playerController.updateController();
                }
            }
        }
    }
}
 
源代码3 项目: seppuku   文件: AutoCraftModule.java
@Listener
public void onUpdate(EventPlayerUpdate event) {
    if (event.getStage() == EventStageable.EventStage.PRE) {
        final Minecraft mc = Minecraft.getMinecraft();

        if (this.recipe.getValue().length() > 0 && this.timer.passed(this.delay.getValue())) {
            if (mc.currentScreen == null || mc.currentScreen instanceof GuiInventory || mc.currentScreen instanceof GuiCrafting) {
                mc.player.connection.sendPacket(new CPacketPlaceRecipe(mc.player.openContainer.windowId, CraftingManager.getRecipe(new ResourceLocation(this.recipe.getValue().toLowerCase())), true));

                mc.playerController.windowClick(mc.player.openContainer.windowId, 0, 0, this.drop.getValue() ? ClickType.THROW : ClickType.QUICK_MOVE, mc.player);
                mc.playerController.updateController();
            }

            this.timer.reset();
        }
    }
}
 
源代码4 项目: seppuku   文件: DupeCommand.java
@Override
public void exec(String input) {
    if (!this.clamp(input, 1, 1)) {
        this.printUsage();
        return;
    }

    final Minecraft mc = Minecraft.getMinecraft();

    if(mc.player != null) {
        for (int i = 0; i <= 45; i++) {
            mc.playerController.windowClick(mc.player.inventoryContainer.windowId, i, -1, ClickType.THROW, mc.player);
        }

        mc.player.connection.sendPacket(new CPacketUseEntity(mc.player));
    }
}
 
源代码5 项目: GregTech   文件: SlotUtil.java
private static void adjustPhantomSlot(Slot slot, int mouseButton, ClickType clickTypeIn) {
    ItemStack stackSlot = slot.getStack();
    int stackSize;
    if (clickTypeIn == ClickType.QUICK_MOVE) {
        stackSize = mouseButton == 0 ? (stackSlot.getCount() + 1) / 2 : stackSlot.getCount() * 2;
    } else {
        stackSize = mouseButton == 0 ? stackSlot.getCount() - 1 : stackSlot.getCount() + 1;
    }

    if (stackSize > slot.getSlotStackLimit()) {
        stackSize = slot.getSlotStackLimit();
    }

    stackSlot.setCount(stackSize);

    slot.putStack(stackSlot);
}
 
源代码6 项目: GT-Classic   文件: GTContainerTranslocatorFluid.java
@Nullable
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
	if (slotId == 0) {
		ItemStack stack = player.inventory.getItemStack();
		if (stack.isEmpty()) {
			this.block.setStackInSlot(0, ItemStack.EMPTY);
			this.block.filter = null;
			return ItemStack.EMPTY;
		}
		if (FluidUtil.getFluidContained(stack) != null) {
			FluidStack fluidStack = FluidUtil.getFluidContained(stack);
			FluidStack newStack = new FluidStack(fluidStack.getFluid(), 1000);
			this.block.setStackInSlot(0, ItemDisplayIcon.createWithFluidStack(newStack));
			this.block.filter = newStack;
		}
		return ItemStack.EMPTY;
	}
	return super.slotClick(slotId, dragType, clickTypeIn, player);
}
 
源代码7 项目: NotEnoughItems   文件: GuiContainer.java
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException {

    if (manager.lastKeyTyped(keyCode, typedChar)) {
        return;
    }

    if (keyCode == 1 || this.mc.gameSettings.keyBindInventory.isActiveAndMatches(keyCode)) {
        this.mc.thePlayer.closeScreen();
    }

    this.checkHotbarKeys(keyCode);

    if (this.theSlot != null && this.theSlot.getHasStack()) {
        if (this.mc.gameSettings.keyBindPickBlock.isActiveAndMatches(keyCode)) {
            managerHandleMouseClick(this.theSlot, this.theSlot.slotNumber, 0, ClickType.CLONE);
        } else if (this.mc.gameSettings.keyBindDrop.isActiveAndMatches(keyCode)) {
            managerHandleMouseClick(this.theSlot, this.theSlot.slotNumber, isCtrlKeyDown() ? 1 : 0, ClickType.THROW);
        }
    }
}
 
源代码8 项目: NotEnoughItems   文件: DefaultOverlayHandler.java
@SuppressWarnings ("unchecked")
private boolean clearIngredients(GuiContainer gui, List<PositionedStack> ingreds) {
    for (PositionedStack pstack : ingreds) {
        for (Slot slot : gui.inventorySlots.inventorySlots) {
            if (slot.xPos == pstack.relx + offsetx && slot.yPos == pstack.rely + offsety) {
                if (!slot.getHasStack()) {
                    continue;
                }

                FastTransferManager.clickSlot(gui, slot.slotNumber, 0, ClickType.QUICK_MOVE);
                if (slot.getHasStack()) {
                    return false;
                }
            }
        }
    }

    return true;
}
 
源代码9 项目: NotEnoughItems   文件: ContainerPotionCreator.java
@Override
public ItemStack slotClick(ContainerExtended container, EntityPlayer player, int button, ClickType clickType) {
    ItemStack held = player.inventory.getItemStack();
    if (button == 0 && clickType == ClickType.QUICK_MOVE) {
        NEIClientUtils.cheatItem(getStack(), button, -1);
    } else if (button == 1) {
        putStack(ItemStack.EMPTY);
    } else if (!held.isEmpty()) {
        if (isItemValid(held)) {
            putStack(ItemUtils.copyStack(held, 1));
            player.inventory.setItemStack(ItemStack.EMPTY);
        }
    } else if (getHasStack()) {
        player.inventory.setItemStack(getStack());
    }

    return ItemStack.EMPTY;
}
 
@Override
public ItemStack slotClick(int slot, int dragType, ClickType clickTypeIn,
		EntityPlayer player) {
	//Check if slot exists
			ItemStack stack;
			if(slot != -999)
				stack =  player.inventory.getStackInSlot(slot);
			else stack = null;

			if(inv != null && dragType == 0)
				//Check if anything is in the slot and set the slot value if it is
				if(stack == null) {
					inv.setSelectedSlot(-1);
				}
				else
					for(int id : OreDictionary.getOreIDs(stack)) {
						if(OreDictionary.getOreName(id).startsWith("ore") || OreDictionary.getOreName(id).startsWith("gem") || OreDictionary.getOreName(id).startsWith("dust")) {
							inv.setSelectedSlot(slot);
						}

					}

			return stack;

}
 
源代码11 项目: enderutilities   文件: ContainerQuickStacker.java
@Override
public ItemStack slotClick(int slotNum, int dragType, ClickType clickType, EntityPlayer player)
{
    ItemStack stack = ItemQuickStacker.getEnabledItem(player);

    // Middle click
    if (clickType == ClickType.CLONE && dragType == 2 && stack.isEmpty() == false)
    {
        int invSlotNum = this.getSlot(slotNum) != null ? this.getSlot(slotNum).getSlotIndex() : -1;

        if (invSlotNum != -1)
        {
            byte selected = NBTUtils.getByte(stack, ItemQuickStacker.TAG_NAME_CONTAINER, ItemQuickStacker.TAG_NAME_PRESET_SELECTION);
            long mask = NBTUtils.getLong(stack, ItemQuickStacker.TAG_NAME_CONTAINER, ItemQuickStacker.TAG_NAME_PRESET + selected);
            mask ^= (0x1L << invSlotNum);
            NBTUtils.setLong(stack, ItemQuickStacker.TAG_NAME_CONTAINER, ItemQuickStacker.TAG_NAME_PRESET + selected, mask);
        }

        return ItemStack.EMPTY;
    }

    return super.slotClick(slotNum, dragType, clickType, player);
}
 
源代码12 项目: enderutilities   文件: GuiEnderUtilities.java
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (keyCode == Keyboard.KEY_ESCAPE || this.mc.gameSettings.keyBindInventory.isActiveAndMatches(keyCode))
    {
        this.mc.player.closeScreen();
    }

    this.checkHotbarKeys(keyCode);

    Slot slot = this.getSlotUnderMouse();

    if (slot != null)
    {
        if (this.mc.gameSettings.keyBindPickBlock.isActiveAndMatches(keyCode))
        {
            this.handleMouseClick(slot, slot.slotNumber, 0, ClickType.CLONE);
        }
        else if (this.mc.gameSettings.keyBindDrop.isActiveAndMatches(keyCode))
        {
            this.handleMouseClick(slot, slot.slotNumber, isCtrlKeyDown() ? 1 : 0, ClickType.THROW);
        }
    }
}
 
源代码13 项目: enderutilities   文件: GuiEnderUtilities.java
@Override
protected void handleMouseClick(Slot slotIn, int slotId, int mouseButton, ClickType type)
{
    // Custom: middle click on a slot, with a modifier key active
    if (type == ClickType.CLONE && (isShiftKeyDown() || isCtrlKeyDown() || isAltKeyDown()))
    {
        if (slotIn != null)
        {
            slotId = slotIn.slotNumber;
        }

        int action = HotKeys.KEYCODE_MIDDLE_CLICK | HotKeys.getActiveModifierMask();

        // Send a packet to the server
        PacketHandler.INSTANCE.sendToServer(new MessageGuiAction(0, BlockPos.ORIGIN,
                ReferenceGuiIds.GUI_ID_CONTAINER_GENERIC, action, slotId));
    }
    else
    {
        super.handleMouseClick(slotIn, slotId, mouseButton, type);
    }
}
 
源代码14 项目: OpenModsLib   文件: FakeSlot.java
@Override
public ItemStack onClick(EntityPlayer player, int dragType, ClickType clickType) {
	if (clickType == ClickType.CLONE && player.capabilities.isCreativeMode) {
		ItemStack contents = getStack();
		if (!contents.isEmpty()) {
			ItemStack tmp = contents.copy();
			tmp.setCount(tmp.getMaxStackSize());
			player.inventory.setItemStack(tmp);
			return tmp;
		}
	}

	ItemStack held = player.inventory.getItemStack();

	ItemStack place = ItemStack.EMPTY;

	if (!held.isEmpty()) {
		place = held.copy();
		if (!keepSize) place.setCount(1);
	}

	inventory.setInventorySlotContents(slotNumber, place);
	onSlotChanged();
	return place;
}
 
源代码15 项目: seppuku   文件: AutoToolModule.java
@Listener
public void sendPacket(EventSendPacket event) {
    if (event.getStage() == EventStageable.EventStage.PRE) {
        if (this.send) {
            this.send = false;
            return;
        }
        if (event.getPacket() instanceof CPacketPlayerDigging && this.silent.getValue()) {
            final CPacketPlayerDigging packet = (CPacketPlayerDigging) event.getPacket();
            if (packet.getAction() == CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK) {
                this.position = packet.getPosition();
                this.facing = packet.getFacing();

                if (this.position != null && this.facing != null) {
                    final int slot = getToolInventory(packet.getPosition());
                    if (slot != -1) {
                        event.setCanceled(true);
                        Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().player.inventoryContainer.windowId, slot, Minecraft.getMinecraft().player.inventory.currentItem, ClickType.SWAP, Minecraft.getMinecraft().player);
                        send = true;
                        Minecraft.getMinecraft().player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, this.position, this.facing));
                        Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().player.inventoryContainer.windowId, slot, Minecraft.getMinecraft().player.inventory.currentItem, ClickType.SWAP, Minecraft.getMinecraft().player);
                    } else {
                        final int hotbar = getToolHotbar(packet.getPosition());
                        if (hotbar != -1) {
                            event.setCanceled(true);
                            Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().player.inventoryContainer.windowId, hotbar, Minecraft.getMinecraft().player.inventory.currentItem, ClickType.SWAP, Minecraft.getMinecraft().player);
                            send = true;
                            Minecraft.getMinecraft().player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, this.position, this.facing));
                            Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().player.inventoryContainer.windowId, hotbar, Minecraft.getMinecraft().player.inventory.currentItem, ClickType.SWAP, Minecraft.getMinecraft().player);
                        }
                    }
                }
            }
        }
    }
}
 
源代码16 项目: GregTech   文件: SlotUtil.java
public static ItemStack slotClickPhantom(Slot slot, int mouseButton, ClickType clickTypeIn, ItemStack stackHeld) {
    ItemStack stack = ItemStack.EMPTY;

    ItemStack stackSlot = slot.getStack();
    if (!stackSlot.isEmpty()) {
        stack = stackSlot.copy();
    }

    if (mouseButton == 2) {
        fillPhantomSlot(slot, ItemStack.EMPTY, mouseButton);
    } else if (mouseButton == 0 || mouseButton == 1) {

        if (stackSlot.isEmpty()) {
            if (!stackHeld.isEmpty() && slot.isItemValid(stackHeld)) {
                fillPhantomSlot(slot, stackHeld, mouseButton);
            }
        } else if (stackHeld.isEmpty()) {
            adjustPhantomSlot(slot, mouseButton, clickTypeIn);
        } else if (slot.isItemValid(stackHeld)) {
            if (areItemsEqual(stackSlot, stackHeld)) {
                adjustPhantomSlot(slot, mouseButton, clickTypeIn);
            } else {
                fillPhantomSlot(slot, stackHeld, mouseButton);
            }
        }
    } else if (mouseButton == 5) {
        if (!slot.getHasStack()) {
            fillPhantomSlot(slot, stackHeld, mouseButton);
        }
    }
    return stack;
}
 
源代码17 项目: GregTech   文件: PhantomSlotWidget.java
@Override
public void handleClientAction(int id, PacketBuffer buffer) {
    if (id == 1) {
        ItemStack stackHeld;
        try {
            stackHeld = buffer.readItemStack();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        int mouseButton = buffer.readVarInt();
        boolean shiftKeyDown = buffer.readBoolean();
        ClickType clickType = shiftKeyDown ? ClickType.QUICK_MOVE : ClickType.PICKUP;
        SlotUtil.slotClickPhantom(slotReference, mouseButton, clickType, stackHeld);
    }
}
 
源代码18 项目: GregTech   文件: MemorizedRecipeWidget.java
@Override
public ItemStack slotClick(int dragType, ClickType clickTypeIn, EntityPlayer player) {
    if (!player.world.isRemote) {
        MemorizedRecipe recipe = recipeMemory.getRecipeAtIndex(recipeIndex);
        if (recipe != null && !recipe.getRecipeResult().isEmpty()) {
            if (clickTypeIn == ClickType.PICKUP) {
                recipeMemory.loadRecipe(recipeIndex, craftingGrid);
                player.openContainer.detectAndSendChanges();
            } else if (clickTypeIn == ClickType.QUICK_MOVE) {
                recipe.setRecipeLocked(!recipe.isRecipeLocked());
            }
        }
    }
    return ItemStack.EMPTY;
}
 
源代码19 项目: GT-Classic   文件: GTContainerTranslocator.java
@Nullable
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
	if (GTHelperMath.within(slotId, 0, 8)) {
		ItemStack stack = player.inventory.getItemStack();
		this.block.setStackInSlot(slotId, stack.isEmpty() ? ItemStack.EMPTY : StackUtil.copyWithSize(stack, 1));
		return ItemStack.EMPTY;
	}
	return super.slotClick(slotId, dragType, clickTypeIn, player);
}
 
源代码20 项目: GT-Classic   文件: GTContainerQuantumChest.java
@Nullable
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
	if (slotId == 2) {
		return ItemStack.EMPTY;
	}
	if (slotId == 1) {
		this.activeplayer.player.openContainer.detectAndSendChanges();
		return super.slotClick(slotId, dragType, clickTypeIn, player);
	}
	return super.slotClick(slotId, dragType, clickTypeIn, player);
}
 
源代码21 项目: GT-Classic   文件: GTContainerItemFilter.java
@Nullable
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
	if (GTHelperMath.within(slotId, 0, 8)) {
		ItemStack stack = player.inventory.getItemStack();
		this.tile.setStackInSlot(slotId, stack.isEmpty() ? ItemStack.EMPTY : StackUtil.copyWithSize(stack, 1));
		return ItemStack.EMPTY;
	}
	return super.slotClick(slotId, dragType, clickTypeIn, player);
}
 
源代码22 项目: GT-Classic   文件: GTContainerAutocrafter.java
@Nullable
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
	// GTMod.logger.info("Slot: " + slotId);
	if (GTHelperMath.within(slotId, 18, 26)) {
		ItemStack stack = player.inventory.getItemStack();
		this.block.inventory.set(slotId, doWeirdStackCraftingStuff(stack, slotId));
		checkForMatchingRecipes();
		return ItemStack.EMPTY;
	}
	return super.slotClick(slotId, dragType, clickTypeIn, player);
}
 
源代码23 项目: ForgeHax   文件: AutoHotbarReplenish.java
private void tryPlacingHeldItem() {
  InvItem holding = LocalPlayerInventory.getMouseHeld();
  
  if (holding.isEmpty()) // all is good
  {
    return;
  }
  
  InvItem item;
  if (holding.isDamageable()) {
    item =
        LocalPlayerInventory.getSlotStorageInventory()
            .stream()
            .filter(InvItem::isNull)
            .findAny()
            .orElse(InvItem.EMPTY);
  } else {
    item =
        LocalPlayerInventory.getSlotStorageInventory()
            .stream()
            .filter(inv -> inv.isNull() || holding.isItemsEqual(inv))
            .filter(inv -> inv.isNull() || !inv.isStackMaxed())
            .max(Comparator.comparing(InvItem::getStackCount))
            .orElse(InvItem.EMPTY);
  }
  
  if (item == InvItem.EMPTY) {
    click(holding, 0, ClickType.PICKUP);
  } else {
    click(item, 0, ClickType.PICKUP);
    if (LocalPlayerInventory.getMouseHeld().nonEmpty()) {
      throw new RuntimeException();
    }
  }
}
 
源代码24 项目: ForgeHax   文件: AutoHotbarReplenish.java
private static void clickWindow(
    int slotIdIn, int usedButtonIn, ClickType modeIn, ItemStack clickedItemIn) {
  getNetworkManager()
      .sendPacket(
          new CPacketClickWindow(
              0,
              slotIdIn,
              usedButtonIn,
              modeIn,
              clickedItemIn,
              LocalPlayerInventory.getOpenContainer().getNextTransactionID(LocalPlayerInventory.getInventory()))
      );
}
 
源代码25 项目: ForgeHax   文件: AutoHotbarReplenish.java
private static ItemStack click(InvItem item, int usedButtonIn, ClickType modeIn) {
  if (item.getIndex() == -1) {
    throw new IllegalArgumentException();
  }
  ItemStack ret;
  clickWindow(
      item.getSlotNumber(),
      usedButtonIn,
      modeIn,
      ret = LocalPlayerInventory.getOpenContainer()
              .slotClick(item.getSlotNumber(), usedButtonIn, modeIn, getLocalPlayer()));
  return ret;
}
 
源代码26 项目: ForgeHax   文件: ExtraInventory.java
private static CPacketClickWindow newClickPacket(
    int slotIdIn, int usedButtonIn, ClickType modeIn, ItemStack clickedItemIn) {
  return new CPacketClickWindow(
      GUI_INVENTORY_ID,
      slotIdIn,
      usedButtonIn,
      modeIn,
      clickedItemIn,
      getCurrentContainer().getNextTransactionID(LocalPlayerInventory.getInventory()));
}
 
源代码27 项目: ForgeHax   文件: AutoBucketFallMod.java
private void swap(final int slot, final int hotbarNum) {
  MC.playerController.windowClick(
      getLocalPlayer().inventoryContainer.windowId,
      slot,
      hotbarNum,
      ClickType.SWAP,
      getLocalPlayer());
}
 
源代码28 项目: ForgeHax   文件: AutoMend.java
@SubscribeEvent
public void onUpdate(LocalPlayerUpdateEvent event) {
  if (!(LocalPlayerInventory.getOpenContainer() instanceof ContainerPlayer)) {
    return;
  }
  
  InvItem current = LocalPlayerInventory.getSelected();
  
  Optional.of(LocalPlayerInventory.getOffhand())
      .filter(this::isMendable)
      .filter(item -> !isDamaged(item))
      .ifPresent(
          offhand ->
              LocalPlayerInventory.getSlotInventory()
                  .stream()
                  .filter(this::isMendable)
                  .filter(this::isDamaged)
                  .filter(inv -> inv.getIndex() != current.getIndex())
                  .max(Comparator.comparingInt(InvItem::getDamage))
                  .ifPresent(
                      inv -> {
                        // pick up
                        LocalPlayerInventory.sendWindowClick(inv, 0, ClickType.PICKUP);
                        // place in offhand
                        LocalPlayerInventory.sendWindowClick(offhand, 0, ClickType.PICKUP);
                        // place shovel back
                        LocalPlayerInventory.sendWindowClick(inv, 0, ClickType.PICKUP);
                      }));
}
 
源代码29 项目: ForgeHax   文件: LocalPlayerInventory.java
public static void sendWindowClick(
    int slotIdIn, int usedButtonIn, ClickType modeIn, ItemStack clickedItemIn) {
  getNetworkManager()
      .sendPacket(
          new CPacketClickWindow(
              0,
              slotIdIn,
              usedButtonIn,
              modeIn,
              clickedItemIn,
              getOpenContainer().getNextTransactionID(getInventory())));
}
 
源代码30 项目: ForgeHax   文件: LocalPlayerInventory.java
public static ItemStack sendWindowClick(InvItem item, int usedButtonIn, ClickType modeIn) {
  if (item.getIndex() == -1) {
    throw new IllegalArgumentException();
  }
  ItemStack ret;
  sendWindowClick(
      item.getSlotNumber(),
      usedButtonIn,
      modeIn,
      ret =
          getOpenContainer()
              .slotClick(item.getSlotNumber(), usedButtonIn, modeIn, getLocalPlayer()));
  return ret;
}