Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/native-cooking-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -884,10 +884,12 @@ The shared UI patch now exports the query matcher, target normalizer, and raw ed
These APIs do not register a channel or replace the default cooking screen.
The production menu still publishes an empty query until name producers, transport, and widget integration are complete.

`CookingRecipeSearch` normalizes the query once and requests primary names lazily.
`NativeRecipeSearch` in `COOKING` mode normalizes the query once and requests primary names lazily.
A primary match skips the secondary-label producer. An empty query skips both producers.
The secondary branch removes native formatting codes before normalization.
The matcher does not trim spaces, split words, or substitute Java preview names.
This mode does not trim spaces, split words, or substitute Java preview names.
The same API now provides explicit player substring and word-prefix policies.
See [the player search reference](native-player-inventory.md#player-search-policies) for their rules and evidence.

`CookingSearchText` retains the latest pending raw string until a ready tick.
Equal edits still apply. An empty string remains a pending edit until that tick.
Expand Down
574 changes: 567 additions & 7 deletions docs/native-player-inventory.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 128d795d7f92c8cf0f310feda48a4fe920a8870b Mon Sep 17 00:00:00 2001
From 45e6b088e9c2a57d6c21301a8f1e508c2253f874 Mon Sep 17 00:00:00 2001
From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com>
Date: Sun, 18 Oct 2026 16:55:37 +0200
Subject: [PATCH] feat(inventory): translate server-authoritative Bedrock
Expand Down Expand Up @@ -7555,7 +7555,7 @@ index a3ac81345..a3b933c2a 100644
+ public static final String WORKBENCH = "workbench";
}
diff --git a/src/main/java/net/raphimc/viabedrock/protocol/model/BuiltinItemFactories.java b/src/main/java/net/raphimc/viabedrock/protocol/model/BuiltinItemFactories.java
index 928f2175b..90a202d8a 100644
index 3a5180c25..d7b5b49e7 100644
--- a/src/main/java/net/raphimc/viabedrock/protocol/model/BuiltinItemFactories.java
+++ b/src/main/java/net/raphimc/viabedrock/protocol/model/BuiltinItemFactories.java
@@ -5,6 +5,7 @@
Expand Down Expand Up @@ -7592,11 +7592,11 @@ index 928f2175b..90a202d8a 100644
for (final var name : factory.getAsJsonArray("identifiers")) {
final String identifier = name.getAsString();
final String description = componentDescriptions.has(identifier) ? componentDescriptions.get(identifier).getAsString() : null;
- if (factories.putIfAbsent(identifier, new Definition(version, stacking, description, names.get(identifier))) != null) {
- if (factories.putIfAbsent(identifier, new Definition(version, stacking, description, names.get(identifier), factory.get("creativeCategory").getAsInt())) != null) {
+ final String block = blocks.contains(identifier) ? identifier
+ : blockAliases.has(identifier) ? blockAliases.get(identifier).getAsString() : null;
+ final var traits = new ItemCookingProperties(food.contains(identifier), block, replacements.contains(identifier));
+ if (factories.putIfAbsent(identifier, new Definition(version, stacking, description, names.get(identifier), traits)) != null) {
+ if (factories.putIfAbsent(identifier, new Definition(version, stacking, description, names.get(identifier), factory.get("creativeCategory").getAsInt(), traits)) != null) {
throw new IllegalStateException("Duplicate native item factory: " + identifier);
}
}
Expand All @@ -7616,8 +7616,8 @@ index 928f2175b..90a202d8a 100644
+
private BuiltinItemFactories() { }

- record Definition(ItemVersion version, ItemStackingProperties stacking, String componentDescription, BuiltinItemName ordinaryName) { }
+ record Definition(ItemVersion version, ItemStackingProperties stacking, String componentDescription, BuiltinItemName ordinaryName, ItemCookingProperties cooking) { }
- record Definition(ItemVersion version, ItemStackingProperties stacking, String componentDescription, BuiltinItemName ordinaryName, int creativeCategory) { }
+ record Definition(ItemVersion version, ItemStackingProperties stacking, String componentDescription, BuiltinItemName ordinaryName, int creativeCategory, ItemCookingProperties cooking) { }

}
diff --git a/src/main/java/net/raphimc/viabedrock/protocol/model/ItemBlockPlacer.java b/src/main/java/net/raphimc/viabedrock/protocol/model/ItemBlockPlacer.java
Expand Down Expand Up @@ -7747,10 +7747,10 @@ index 000000000..19e0148c5
+
+}
diff --git a/src/main/java/net/raphimc/viabedrock/protocol/model/ItemRegistry.java b/src/main/java/net/raphimc/viabedrock/protocol/model/ItemRegistry.java
index 8e1217d5a..88f258dbb 100644
index c20f5563f..d8bf335cc 100644
--- a/src/main/java/net/raphimc/viabedrock/protocol/model/ItemRegistry.java
+++ b/src/main/java/net/raphimc/viabedrock/protocol/model/ItemRegistry.java
@@ -12,6 +12,8 @@ import com.viaversion.nbt.tag.CompoundTag;
@@ -13,6 +13,8 @@ import com.viaversion.nbt.tag.IntTag;
import com.viaversion.nbt.tag.StringTag;
import com.viaversion.viaversion.util.Key;
import net.raphimc.viabedrock.api.model.NativeItemNames;
Expand All @@ -7759,7 +7759,7 @@ index 8e1217d5a..88f258dbb 100644
import net.raphimc.viabedrock.protocol.data.enums.bedrock.generated.ItemVersion;

import java.util.HashMap;
@@ -20,6 +22,8 @@ import java.util.LinkedHashMap;
@@ -21,6 +23,8 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -7768,8 +7768,8 @@ index 8e1217d5a..88f258dbb 100644
import java.util.stream.Collectors;

/** One connection's item IDs and the complete definitions that own those IDs. */
@@ -78,6 +82,75 @@ public final class ItemRegistry {
return identifier != null ? this.definitions.get(identifier) : null;
@@ -131,6 +135,75 @@ public final class ItemRegistry {
return Map.copyOf(result);
}

+ /** Named descriptors narrow to signed-short metadata before resolving concrete identity. */
Expand Down Expand Up @@ -10037,7 +10037,7 @@ index 85cdb3dee..a98ad8137 100644

final BlockEntity javaBlockEntity = BlockEntityRewriter.toJava(wrapper.user(), chunkTracker.getBlockState(bedrockBlockEntity.position()), bedrockBlockEntity);
diff --git a/src/main/java/net/raphimc/viabedrock/protocol/rewriter/ItemRewriter.java b/src/main/java/net/raphimc/viabedrock/protocol/rewriter/ItemRewriter.java
index 234767d2c..771a85f95 100644
index ee57e8c94..26915529d 100644
--- a/src/main/java/net/raphimc/viabedrock/protocol/rewriter/ItemRewriter.java
+++ b/src/main/java/net/raphimc/viabedrock/protocol/rewriter/ItemRewriter.java
@@ -36,6 +36,7 @@ import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
Expand Down Expand Up @@ -10423,7 +10423,7 @@ index 234767d2c..771a85f95 100644
}

/** Match network-loaded stack queries while their connection registry remains current. */
@@ -428,6 +556,18 @@ public class ItemRewriter extends StoredObject {
@@ -438,6 +566,18 @@ public class ItemRewriter extends StoredObject {
return properties == null ? 0 : properties.maximum();
}

Expand All @@ -10442,7 +10442,7 @@ index 234767d2c..771a85f95 100644
public Type<BedrockItem> itemType() {
return this.itemType;
}
@@ -452,10 +592,13 @@ public class ItemRewriter extends StoredObject {
@@ -462,10 +602,13 @@ public class ItemRewriter extends StoredObject {
return this.newItemArrayType;
}

Expand Down Expand Up @@ -14560,7 +14560,7 @@ index 000000000..80861941e
+
+}
diff --git a/src/test/java/net/raphimc/viabedrock/protocol/model/ItemRegistryTest.java b/src/test/java/net/raphimc/viabedrock/protocol/model/ItemRegistryTest.java
index eaf0eb96f..91dd1e997 100644
index 2e960c452..69094a65f 100644
--- a/src/test/java/net/raphimc/viabedrock/protocol/model/ItemRegistryTest.java
+++ b/src/test/java/net/raphimc/viabedrock/protocol/model/ItemRegistryTest.java
@@ -6,13 +6,24 @@
Expand Down Expand Up @@ -14893,8 +14893,8 @@ index eaf0eb96f..91dd1e997 100644
@Test
void legacyReferencesPreserveExistingBuiltinFactoriesAndTheirComponentLayout() {
final String identifier = "minecraft:hopper";
@@ -331,6 +626,24 @@ class ItemRegistryTest {
assertTrue(apple.componentItems().isEmpty());
@@ -401,6 +696,24 @@ class ItemRegistryTest {
return new ItemEntry(identifier, id, true, version, data);
}

+ @Test
Expand Down
Loading
Loading