Skip to content

Commit b0ee80d

Browse files
committed
v1.0.1
1 parent 2ffbf56 commit b0ee80d

3 files changed

Lines changed: 35 additions & 18 deletions

File tree

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ The vanilla Pick Block function requires an exact item match. ExtendedPick intro
1818
### 2. Deep Search (Container Support)
1919
If the item isn't found in your main inventory, ExtendedPick can search **inside** item containers (like Backpacks, Shulker Boxes, or Bundles) that you are carrying.
2020
- This is handled via the `IDeepSearchProvider` API.
21+
- **Forge Capability Support**: Items implementing `ForgeCapabilities.ITEM_HANDLER` are supported automatically by default.
2122
- If the item is found inside a container, the mod communicates with the server to extract it automatically (configurable).
22-
2323
### 3. Advanced Creative Entity Picking
2424
Enhances Creative Mode picking for entities:
2525
- **Ctrl + Pick Block (Middle Click)** on an Entity will copy the Entity with its full NBT data (excluding position/UUID), allowing you to place down an exact copy of that mob.
2626

27-
### 4. Configurable
27+
### 4. JEI Recipe Transfer Integration
28+
Extends the "Deep Search" logic to **Just Enough Items (JEI)**.
29+
- When clicking the "+" button to transfer a recipe into a crafting grid, ExtendedPick will automatically search for and extract required ingredients from inside your carried containers (Backpacks, etc.) if they are missing from your main inventory.
30+
31+
### 5. Configurable
2832
The mod allows customization via `ExtendedPickClientConfig`:
2933
- Toggle Deep Search.
3034
- Enable/Disable debug logging for picking actions.
@@ -45,18 +49,22 @@ public class MyISearchHelper implements ISearchHelper {
4549
}
4650
```
4751

48-
### `IDeepSearchProvider`
49-
Implement this interface to allow ExtendedPick to look inside your mod's containers (e.g., backpacks).
52+
### `IDeepSearchProvider<T>`
53+
Implement this interface to allow ExtendedPick to look inside your mod's containers. `T` represents your internal index type (e.g., `Integer` for slot ID).
54+
5055
```java
51-
public class MyBackpackProvider implements IDeepSearchProvider {
56+
public class MyBackpackProvider implements IDeepSearchProvider<Integer> {
5257
@Override
53-
public void forEachItem(ItemStack container, Consumer<IndexedStack> action) {
54-
// Logic to iterate container contents
58+
public void forEachItem(@NotNull ItemStack container, @NotNull Predicate<IndexedStack<Integer>> action) {
59+
// Logic to iterate container contents. Return true/false in predicate to continue/stop.
5560
}
5661

62+
@NotNull
5763
@Override
58-
public ItemStack extract(ServerPlayer player, ItemStack container, int index) {
59-
// Logic to remove item from container and give to player
64+
public ItemStack extract(@NotNull ServerPlayer player, @NotNull ItemStack container, @NotNull Integer index, int amount, boolean simulate) {
65+
// Logic to remove item from container and return it
66+
// amount: 0 (MAX_STACK_SIZE) or specific count
67+
// simulate: if true, do not actually modify the stack
6068
}
6169
}
6270
```

README_zh_CN.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
### 2. 深度搜索 (Deep Search)
1313
如果物品不在你的主物品栏中,ExtendedPick 可以搜索你携带的**容器物品内部**(例如背包、潜影盒或收纳袋)。
1414
- 这是通过 `IDeepSearchProvider` API 实现的。
15+
- **Forge 能力支持**:默认情况下,任何实现了 `ForgeCapabilities.ITEM_HANDLER` 的物品都会被自动支持。
1516
- 如果在容器内找到了目标物品,模组会向服务器发送数据包,自动将其提取出来(此功能可配置)。
1617

1718
### 3. 创造模式实体增强
1819
增强了创造模式下对实体的选取功能:
1920
- **Ctrl + 中键** 点击实体:将复制该实体及其完整的 NBT 数据(排除坐标/UUID),让你能生成一个属性完全相同的生物副本。
2021

21-
### 4. 高度可配置
22+
### 4. JEI 配方转移集成
23+
将“深度搜索”逻辑延伸至 **Just Enough Items (JEI)**
24+
- 当点击 JEI 中的“+”号按钮将配方转移到合成表时,如果主物品栏缺少材料,ExtendedPick 会自动检索并从你携带的容器(如背包)中提取所需原材料。
25+
26+
### 5. 高度可配置
2227
可以通过 `ExtendedPickClientConfig` 进行自定义:
2328
- 开启/关闭深度搜索。
2429
- 开启/关闭选取操作的调试日志 (Debug Log)。
@@ -39,18 +44,22 @@ public class MyISearchHelper implements ISearchHelper {
3944
}
4045
```
4146

42-
### `IDeepSearchProvider`
43-
实现此接口以允许 ExtendedPick 搜索你模组中的容器(如背包)。
47+
### `IDeepSearchProvider<T>`
48+
实现此接口以允许 ExtendedPick 搜索你模组中的容器(如背包)。`T` 代表你的内部索引类型(例如槽位 ID 的 `Integer`)。
49+
4450
```java
45-
public class MyBackpackProvider implements IDeepSearchProvider {
51+
public class MyBackpackProvider implements IDeepSearchProvider<Integer> {
4652
@Override
47-
public void forEachItem(ItemStack container, Consumer<IndexedStack> action) {
48-
// 遍历容器内容的逻辑
53+
public void forEachItem(@NotNull ItemStack container, @NotNull Predicate<IndexedStack<Integer>> action) {
54+
// 遍历容器内容的逻辑。Predicate 返回 true 继续,false 停止。
4955
}
5056

57+
@NotNull
5158
@Override
52-
public ItemStack extract(ServerPlayer player, ItemStack container, int index) {
53-
// 从容器中提取物品并交给玩家的逻辑
59+
public ItemStack extract(@NotNull ServerPlayer player, @NotNull ItemStack container, @NotNull Integer index, int amount, boolean simulate) {
60+
// 从容器中提取物品的逻辑
61+
// amount: 提取数量(为 0 时表示最大堆叠)
62+
// simulate: 是否仅模拟(为 true 时不应修改实际物品堆叠)
5463
}
5564
}
5665
```

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mod_name=ExtendedPick
3838
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3939
mod_license=MIT
4040
# The mod version. See https://semver.org/
41-
mod_version=1.0.0
41+
mod_version=1.0.1
4242
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
4343
# This should match the base package used for the mod sources.
4444
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

0 commit comments

Comments
 (0)