@jsprismarine/items 0.23.2-unstable-20261121083634 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -4
- package/dist/index.js +2 -2
- package/dist/projection.d.ts +7 -0
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +9 -2
- package/dist/projection.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @jsprismarine/items
|
|
2
2
|
|
|
3
|
-
## 0.23.2
|
|
3
|
+
## 0.23.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [[`
|
|
8
|
-
- @jsprismarine/errors@0.23.2
|
|
9
|
-
- @jsprismarine/content@0.23.2
|
|
7
|
+
- Updated dependencies [[`5f48cd1`](https://github.com/JSPrismarine/JSPrismarine/commit/5f48cd10e4ca5b53ef19ebd214b70b1de18acca9)]:
|
|
8
|
+
- @jsprismarine/errors@0.23.2
|
|
9
|
+
- @jsprismarine/content@0.23.2
|
|
10
10
|
|
|
11
11
|
## 0.23.1
|
|
12
12
|
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { ITEM_COMPONENTS, ITEM_COMPONENT_NAMES, createItemComponentRegistry } fr
|
|
|
12
12
|
import { ItemStack, canStack, componentValuesEqual, maxStackSizeOf, mergeStacks, patchesEqual, sameItemSameComponents } from "./ItemStack.js";
|
|
13
13
|
import { ITEM_FLAGS, ITEM_REGISTRY_NAME, loadItemTypes, readItemComponents, vanillaItemDefinitions } from "./itemTypes.js";
|
|
14
14
|
import { DEFAULT_PROVIDER_CONTEXT, FAST_COOKING_CONTEXT, evaluateNumberProvider } from "./numberProvider.js";
|
|
15
|
-
import { BEDROCK_ONLY_ITEM_PROPERTIES, UNPROJECTED_BEDROCK_COMPONENTS, enchantableSlotOf, projectItemToBedrock } from "./projection.js";
|
|
15
|
+
import { BEDROCK_ONLY_ITEM_PROPERTIES, UNPROJECTED_BEDROCK_COMPONENTS, cooldownCategoryOf, enchantableSlotOf, projectItemToBedrock } from "./projection.js";
|
|
16
16
|
import { bool, compound, either, float, holderSet, identifier, int, json, listOf, literalOf, mapOf, numberSource, object, parsedOr, text, textComponent } from "./schema.js";
|
|
17
17
|
import { itemTypesTable } from "./tables.js";
|
|
18
|
-
export { BEDROCK_ONLY_ITEM_PROPERTIES, DEFAULTED_COMPONENTS, DEFAULT_PROVIDER_CONTEXT, EQUIPMENT_SLOTS, EXCEPTED_JAVA_ITEMS, FAST_COOKING_CONTEXT, ITEM_COMPONENTS, ITEM_COMPONENT_NAMES, ITEM_FLAGS, ITEM_HOOKS, ITEM_REGISTRY_NAME, ITEM_TABLE_EXCEPTIONS, ItemStack, RARITIES, STACK_ONLY_COMPONENTS, UNIVERSAL_COMPONENTS, UNPROJECTED_BEDROCK_COMPONENTS, UNVERIFIED_SHAPE_COMPONENTS, additionalTradeCost, animation, attackAnimation, attackRange, attributeModifier, attributeModifiers, attributeOperation, axolotlVariant, bannerPatterns, baseColor, bees, blockEntityData, blockPos, blockState, blockTransformer, blocksAttacks, bookPage, bool, breakSound, brewingFuel, bucketEntityData, buildBedrockItemTags, bundleContents, burnTimeOf, canBreak, canPlaceOn, canStack, catCollar, catSoundVariant, catVariant, chargedProjectiles, chickenSoundVariant, chickenVariant, componentValuesEqual, compostable, compound, consumable, consumeEffect, container, containerLoot, cookingFuel, cowSoundVariant, cowVariant, createItemComponentRegistry, creativeSlotLock, cushionColor, customData, customModelData, customName, damage, damageReduction, damageResistant, damageType, dataComponent, deathProtection, debugStickState, defineItemComponent, dye, dyedColor, either, enchantable, enchantableSlotOf, enchantmentGlintOverride, enchantmentLevels, enchantments, entityData, equipmentSlot, equippable, evaluateNumberProvider, fireworkExplosion, fireworkExplosionComponent, fireworks, flattenItemFacts, float, food, foxVariant, frogVariant, glider, holderSet, horseVariant, identifier, instrument, int, intangibleProjectile, interactAnimation, itemDamageFunction, itemDefinition, itemFactColumns, itemModel, itemName, itemStackReference, itemTypesTable, json, jukeboxPlayable, kineticWeapon, listOf, literalOf, llamaVariant, loadItemTypes, lock, lodestoneTracker, lore, mapDecorations, mapId, mapOf, mapPostProcessing, maxDamage, maxStackSize, maxStackSizeOf, mergeStacks, minimumAttackCharge, mobVisibility, mooshroomVariant, noteBlockSound, numberSource, object, ominousBottleAmplifier, opaque, paintingVariant, parrotVariant, parsedOr, patchesEqual, piercingWeapon, pigSoundVariant, pigVariant, potDecorations, potionContents, potionDurationScale, profile, projectItemToBedrock, providesBannerPatterns, providesPotteryPattern, providesTrimMaterial, rabbitVariant, range, rarity, readItemComponents, recipes, repairCost, repairable, salmonSize, sameItemSameComponents, sheepColor, shulkerColor, signText, signTextBack, signTextFront, storedEnchantments, sulfurCubeContent, suspiciousStewEffects, text, textComponent, textComponentList, tool, toolRule, tooltipDisplay, tooltipStyle, trim, tropicalFishBaseColor, tropicalFishPattern, tropicalFishPatternColor, unbreakable, useCooldown, useEffects, useRemainder, vanillaItemDefinitions, villagerFood, villagerVariant, waxed, weapon, wolfCollar, wolfSoundVariant, wolfVariant, writableBookContent, writtenBookContent, zombieNautilusVariant };
|
|
18
|
+
export { BEDROCK_ONLY_ITEM_PROPERTIES, DEFAULTED_COMPONENTS, DEFAULT_PROVIDER_CONTEXT, EQUIPMENT_SLOTS, EXCEPTED_JAVA_ITEMS, FAST_COOKING_CONTEXT, ITEM_COMPONENTS, ITEM_COMPONENT_NAMES, ITEM_FLAGS, ITEM_HOOKS, ITEM_REGISTRY_NAME, ITEM_TABLE_EXCEPTIONS, ItemStack, RARITIES, STACK_ONLY_COMPONENTS, UNIVERSAL_COMPONENTS, UNPROJECTED_BEDROCK_COMPONENTS, UNVERIFIED_SHAPE_COMPONENTS, additionalTradeCost, animation, attackAnimation, attackRange, attributeModifier, attributeModifiers, attributeOperation, axolotlVariant, bannerPatterns, baseColor, bees, blockEntityData, blockPos, blockState, blockTransformer, blocksAttacks, bookPage, bool, breakSound, brewingFuel, bucketEntityData, buildBedrockItemTags, bundleContents, burnTimeOf, canBreak, canPlaceOn, canStack, catCollar, catSoundVariant, catVariant, chargedProjectiles, chickenSoundVariant, chickenVariant, componentValuesEqual, compostable, compound, consumable, consumeEffect, container, containerLoot, cookingFuel, cooldownCategoryOf, cowSoundVariant, cowVariant, createItemComponentRegistry, creativeSlotLock, cushionColor, customData, customModelData, customName, damage, damageReduction, damageResistant, damageType, dataComponent, deathProtection, debugStickState, defineItemComponent, dye, dyedColor, either, enchantable, enchantableSlotOf, enchantmentGlintOverride, enchantmentLevels, enchantments, entityData, equipmentSlot, equippable, evaluateNumberProvider, fireworkExplosion, fireworkExplosionComponent, fireworks, flattenItemFacts, float, food, foxVariant, frogVariant, glider, holderSet, horseVariant, identifier, instrument, int, intangibleProjectile, interactAnimation, itemDamageFunction, itemDefinition, itemFactColumns, itemModel, itemName, itemStackReference, itemTypesTable, json, jukeboxPlayable, kineticWeapon, listOf, literalOf, llamaVariant, loadItemTypes, lock, lodestoneTracker, lore, mapDecorations, mapId, mapOf, mapPostProcessing, maxDamage, maxStackSize, maxStackSizeOf, mergeStacks, minimumAttackCharge, mobVisibility, mooshroomVariant, noteBlockSound, numberSource, object, ominousBottleAmplifier, opaque, paintingVariant, parrotVariant, parsedOr, patchesEqual, piercingWeapon, pigSoundVariant, pigVariant, potDecorations, potionContents, potionDurationScale, profile, projectItemToBedrock, providesBannerPatterns, providesPotteryPattern, providesTrimMaterial, rabbitVariant, range, rarity, readItemComponents, recipes, repairCost, repairable, salmonSize, sameItemSameComponents, sheepColor, shulkerColor, signText, signTextBack, signTextFront, storedEnchantments, sulfurCubeContent, suspiciousStewEffects, text, textComponent, textComponentList, tool, toolRule, tooltipDisplay, tooltipStyle, trim, tropicalFishBaseColor, tropicalFishPattern, tropicalFishPatternColor, unbreakable, useCooldown, useEffects, useRemainder, vanillaItemDefinitions, villagerFood, villagerVariant, waxed, weapon, wolfCollar, wolfSoundVariant, wolfVariant, writableBookContent, writtenBookContent, zombieNautilusVariant };
|
package/dist/projection.d.ts
CHANGED
|
@@ -166,6 +166,13 @@ export declare const BEDROCK_ONLY_ITEM_PROPERTIES: readonly ['creative_category'
|
|
|
166
166
|
* Bedrock components this projection does not yet derive from Java item data.
|
|
167
167
|
*/
|
|
168
168
|
export declare const UNPROJECTED_BEDROCK_COMPONENTS: {};
|
|
169
|
+
/**
|
|
170
|
+
* The Bedrock cooldown category an item's cooldown runs under: Java's cooldown group, which is the
|
|
171
|
+
* `minecraft:use_cooldown` group or else the item's own identifier, without the `minecraft:`
|
|
172
|
+
* namespace, the way the client's `minecraft:cooldown` component and
|
|
173
|
+
* `PlayerStartItemCooldownPacket` name it.
|
|
174
|
+
*/
|
|
175
|
+
export declare const cooldownCategoryOf: (type: ItemType) => string;
|
|
169
176
|
/**
|
|
170
177
|
* Picks the Bedrock enchanting category for an item.
|
|
171
178
|
*
|
package/dist/projection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sources":["../src/projection.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMxD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yEAAyE;IACzE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IAC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kB,SAAU,QAAQ,KAAG,MACuC,CAAC;AAE5F;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,SAAU,QAAQ,KAAG,MAiBlD,CAAC;AAuCF,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAC9B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACvD,oEAAoE;IACpE,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAChE,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC5D,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACjE,gFAAgF;IAChF,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAoDD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,SAAU,QAAQ,YAAW,iBAAiB,KAAQ,qBAiJtF,CAAC"}
|
package/dist/projection.js
CHANGED
|
@@ -134,6 +134,13 @@ var ARMOR_SLOTS = {
|
|
|
134
134
|
body: "g_armor"
|
|
135
135
|
};
|
|
136
136
|
/**
|
|
137
|
+
* The Bedrock cooldown category an item's cooldown runs under: Java's cooldown group, which is the
|
|
138
|
+
* `minecraft:use_cooldown` group or else the item's own identifier, without the `minecraft:`
|
|
139
|
+
* namespace, the way the client's `minecraft:cooldown` component and
|
|
140
|
+
* `PlayerStartItemCooldownPacket` name it.
|
|
141
|
+
*/
|
|
142
|
+
var cooldownCategoryOf = (type) => (type.params(useCooldown)?.cooldown_group ?? type.identifier).replace("minecraft:", "");
|
|
143
|
+
/**
|
|
137
144
|
* Picks the Bedrock enchanting category for an item.
|
|
138
145
|
*
|
|
139
146
|
* Java has no such field, so it is derived: the `mineable/*` tag in the
|
|
@@ -332,7 +339,7 @@ var projectItemToBedrock = (type, options = {}) => {
|
|
|
332
339
|
if (resistant?.types.kind === "tag" && resistant.types.tag === "minecraft:is_fire") projected["minecraft:fire_resistant"] = { value: true };
|
|
333
340
|
const cooldown = type.params(useCooldown);
|
|
334
341
|
if (cooldown !== void 0) projected["minecraft:cooldown"] = {
|
|
335
|
-
category: (
|
|
342
|
+
category: cooldownCategoryOf(type),
|
|
336
343
|
duration: cooldown.seconds,
|
|
337
344
|
type: "use"
|
|
338
345
|
};
|
|
@@ -343,6 +350,6 @@ var projectItemToBedrock = (type, options = {}) => {
|
|
|
343
350
|
}
|
|
344
351
|
return projected;
|
|
345
352
|
};
|
|
346
|
-
export { BEDROCK_ONLY_ITEM_PROPERTIES, UNPROJECTED_BEDROCK_COMPONENTS, enchantableSlotOf, projectItemToBedrock };
|
|
353
|
+
export { BEDROCK_ONLY_ITEM_PROPERTIES, UNPROJECTED_BEDROCK_COMPONENTS, cooldownCategoryOf, enchantableSlotOf, projectItemToBedrock };
|
|
347
354
|
|
|
348
355
|
//# sourceMappingURL=projection.js.map
|
package/dist/projection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","names":[],"sources":["../src/projection.ts"],"sourcesContent":["/**\n * The Bedrock item component projection: what the client is told about an\n * item whose properties came from Java.\n *\n * The two editions name the same facts differently. Java's `max_damage` is\n * Bedrock's `minecraft:durability.max_durability`, Java's `food.saturation`\n * is an absolute value where Bedrock's `saturation_modifier` is a ratio, and\n * Bedrock keeps a flat `item_properties` compound beside the named\n * components. Every shape below is read off a Bedrock Dedicated Server\n * 1.26.51.1 capture, the `item_components.nbt` golden in\n * `@jsprismarine/bedrock-data`, rather than written from the documentation.\n *\n * This module builds the compound. It does not send it: `ItemRegistryPacket`\n * belongs to the protocol package.\n */\nimport {\n blocksAttacks,\n compostable,\n consumable,\n cookingFuel,\n damageResistant,\n enchantable,\n enchantmentGlintOverride,\n equippable,\n food,\n glider,\n kineticWeapon,\n maxDamage,\n piercingWeapon,\n repairable,\n tool,\n useCooldown,\n useRemainder,\n weapon\n} from './components/defaults';\nimport { attributeModifiers, maxStackSize, useEffects } from './components/universal';\nimport type { ItemType } from './hooks';\nimport type { ProviderContext } from './numberProvider';\nimport { DEFAULT_PROVIDER_CONTEXT, evaluateNumberProvider } from './numberProvider';\nimport type { HolderSet } from './schema';\nimport { isRecord } from './isRecord';\nimport { NumberProviderError } from '@jsprismarine/errors/items';\n\n/**\n * The flat `item_properties` compound, with the nineteen keys a Bedrock\n * Dedicated Server writes for a data-driven item. Only the keys Java's\n * components decide are produced here; see {@link BEDROCK_ONLY_ITEM_PROPERTIES}.\n */\nexport interface BedrockItemProperties {\n /** How many fit in a slot. */\n max_stack_size?: number;\n /** Attack damage the item adds, in half hearts. */\n damage?: number;\n /** Whether the item is held out in front, which tools and weapons are. */\n hand_equipped?: boolean;\n /** Whether the enchantment glint is drawn regardless of enchantments. */\n foil?: boolean;\n /** Which enchanting table category the item belongs to, `none` when it takes none. */\n enchantable_slot?: string;\n /** The enchanting power the item brings. */\n enchantable_value?: number;\n /** How long a held use runs, in ticks. */\n use_duration?: number;\n /** The use animation id; 0 is none and 1 is eating. */\n use_animation?: number;\n /** Whether the item breaks blocks in creative mode. */\n can_destroy_in_creative?: boolean;\n /** Whether the item can be used while a liquid occupies the target. */\n liquid_clipped?: boolean;\n /** The base mining speed multiplier. */\n mining_speed?: number;\n /** Whether the item can be held in the off hand. */\n allow_off_hand?: boolean;\n /** Whether a dropped item stack despawns. */\n should_despawn?: boolean;\n /** Whether stacks with different auxiliary values stay separate. */\n stacked_by_data?: boolean;\n}\n\n/** The compound an item's `Item Component Data` carries, keyed the way Bedrock keys it. */\nexport interface BedrockItemComponents {\n item_properties: BedrockItemProperties;\n /** Bedrock's resolved item tag names, serialized separately from named components. */\n item_tags?: readonly string[];\n /** The block a Bedrock-defined item places, with its placement restrictions. */\n 'minecraft:block_placer'?: BedrockBlockPlacerComponent;\n /** The explicit display name from the active Bedrock item definition. */\n 'minecraft:display_name'?: { value: string };\n /** Resource pack icon textures declared by the active Bedrock item definition. */\n 'minecraft:icon'?: { textures: Readonly<Record<string, string>> };\n 'minecraft:max_stack_size'?: { value: number };\n 'minecraft:damage'?: { value: number };\n 'minecraft:durability'?: { max_durability: number; damage_chance: { min: number; max: number } };\n 'minecraft:enchantable'?: { slot: string; value: number };\n 'minecraft:food'?: {\n nutrition: number;\n saturation_modifier: number;\n can_always_eat: boolean;\n using_converts_to?: string;\n };\n 'minecraft:use_duration'?: number;\n 'minecraft:use_animation'?: { value: string };\n 'minecraft:use_modifiers'?: { use_duration: number; movement_modifier: number };\n /** Java's repair materials, expanded and mapped to Bedrock item identifiers. */\n 'minecraft:repairable'?: BedrockRepairableComponent;\n /** Java's tool rules, expanded and mapped to Bedrock block identifiers. */\n 'minecraft:digger'?: BedrockDiggerComponent;\n 'minecraft:fuel'?: { duration: number };\n 'minecraft:compostable'?: { composting_chance: number };\n 'minecraft:fire_resistant'?: { value: boolean };\n 'minecraft:hand_equipped'?: { value: boolean };\n 'minecraft:cooldown'?: { category: string; duration: number; type: string };\n 'minecraft:wearable'?: { slot: string; protection: number };\n}\n\n/** One group of Bedrock items that can repair the item. */\nexport interface BedrockRepairableItem {\n /** Bedrock item identifiers accepted as repair materials. */\n readonly items: readonly string[];\n}\n\n/** The Bedrock repair rules projected from Java's `minecraft:repairable`. */\nexport interface BedrockRepairableComponent {\n /** Repair material groups accepted by Bedrock's anvil UI. */\n readonly repairItems: readonly BedrockRepairableItem[];\n}\n\n/** One Bedrock digging speed, resolved to a block the client knows. */\nexport interface BedrockDiggerRule {\n /** The Bedrock block identifier this speed applies to. */\n readonly block: string;\n /** The integer speed multiplier Bedrock's item component accepts. */\n readonly speed: number;\n}\n\n/** The Bedrock digging rules projected from Java's `minecraft:tool`. */\nexport interface BedrockDiggerComponent {\n /** The ordered block speeds the item applies while mining. */\n readonly destroySpeeds: readonly BedrockDiggerRule[];\n /** Whether Bedrock applies its Efficiency enchantment bonus to this item. */\n readonly useEfficiency: boolean;\n}\n\n/** One block selector accepted by `minecraft:block_placer.use_on`. */\nexport interface BedrockItemBlockDescriptor {\n /** The block identifier, when the selector names one block. */\n readonly name?: string;\n /** The block state values that further narrow the named block. */\n readonly states?: Readonly<Record<string, string | number | boolean>>;\n /** The Bedrock query that selects blocks by their tags. */\n readonly tags?: string;\n}\n\n/** The resolved Bedrock block placement component sent to the client. */\nexport interface BedrockBlockPlacerComponent {\n /** The block placed when this item is used. */\n readonly block?: string;\n /** Whether placement follows the player's alignment while interacting. */\n readonly alignedPlacement: boolean;\n /** Whether the block supplies the item icon when no icon is declared. */\n readonly canUseBlockAsIcon: boolean;\n /** Whether this item is the default item returned for its block. */\n readonly replaceBlockItem: boolean;\n /** Blocks on which the item may be used. Empty means all blocks. */\n readonly useOn: readonly (string | BedrockItemBlockDescriptor)[];\n}\n\n/**\n * The `item_properties` keys with no Java item-property source, so the\n * protocol layer supplies captured defaults unless an active Bedrock item\n * component provides a value.\n * `creative_category` and `creative_group` come from the creative item\n * catalog, `frame_count` from the resource pack's icon animation, and the\n * other three have no Java source at all.\n */\nexport const BEDROCK_ONLY_ITEM_PROPERTIES = [\n 'creative_category',\n 'creative_group',\n 'frame_count',\n 'hidden_in_commands',\n 'liquid_clipped',\n 'should_despawn',\n 'stacked_by_data'\n] as const;\n\n/**\n * Bedrock components this projection does not yet derive from Java item data.\n */\nexport const UNPROJECTED_BEDROCK_COMPONENTS = {} as const;\n\n/** Whether an untyped Bedrock JSON value is an object with named fields. */\n/** Reads a Bedrock component's scalar form or its `{ value }` form. */\nconst bedrockScalarOf = (type: ItemType, component: string): unknown => {\n const source = type.bedrockComponents.get(component);\n return isRecord(source) ? source.value : source;\n};\n\n/** Reads a boolean Bedrock component from its simple or `{ value }` form. */\nconst bedrockBooleanOf = (type: ItemType, component: string): boolean | undefined => {\n const value = bedrockScalarOf(type, component);\n return typeof value === 'boolean' ? value : undefined;\n};\n\n/** Reads an integer Bedrock component from its simple or `{ value }` form. */\nconst bedrockIntegerOf = (type: ItemType, component: string): number | undefined => {\n const value = bedrockScalarOf(type, component);\n return typeof value === 'number' && Number.isSafeInteger(value) ? value : undefined;\n};\n\n/** Reads the resource-pack texture variants from the item's Bedrock icon component. */\nconst bedrockIconOf = (type: ItemType): BedrockItemComponents['minecraft:icon'] => {\n const source = type.bedrockComponents.get('minecraft:icon');\n if (typeof source === 'string') return { textures: { default: source } };\n if (!isRecord(source)) return undefined;\n\n const textures = source.textures;\n if (isRecord(textures)) {\n const entries = Object.entries(textures).filter(\n (entry): entry is [string, string] => typeof entry[1] === 'string'\n );\n return { textures: Object.fromEntries(entries) };\n }\n\n return typeof source.texture === 'string' ? { textures: { default: source.texture } } : undefined;\n};\n\n/** Reads an explicit display name from the item's Bedrock definition. */\nconst bedrockDisplayNameOf = (type: ItemType): BedrockItemComponents['minecraft:display_name'] => {\n const source = type.bedrockComponents.get('minecraft:display_name');\n return isRecord(source) && typeof source.value === 'string' ? { value: source.value } : undefined;\n};\n\n/** Whether a value can be a Bedrock block state. */\nconst isBlockStateValue = (value: unknown): value is string | number | boolean =>\n typeof value === 'string' ||\n typeof value === 'boolean' ||\n (typeof value === 'number' && Number.isSafeInteger(value));\n\n/** Reads the block placement component from the active Bedrock item definition. */\nconst bedrockBlockPlacerOf = (type: ItemType, canUseBlockAsIcon: boolean): BedrockBlockPlacerComponent | undefined => {\n const source = type.bedrockComponents.get('minecraft:block_placer');\n if (!isRecord(source)) return undefined;\n\n const useOnSource = source.use_on;\n const selectors = Array.isArray(useOnSource) ? useOnSource : useOnSource === undefined ? [] : [useOnSource];\n const useOn: (string | BedrockItemBlockDescriptor)[] = [];\n for (const selector of selectors) {\n if (typeof selector === 'string') {\n useOn.push(selector);\n continue;\n }\n if (!isRecord(selector)) continue;\n\n const statesSource = selector.states;\n let states: Record<string, string | number | boolean> | undefined;\n if (isRecord(statesSource)) {\n states = {};\n for (const [name, value] of Object.entries(statesSource)) {\n if (isBlockStateValue(value)) states[name] = value;\n }\n }\n useOn.push({\n ...(typeof selector.name === 'string' ? { name: selector.name } : {}),\n ...(states === undefined ? {} : { states }),\n ...(typeof selector.tags === 'string' ? { tags: selector.tags } : {})\n });\n }\n\n return {\n ...(typeof source.block === 'string' ? { block: source.block } : {}),\n alignedPlacement: source.aligned_placement === true,\n canUseBlockAsIcon:\n typeof source.can_use_block_as_icon === 'boolean' ? source.can_use_block_as_icon : canUseBlockAsIcon,\n replaceBlockItem: source.replace_block_item === true,\n useOn\n };\n};\n\n/** How Java's equipment slots name the same places Bedrock's `wearable` does. */\nconst WEARABLE_SLOTS: Readonly<Record<string, string>> = {\n head: 'slot.armor.head',\n chest: 'slot.armor.chest',\n legs: 'slot.armor.legs',\n feet: 'slot.armor.feet',\n body: 'slot.armor.body',\n mainhand: 'slot.weapon.mainhand',\n offhand: 'slot.weapon.offhand'\n};\n\n/** Which Bedrock enchanting category a Java `mineable/*` tool rule implies. */\nconst TOOL_TAG_SLOTS: readonly (readonly [string, string])[] = [\n ['mineable/pickaxe', 'pickaxe'],\n ['mineable/axe', 'axe'],\n ['mineable/shovel', 'shovel'],\n ['mineable/hoe', 'hoe']\n];\n\n/** Which Bedrock armor category a Java equipment slot implies. */\nconst ARMOR_SLOTS: Readonly<Record<string, string>> = {\n head: 'armor_head',\n chest: 'armor_torso',\n legs: 'armor_legs',\n feet: 'armor_feet',\n body: 'g_armor'\n};\n\n/**\n * Picks the Bedrock enchanting category for an item.\n *\n * Java has no such field, so it is derived: the `mineable/*` tag in the\n * item's tool rules names the tool, the equipment slot names the armor piece,\n * and the spear components, shield rules and glider each name themselves.\n */\nexport const enchantableSlotOf = (type: ItemType): string => {\n if (type.params(glider) !== undefined) return 'elytra';\n if (type.params(blocksAttacks) !== undefined) return 'shield';\n if (type.params(piercingWeapon) !== undefined || type.params(kineticWeapon) !== undefined) return 'melee_spear';\n\n const rules = type.params(tool)?.rules ?? [];\n for (const rule of rules) {\n if (rule.blocks.kind !== 'tag') continue;\n const tag = rule.blocks.tag.replace('minecraft:', '');\n const match = TOOL_TAG_SLOTS.find(([suffix]) => tag === suffix);\n if (match) return match[1];\n }\n\n const slot = type.params(equippable)?.slot;\n if (slot !== undefined && slot in ARMOR_SLOTS) return ARMOR_SLOTS[slot]!;\n if (type.params(weapon) !== undefined) return 'sword';\n return type.params(enchantable) === undefined ? 'none' : 'all';\n};\n\n/** The attack damage a Java attribute modifier list adds in the main hand. */\nconst attackDamageOf = (type: ItemType): number | undefined => {\n const modifiers = type.params(attributeModifiers) ?? [];\n const attack = modifiers.find(\n (modifier) => modifier.type === 'minecraft:attack_damage' && modifier.operation === 'add_value'\n );\n return attack === undefined ? undefined : Math.round(attack.amount);\n};\n\n/** The armor points a Java attribute modifier list adds. */\nconst armorPointsOf = (type: ItemType): number => {\n const modifiers = type.params(attributeModifiers) ?? [];\n const armor = modifiers.find(\n (modifier) => modifier.type === 'minecraft:armor' && modifier.operation === 'add_value'\n );\n return armor === undefined ? 0 : Math.round(armor.amount);\n};\n\n/** Evaluates a provider-backed number, returning undefined when nothing resolves it. */\nconst resolveNumber = (\n source:\n | { kind: 'inline'; value: number }\n | { kind: 'reference'; id: string }\n | { kind: 'provider'; provider: Readonly<Record<string, unknown>> }\n | undefined,\n context: ProviderContext\n): number | undefined => {\n if (source === undefined) return undefined;\n const node = source.kind === 'inline' ? source.value : source.kind === 'reference' ? source.id : source.provider;\n try {\n return evaluateNumberProvider(node, context);\n } catch (error) {\n if (error instanceof NumberProviderError) return undefined;\n throw error;\n }\n};\n\n/** Options for {@link projectItemToBedrock}. */\nexport interface ProjectionOptions {\n /**\n * Maps a Java item identifier to the Bedrock one, for the few projected\n * fields that name another item. Injected rather than imported so this\n * package does not depend on `@jsprismarine/mapping`; without it, those\n * fields are left out.\n */\n mapIdentifier?: (javaId: string) => string | undefined;\n /** Resolves a Java item tag to its merged Java item identifiers. */\n resolveItemTag?: (tag: string) => readonly string[] | undefined;\n /** Maps a Java block identifier to the Bedrock identifier the client knows. */\n mapBlockIdentifier?: (javaId: string) => string | undefined;\n /** Resolves a Java block tag to its merged Java block identifiers. */\n resolveBlockTag?: (tag: string) => readonly string[] | undefined;\n /** The cooking context fuel values resolve for, a normal furnace by default. */\n providers?: ProviderContext;\n}\n\n/** Maps a Java item holder set onto the Bedrock item names the client knows. */\nconst bedrockItemNamesOf = (items: HolderSet, options: ProjectionOptions): readonly string[] | undefined => {\n if (options.mapIdentifier === undefined) return undefined;\n\n const javaItems = items.kind === 'entries' ? items.entries : options.resolveItemTag?.(items.tag);\n if (javaItems === undefined) return undefined;\n\n const mapped = new Set<string>();\n for (const javaItem of javaItems) {\n const bedrockItem = options.mapIdentifier(javaItem);\n if (bedrockItem !== undefined) mapped.add(bedrockItem);\n }\n return [...mapped];\n};\n\n/** Maps a Java block holder set onto the Bedrock block names the client knows. */\nconst bedrockBlockNamesOf = (blocks: HolderSet, options: ProjectionOptions): readonly string[] | undefined => {\n if (options.mapBlockIdentifier === undefined) return undefined;\n\n const javaBlocks = blocks.kind === 'entries' ? blocks.entries : options.resolveBlockTag?.(blocks.tag);\n if (javaBlocks === undefined) return undefined;\n\n const mapped = new Set<string>();\n for (const javaBlock of javaBlocks) {\n const bedrockBlock = options.mapBlockIdentifier(javaBlock);\n if (bedrockBlock !== undefined) mapped.add(bedrockBlock);\n }\n return [...mapped];\n};\n\n/** Projects Java's floating mining speeds into Bedrock's signed integer range. */\nconst bedrockMiningSpeed = (speed: number): number => Math.min(2_147_483_647, Math.max(0, Math.round(speed)));\n\n/** Expands Java tool rules into the per-block speeds Bedrock accepts. */\nconst bedrockDiggerOf = (type: ItemType, options: ProjectionOptions): BedrockDiggerComponent | undefined => {\n const parameters = type.params(tool);\n if (parameters === undefined || options.mapBlockIdentifier === undefined) return undefined;\n\n const destroySpeeds: BedrockDiggerRule[] = [];\n for (const rule of parameters.rules) {\n if (rule.speed === undefined) continue;\n const blocks = bedrockBlockNamesOf(rule.blocks, options);\n if (blocks === undefined) continue;\n const speed = bedrockMiningSpeed(rule.speed);\n for (const block of blocks) destroySpeeds.push({ block, speed });\n }\n\n return destroySpeeds.length === 0 ? undefined : { destroySpeeds, useEfficiency: true };\n};\n\n/**\n * Projects one resolved item type onto the Bedrock component compound the\n * client needs in `ItemRegistryPacket`.\n *\n * Only the facts Java's components decide are produced. Keys with no Java\n * source are left out rather than guessed, so the protocol layer can merge\n * its own without having to tell a derived value from a placeholder.\n */\nexport const projectItemToBedrock = (type: ItemType, options: ProjectionOptions = {}): BedrockItemComponents => {\n const context = options.providers ?? DEFAULT_PROVIDER_CONTEXT;\n const properties: BedrockItemProperties = {};\n const icon = bedrockIconOf(type);\n const displayName = bedrockDisplayNameOf(type);\n const blockPlacer = bedrockBlockPlacerOf(type, icon === undefined);\n const projected: BedrockItemComponents = {\n item_properties: properties,\n item_tags: type.tags,\n ...(blockPlacer === undefined ? {} : { 'minecraft:block_placer': blockPlacer }),\n ...(displayName === undefined ? {} : { 'minecraft:display_name': displayName }),\n ...(icon === undefined ? {} : { 'minecraft:icon': icon })\n };\n\n const digger = bedrockDiggerOf(type, options);\n if (digger !== undefined) projected['minecraft:digger'] = digger;\n\n const stackSize = bedrockIntegerOf(type, 'minecraft:max_stack_size') ?? type.params(maxStackSize);\n if (stackSize !== undefined) {\n properties.max_stack_size = stackSize;\n projected['minecraft:max_stack_size'] = { value: stackSize };\n }\n\n const attack = bedrockIntegerOf(type, 'minecraft:damage') ?? attackDamageOf(type);\n if (attack !== undefined) {\n properties.damage = attack;\n projected['minecraft:damage'] = { value: attack };\n }\n\n const durability = type.params(maxDamage);\n if (durability !== undefined) {\n projected['minecraft:durability'] = { max_durability: durability, damage_chance: { min: 0, max: 100 } };\n }\n\n const toolParams = type.params(tool);\n const weaponParams = type.params(weapon);\n const bedrockHandEquipped = bedrockBooleanOf(type, 'minecraft:hand_equipped');\n const handEquipped = bedrockHandEquipped ?? (toolParams !== undefined || weaponParams !== undefined);\n if (bedrockHandEquipped !== undefined || handEquipped) {\n properties.hand_equipped = handEquipped;\n projected['minecraft:hand_equipped'] = { value: handEquipped };\n }\n if (toolParams !== undefined) {\n properties.mining_speed = toolParams.default_mining_speed ?? 1;\n }\n const canDestroyInCreative =\n bedrockBooleanOf(type, 'minecraft:can_destroy_in_creative') ??\n (toolParams === undefined ? undefined : (toolParams.can_destroy_blocks_in_creative ?? true));\n if (canDestroyInCreative !== undefined) properties.can_destroy_in_creative = canDestroyInCreative;\n\n properties.foil = bedrockBooleanOf(type, 'minecraft:glint') ?? type.params(enchantmentGlintOverride) ?? false;\n\n const enchantableParams = type.params(enchantable);\n properties.enchantable_slot = enchantableSlotOf(type);\n properties.enchantable_value = enchantableParams?.value ?? 0;\n if (enchantableParams !== undefined) {\n projected['minecraft:enchantable'] = {\n slot: properties.enchantable_slot,\n value: enchantableParams.value\n };\n }\n\n const equippableParams = type.params(equippable);\n if (equippableParams !== undefined) {\n const slot = WEARABLE_SLOTS[equippableParams.slot];\n if (slot !== undefined) projected['minecraft:wearable'] = { slot, protection: armorPointsOf(type) };\n }\n const allowOffHand =\n bedrockBooleanOf(type, 'minecraft:allow_off_hand') ??\n (equippableParams === undefined\n ? undefined\n : equippableParams.slot === 'offhand' || equippableParams.slot === 'hand');\n if (allowOffHand !== undefined) properties.allow_off_hand = allowOffHand;\n\n const liquidClipped = bedrockBooleanOf(type, 'minecraft:liquid_clipped');\n if (liquidClipped !== undefined) properties.liquid_clipped = liquidClipped;\n const shouldDespawn = bedrockBooleanOf(type, 'minecraft:should_despawn');\n if (shouldDespawn !== undefined) properties.should_despawn = shouldDespawn;\n const stackedByData = bedrockBooleanOf(type, 'minecraft:stacked_by_data');\n if (stackedByData !== undefined) properties.stacked_by_data = stackedByData;\n\n const consumableParams = type.params(consumable);\n if (consumableParams !== undefined) {\n // Java's default consume time is 1.6 seconds, which is the 32 ticks a\n // Bedrock Dedicated Server reports for the apple.\n const ticks = Math.round((consumableParams.consume_seconds ?? 1.6) * 20);\n const animation = consumableParams.animation ?? 'eat';\n properties.use_duration = ticks;\n properties.use_animation = animation === 'eat' ? 1 : 0;\n projected['minecraft:use_duration'] = ticks;\n projected['minecraft:use_animation'] = { value: animation };\n projected['minecraft:use_modifiers'] = {\n use_duration: ticks,\n movement_modifier: type.params(useEffects)?.speed_multiplier ?? 1\n };\n }\n\n const foodParams = type.params(food);\n if (foodParams !== undefined) {\n // Java stores saturation as an absolute value and Bedrock as the\n // ratio it is computed from: saturation = 2 * nutrition * modifier.\n const modifier = foodParams.nutrition > 0 ? foodParams.saturation / (2 * foodParams.nutrition) : 0;\n const remainder = type.params(useRemainder)?.id;\n const converts = remainder === undefined ? undefined : options.mapIdentifier?.(remainder);\n projected['minecraft:food'] = {\n nutrition: foodParams.nutrition,\n saturation_modifier: modifier,\n can_always_eat: foodParams.can_always_eat ?? false,\n ...(converts !== undefined ? { using_converts_to: converts } : {})\n };\n }\n\n const burnTicks = resolveNumber(type.params(cookingFuel)?.burn_time, context);\n if (burnTicks !== undefined) projected['minecraft:fuel'] = { duration: burnTicks / 20 };\n\n const layers = resolveNumber(type.params(compostable)?.layers, context);\n if (layers !== undefined) {\n projected['minecraft:compostable'] = { composting_chance: Math.round(layers * 100) };\n }\n\n const resistant = type.params(damageResistant);\n if (resistant?.types.kind === 'tag' && resistant.types.tag === 'minecraft:is_fire') {\n projected['minecraft:fire_resistant'] = { value: true };\n }\n\n const cooldown = type.params(useCooldown);\n if (cooldown !== undefined) {\n projected['minecraft:cooldown'] = {\n category: (cooldown.cooldown_group ?? type.identifier).replace('minecraft:', ''),\n duration: cooldown.seconds,\n type: 'use'\n };\n }\n\n const repairableParams = type.params(repairable);\n if (repairableParams !== undefined) {\n const items = bedrockItemNamesOf(repairableParams.items, options);\n if (items !== undefined) {\n projected['minecraft:repairable'] = {\n repairItems: items.map((name) => ({ items: [name] }))\n };\n }\n }\n\n return projected;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+KA,IAAa,+BAA+B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA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AAS,IAAI,CAAC;EACpE;CACJ;CAEA,MAAM,YAAY,cAAc,KAAK,OAAO,WAAW,CAAC,EAAE,WAAW,OAAO;CAC5E,IAAI,cAAc,KAAA,GAAW,UAAU,oBAAoB,EAAE,UAAU,YAAY,GAAG;CAEtF,MAAM,SAAS,cAAc,KAAK,OAAO,WAAW,CAAC,EAAE,QAAQ,OAAO;CACtE,IAAI,WAAW,KAAA,GACX,UAAU,2BAA2B,EAAE,mBAAmB,KAAK,MAAM,SAAS,GAAG,EAAE;CAGvF,MAAM,YAAY,KAAK,OAAO,eAAe;CAC7C,IAAI,WAAW,MAAM,SAAS,SAAS,UAAU,MAAM,QAAQ,qBAC3D,UAAU,8BAA8B,EAAE,OAAO,KAAK;CAG1D,MAAM,WAAW,KAAK,OAAO,WAAW;CACxC,IAAI,aAAa,KAAA,GACb,UAAU,wBAAwB;EAC9B,WAAW,SAAS,kBAAkB,KAAK,WAAA,CAAY,QAAQ,cAAc,EAAE;EAC/E,UAAU,SAAS;EACnB,MAAM;CACV;CAGJ,MAAM,mBAAmB,KAAK,OAAO,UAAU;CAC/C,IAAI,qBAAqB,KAAA,GAAW;EAChC,MAAM,QAAQ,mBAAmB,iBAAiB,OAAO,OAAO;EAChE,IAAI,UAAU,KAAA,GACV,UAAU,0BAA0B,EAChC,aAAa,MAAM,KAAK,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EACxD;CAER;CAEA,OAAO;AACX"}
|
|
1
|
+
{"version":3,"file":"projection.js","names":[],"sources":["../src/projection.ts"],"sourcesContent":["/**\n * The Bedrock item component projection: what the client is told about an\n * item whose properties came from Java.\n *\n * The two editions name the same facts differently. Java's `max_damage` is\n * Bedrock's `minecraft:durability.max_durability`, Java's `food.saturation`\n * is an absolute value where Bedrock's `saturation_modifier` is a ratio, and\n * Bedrock keeps a flat `item_properties` compound beside the named\n * components. Every shape below is read off a Bedrock Dedicated Server\n * 1.26.51.1 capture, the `item_components.nbt` golden in\n * `@jsprismarine/bedrock-data`, rather than written from the documentation.\n *\n * This module builds the compound. It does not send it: `ItemRegistryPacket`\n * belongs to the protocol package.\n */\nimport {\n blocksAttacks,\n compostable,\n consumable,\n cookingFuel,\n damageResistant,\n enchantable,\n enchantmentGlintOverride,\n equippable,\n food,\n glider,\n kineticWeapon,\n maxDamage,\n piercingWeapon,\n repairable,\n tool,\n useCooldown,\n useRemainder,\n weapon\n} from './components/defaults';\nimport { attributeModifiers, maxStackSize, useEffects } from './components/universal';\nimport type { ItemType } from './hooks';\nimport type { ProviderContext } from './numberProvider';\nimport { DEFAULT_PROVIDER_CONTEXT, evaluateNumberProvider } from './numberProvider';\nimport type { HolderSet } from './schema';\nimport { isRecord } from './isRecord';\nimport { NumberProviderError } from '@jsprismarine/errors/items';\n\n/**\n * The flat `item_properties` compound, with the nineteen keys a Bedrock\n * Dedicated Server writes for a data-driven item. Only the keys Java's\n * components decide are produced here; see {@link BEDROCK_ONLY_ITEM_PROPERTIES}.\n */\nexport interface BedrockItemProperties {\n /** How many fit in a slot. */\n max_stack_size?: number;\n /** Attack damage the item adds, in half hearts. */\n damage?: number;\n /** Whether the item is held out in front, which tools and weapons are. */\n hand_equipped?: boolean;\n /** Whether the enchantment glint is drawn regardless of enchantments. */\n foil?: boolean;\n /** Which enchanting table category the item belongs to, `none` when it takes none. */\n enchantable_slot?: string;\n /** The enchanting power the item brings. */\n enchantable_value?: number;\n /** How long a held use runs, in ticks. */\n use_duration?: number;\n /** The use animation id; 0 is none and 1 is eating. */\n use_animation?: number;\n /** Whether the item breaks blocks in creative mode. */\n can_destroy_in_creative?: boolean;\n /** Whether the item can be used while a liquid occupies the target. */\n liquid_clipped?: boolean;\n /** The base mining speed multiplier. */\n mining_speed?: number;\n /** Whether the item can be held in the off hand. */\n allow_off_hand?: boolean;\n /** Whether a dropped item stack despawns. */\n should_despawn?: boolean;\n /** Whether stacks with different auxiliary values stay separate. */\n stacked_by_data?: boolean;\n}\n\n/** The compound an item's `Item Component Data` carries, keyed the way Bedrock keys it. */\nexport interface BedrockItemComponents {\n item_properties: BedrockItemProperties;\n /** Bedrock's resolved item tag names, serialized separately from named components. */\n item_tags?: readonly string[];\n /** The block a Bedrock-defined item places, with its placement restrictions. */\n 'minecraft:block_placer'?: BedrockBlockPlacerComponent;\n /** The explicit display name from the active Bedrock item definition. */\n 'minecraft:display_name'?: { value: string };\n /** Resource pack icon textures declared by the active Bedrock item definition. */\n 'minecraft:icon'?: { textures: Readonly<Record<string, string>> };\n 'minecraft:max_stack_size'?: { value: number };\n 'minecraft:damage'?: { value: number };\n 'minecraft:durability'?: { max_durability: number; damage_chance: { min: number; max: number } };\n 'minecraft:enchantable'?: { slot: string; value: number };\n 'minecraft:food'?: {\n nutrition: number;\n saturation_modifier: number;\n can_always_eat: boolean;\n using_converts_to?: string;\n };\n 'minecraft:use_duration'?: number;\n 'minecraft:use_animation'?: { value: string };\n 'minecraft:use_modifiers'?: { use_duration: number; movement_modifier: number };\n /** Java's repair materials, expanded and mapped to Bedrock item identifiers. */\n 'minecraft:repairable'?: BedrockRepairableComponent;\n /** Java's tool rules, expanded and mapped to Bedrock block identifiers. */\n 'minecraft:digger'?: BedrockDiggerComponent;\n 'minecraft:fuel'?: { duration: number };\n 'minecraft:compostable'?: { composting_chance: number };\n 'minecraft:fire_resistant'?: { value: boolean };\n 'minecraft:hand_equipped'?: { value: boolean };\n 'minecraft:cooldown'?: { category: string; duration: number; type: string };\n 'minecraft:wearable'?: { slot: string; protection: number };\n}\n\n/** One group of Bedrock items that can repair the item. */\nexport interface BedrockRepairableItem {\n /** Bedrock item identifiers accepted as repair materials. */\n readonly items: readonly string[];\n}\n\n/** The Bedrock repair rules projected from Java's `minecraft:repairable`. */\nexport interface BedrockRepairableComponent {\n /** Repair material groups accepted by Bedrock's anvil UI. */\n readonly repairItems: readonly BedrockRepairableItem[];\n}\n\n/** One Bedrock digging speed, resolved to a block the client knows. */\nexport interface BedrockDiggerRule {\n /** The Bedrock block identifier this speed applies to. */\n readonly block: string;\n /** The integer speed multiplier Bedrock's item component accepts. */\n readonly speed: number;\n}\n\n/** The Bedrock digging rules projected from Java's `minecraft:tool`. */\nexport interface BedrockDiggerComponent {\n /** The ordered block speeds the item applies while mining. */\n readonly destroySpeeds: readonly BedrockDiggerRule[];\n /** Whether Bedrock applies its Efficiency enchantment bonus to this item. */\n readonly useEfficiency: boolean;\n}\n\n/** One block selector accepted by `minecraft:block_placer.use_on`. */\nexport interface BedrockItemBlockDescriptor {\n /** The block identifier, when the selector names one block. */\n readonly name?: string;\n /** The block state values that further narrow the named block. */\n readonly states?: Readonly<Record<string, string | number | boolean>>;\n /** The Bedrock query that selects blocks by their tags. */\n readonly tags?: string;\n}\n\n/** The resolved Bedrock block placement component sent to the client. */\nexport interface BedrockBlockPlacerComponent {\n /** The block placed when this item is used. */\n readonly block?: string;\n /** Whether placement follows the player's alignment while interacting. */\n readonly alignedPlacement: boolean;\n /** Whether the block supplies the item icon when no icon is declared. */\n readonly canUseBlockAsIcon: boolean;\n /** Whether this item is the default item returned for its block. */\n readonly replaceBlockItem: boolean;\n /** Blocks on which the item may be used. Empty means all blocks. */\n readonly useOn: readonly (string | BedrockItemBlockDescriptor)[];\n}\n\n/**\n * The `item_properties` keys with no Java item-property source, so the\n * protocol layer supplies captured defaults unless an active Bedrock item\n * component provides a value.\n * `creative_category` and `creative_group` come from the creative item\n * catalog, `frame_count` from the resource pack's icon animation, and the\n * other three have no Java source at all.\n */\nexport const BEDROCK_ONLY_ITEM_PROPERTIES = [\n 'creative_category',\n 'creative_group',\n 'frame_count',\n 'hidden_in_commands',\n 'liquid_clipped',\n 'should_despawn',\n 'stacked_by_data'\n] as const;\n\n/**\n * Bedrock components this projection does not yet derive from Java item data.\n */\nexport const UNPROJECTED_BEDROCK_COMPONENTS = {} as const;\n\n/** Whether an untyped Bedrock JSON value is an object with named fields. */\n/** Reads a Bedrock component's scalar form or its `{ value }` form. */\nconst bedrockScalarOf = (type: ItemType, component: string): unknown => {\n const source = type.bedrockComponents.get(component);\n return isRecord(source) ? source.value : source;\n};\n\n/** Reads a boolean Bedrock component from its simple or `{ value }` form. */\nconst bedrockBooleanOf = (type: ItemType, component: string): boolean | undefined => {\n const value = bedrockScalarOf(type, component);\n return typeof value === 'boolean' ? value : undefined;\n};\n\n/** Reads an integer Bedrock component from its simple or `{ value }` form. */\nconst bedrockIntegerOf = (type: ItemType, component: string): number | undefined => {\n const value = bedrockScalarOf(type, component);\n return typeof value === 'number' && Number.isSafeInteger(value) ? value : undefined;\n};\n\n/** Reads the resource-pack texture variants from the item's Bedrock icon component. */\nconst bedrockIconOf = (type: ItemType): BedrockItemComponents['minecraft:icon'] => {\n const source = type.bedrockComponents.get('minecraft:icon');\n if (typeof source === 'string') return { textures: { default: source } };\n if (!isRecord(source)) return undefined;\n\n const textures = source.textures;\n if (isRecord(textures)) {\n const entries = Object.entries(textures).filter(\n (entry): entry is [string, string] => typeof entry[1] === 'string'\n );\n return { textures: Object.fromEntries(entries) };\n }\n\n return typeof source.texture === 'string' ? { textures: { default: source.texture } } : undefined;\n};\n\n/** Reads an explicit display name from the item's Bedrock definition. */\nconst bedrockDisplayNameOf = (type: ItemType): BedrockItemComponents['minecraft:display_name'] => {\n const source = type.bedrockComponents.get('minecraft:display_name');\n return isRecord(source) && typeof source.value === 'string' ? { value: source.value } : undefined;\n};\n\n/** Whether a value can be a Bedrock block state. */\nconst isBlockStateValue = (value: unknown): value is string | number | boolean =>\n typeof value === 'string' ||\n typeof value === 'boolean' ||\n (typeof value === 'number' && Number.isSafeInteger(value));\n\n/** Reads the block placement component from the active Bedrock item definition. */\nconst bedrockBlockPlacerOf = (type: ItemType, canUseBlockAsIcon: boolean): BedrockBlockPlacerComponent | undefined => {\n const source = type.bedrockComponents.get('minecraft:block_placer');\n if (!isRecord(source)) return undefined;\n\n const useOnSource = source.use_on;\n const selectors = Array.isArray(useOnSource) ? useOnSource : useOnSource === undefined ? [] : [useOnSource];\n const useOn: (string | BedrockItemBlockDescriptor)[] = [];\n for (const selector of selectors) {\n if (typeof selector === 'string') {\n useOn.push(selector);\n continue;\n }\n if (!isRecord(selector)) continue;\n\n const statesSource = selector.states;\n let states: Record<string, string | number | boolean> | undefined;\n if (isRecord(statesSource)) {\n states = {};\n for (const [name, value] of Object.entries(statesSource)) {\n if (isBlockStateValue(value)) states[name] = value;\n }\n }\n useOn.push({\n ...(typeof selector.name === 'string' ? { name: selector.name } : {}),\n ...(states === undefined ? {} : { states }),\n ...(typeof selector.tags === 'string' ? { tags: selector.tags } : {})\n });\n }\n\n return {\n ...(typeof source.block === 'string' ? { block: source.block } : {}),\n alignedPlacement: source.aligned_placement === true,\n canUseBlockAsIcon:\n typeof source.can_use_block_as_icon === 'boolean' ? source.can_use_block_as_icon : canUseBlockAsIcon,\n replaceBlockItem: source.replace_block_item === true,\n useOn\n };\n};\n\n/** How Java's equipment slots name the same places Bedrock's `wearable` does. */\nconst WEARABLE_SLOTS: Readonly<Record<string, string>> = {\n head: 'slot.armor.head',\n chest: 'slot.armor.chest',\n legs: 'slot.armor.legs',\n feet: 'slot.armor.feet',\n body: 'slot.armor.body',\n mainhand: 'slot.weapon.mainhand',\n offhand: 'slot.weapon.offhand'\n};\n\n/** Which Bedrock enchanting category a Java `mineable/*` tool rule implies. */\nconst TOOL_TAG_SLOTS: readonly (readonly [string, string])[] = [\n ['mineable/pickaxe', 'pickaxe'],\n ['mineable/axe', 'axe'],\n ['mineable/shovel', 'shovel'],\n ['mineable/hoe', 'hoe']\n];\n\n/** Which Bedrock armor category a Java equipment slot implies. */\nconst ARMOR_SLOTS: Readonly<Record<string, string>> = {\n head: 'armor_head',\n chest: 'armor_torso',\n legs: 'armor_legs',\n feet: 'armor_feet',\n body: 'g_armor'\n};\n\n/**\n * The Bedrock cooldown category an item's cooldown runs under: Java's cooldown group, which is the\n * `minecraft:use_cooldown` group or else the item's own identifier, without the `minecraft:`\n * namespace, the way the client's `minecraft:cooldown` component and\n * `PlayerStartItemCooldownPacket` name it.\n */\nexport const cooldownCategoryOf = (type: ItemType): string =>\n (type.params(useCooldown)?.cooldown_group ?? type.identifier).replace('minecraft:', '');\n\n/**\n * Picks the Bedrock enchanting category for an item.\n *\n * Java has no such field, so it is derived: the `mineable/*` tag in the\n * item's tool rules names the tool, the equipment slot names the armor piece,\n * and the spear components, shield rules and glider each name themselves.\n */\nexport const enchantableSlotOf = (type: ItemType): string => {\n if (type.params(glider) !== undefined) return 'elytra';\n if (type.params(blocksAttacks) !== undefined) return 'shield';\n if (type.params(piercingWeapon) !== undefined || type.params(kineticWeapon) !== undefined) return 'melee_spear';\n\n const rules = type.params(tool)?.rules ?? [];\n for (const rule of rules) {\n if (rule.blocks.kind !== 'tag') continue;\n const tag = rule.blocks.tag.replace('minecraft:', '');\n const match = TOOL_TAG_SLOTS.find(([suffix]) => tag === suffix);\n if (match) return match[1];\n }\n\n const slot = type.params(equippable)?.slot;\n if (slot !== undefined && slot in ARMOR_SLOTS) return ARMOR_SLOTS[slot]!;\n if (type.params(weapon) !== undefined) return 'sword';\n return type.params(enchantable) === undefined ? 'none' : 'all';\n};\n\n/** The attack damage a Java attribute modifier list adds in the main hand. */\nconst attackDamageOf = (type: ItemType): number | undefined => {\n const modifiers = type.params(attributeModifiers) ?? [];\n const attack = modifiers.find(\n (modifier) => modifier.type === 'minecraft:attack_damage' && modifier.operation === 'add_value'\n );\n return attack === undefined ? undefined : Math.round(attack.amount);\n};\n\n/** The armor points a Java attribute modifier list adds. */\nconst armorPointsOf = (type: ItemType): number => {\n const modifiers = type.params(attributeModifiers) ?? [];\n const armor = modifiers.find(\n (modifier) => modifier.type === 'minecraft:armor' && modifier.operation === 'add_value'\n );\n return armor === undefined ? 0 : Math.round(armor.amount);\n};\n\n/** Evaluates a provider-backed number, returning undefined when nothing resolves it. */\nconst resolveNumber = (\n source:\n | { kind: 'inline'; value: number }\n | { kind: 'reference'; id: string }\n | { kind: 'provider'; provider: Readonly<Record<string, unknown>> }\n | undefined,\n context: ProviderContext\n): number | undefined => {\n if (source === undefined) return undefined;\n const node = source.kind === 'inline' ? source.value : source.kind === 'reference' ? source.id : source.provider;\n try {\n return evaluateNumberProvider(node, context);\n } catch (error) {\n if (error instanceof NumberProviderError) return undefined;\n throw error;\n }\n};\n\n/** Options for {@link projectItemToBedrock}. */\nexport interface ProjectionOptions {\n /**\n * Maps a Java item identifier to the Bedrock one, for the few projected\n * fields that name another item. Injected rather than imported so this\n * package does not depend on `@jsprismarine/mapping`; without it, those\n * fields are left out.\n */\n mapIdentifier?: (javaId: string) => string | undefined;\n /** Resolves a Java item tag to its merged Java item identifiers. */\n resolveItemTag?: (tag: string) => readonly string[] | undefined;\n /** Maps a Java block identifier to the Bedrock identifier the client knows. */\n mapBlockIdentifier?: (javaId: string) => string | undefined;\n /** Resolves a Java block tag to its merged Java block identifiers. */\n resolveBlockTag?: (tag: string) => readonly string[] | undefined;\n /** The cooking context fuel values resolve for, a normal furnace by default. */\n providers?: ProviderContext;\n}\n\n/** Maps a Java item holder set onto the Bedrock item names the client knows. */\nconst bedrockItemNamesOf = (items: HolderSet, options: ProjectionOptions): readonly string[] | undefined => {\n if (options.mapIdentifier === undefined) return undefined;\n\n const javaItems = items.kind === 'entries' ? items.entries : options.resolveItemTag?.(items.tag);\n if (javaItems === undefined) return undefined;\n\n const mapped = new Set<string>();\n for (const javaItem of javaItems) {\n const bedrockItem = options.mapIdentifier(javaItem);\n if (bedrockItem !== undefined) mapped.add(bedrockItem);\n }\n return [...mapped];\n};\n\n/** Maps a Java block holder set onto the Bedrock block names the client knows. */\nconst bedrockBlockNamesOf = (blocks: HolderSet, options: ProjectionOptions): readonly string[] | undefined => {\n if (options.mapBlockIdentifier === undefined) return undefined;\n\n const javaBlocks = blocks.kind === 'entries' ? blocks.entries : options.resolveBlockTag?.(blocks.tag);\n if (javaBlocks === undefined) return undefined;\n\n const mapped = new Set<string>();\n for (const javaBlock of javaBlocks) {\n const bedrockBlock = options.mapBlockIdentifier(javaBlock);\n if (bedrockBlock !== undefined) mapped.add(bedrockBlock);\n }\n return [...mapped];\n};\n\n/** Projects Java's floating mining speeds into Bedrock's signed integer range. */\nconst bedrockMiningSpeed = (speed: number): number => Math.min(2_147_483_647, Math.max(0, Math.round(speed)));\n\n/** Expands Java tool rules into the per-block speeds Bedrock accepts. */\nconst bedrockDiggerOf = (type: ItemType, options: ProjectionOptions): BedrockDiggerComponent | undefined => {\n const parameters = type.params(tool);\n if (parameters === undefined || options.mapBlockIdentifier === undefined) return undefined;\n\n const destroySpeeds: BedrockDiggerRule[] = [];\n for (const rule of parameters.rules) {\n if (rule.speed === undefined) continue;\n const blocks = bedrockBlockNamesOf(rule.blocks, options);\n if (blocks === undefined) continue;\n const speed = bedrockMiningSpeed(rule.speed);\n for (const block of blocks) destroySpeeds.push({ block, speed });\n }\n\n return destroySpeeds.length === 0 ? undefined : { destroySpeeds, useEfficiency: true };\n};\n\n/**\n * Projects one resolved item type onto the Bedrock component compound the\n * client needs in `ItemRegistryPacket`.\n *\n * Only the facts Java's components decide are produced. Keys with no Java\n * source are left out rather than guessed, so the protocol layer can merge\n * its own without having to tell a derived value from a placeholder.\n */\nexport const projectItemToBedrock = (type: ItemType, options: ProjectionOptions = {}): BedrockItemComponents => {\n const context = options.providers ?? DEFAULT_PROVIDER_CONTEXT;\n const properties: BedrockItemProperties = {};\n const icon = bedrockIconOf(type);\n const displayName = bedrockDisplayNameOf(type);\n const blockPlacer = bedrockBlockPlacerOf(type, icon === undefined);\n const projected: BedrockItemComponents = {\n item_properties: properties,\n item_tags: type.tags,\n ...(blockPlacer === undefined ? {} : { 'minecraft:block_placer': blockPlacer }),\n ...(displayName === undefined ? {} : { 'minecraft:display_name': displayName }),\n ...(icon === undefined ? {} : { 'minecraft:icon': icon })\n };\n\n const digger = bedrockDiggerOf(type, options);\n if (digger !== undefined) projected['minecraft:digger'] = digger;\n\n const stackSize = bedrockIntegerOf(type, 'minecraft:max_stack_size') ?? type.params(maxStackSize);\n if (stackSize !== undefined) {\n properties.max_stack_size = stackSize;\n projected['minecraft:max_stack_size'] = { value: stackSize };\n }\n\n const attack = bedrockIntegerOf(type, 'minecraft:damage') ?? attackDamageOf(type);\n if (attack !== undefined) {\n properties.damage = attack;\n projected['minecraft:damage'] = { value: attack };\n }\n\n const durability = type.params(maxDamage);\n if (durability !== undefined) {\n projected['minecraft:durability'] = { max_durability: durability, damage_chance: { min: 0, max: 100 } };\n }\n\n const toolParams = type.params(tool);\n const weaponParams = type.params(weapon);\n const bedrockHandEquipped = bedrockBooleanOf(type, 'minecraft:hand_equipped');\n const handEquipped = bedrockHandEquipped ?? (toolParams !== undefined || weaponParams !== undefined);\n if (bedrockHandEquipped !== undefined || handEquipped) {\n properties.hand_equipped = handEquipped;\n projected['minecraft:hand_equipped'] = { value: handEquipped };\n }\n if (toolParams !== undefined) {\n properties.mining_speed = toolParams.default_mining_speed ?? 1;\n }\n const canDestroyInCreative =\n bedrockBooleanOf(type, 'minecraft:can_destroy_in_creative') ??\n (toolParams === undefined ? undefined : (toolParams.can_destroy_blocks_in_creative ?? true));\n if (canDestroyInCreative !== undefined) properties.can_destroy_in_creative = canDestroyInCreative;\n\n properties.foil = bedrockBooleanOf(type, 'minecraft:glint') ?? type.params(enchantmentGlintOverride) ?? false;\n\n const enchantableParams = type.params(enchantable);\n properties.enchantable_slot = enchantableSlotOf(type);\n properties.enchantable_value = enchantableParams?.value ?? 0;\n if (enchantableParams !== undefined) {\n projected['minecraft:enchantable'] = {\n slot: properties.enchantable_slot,\n value: enchantableParams.value\n };\n }\n\n const equippableParams = type.params(equippable);\n if (equippableParams !== undefined) {\n const slot = WEARABLE_SLOTS[equippableParams.slot];\n if (slot !== undefined) projected['minecraft:wearable'] = { slot, protection: armorPointsOf(type) };\n }\n const allowOffHand =\n bedrockBooleanOf(type, 'minecraft:allow_off_hand') ??\n (equippableParams === undefined\n ? undefined\n : equippableParams.slot === 'offhand' || equippableParams.slot === 'hand');\n if (allowOffHand !== undefined) properties.allow_off_hand = allowOffHand;\n\n const liquidClipped = bedrockBooleanOf(type, 'minecraft:liquid_clipped');\n if (liquidClipped !== undefined) properties.liquid_clipped = liquidClipped;\n const shouldDespawn = bedrockBooleanOf(type, 'minecraft:should_despawn');\n if (shouldDespawn !== undefined) properties.should_despawn = shouldDespawn;\n const stackedByData = bedrockBooleanOf(type, 'minecraft:stacked_by_data');\n if (stackedByData !== undefined) properties.stacked_by_data = stackedByData;\n\n const consumableParams = type.params(consumable);\n if (consumableParams !== undefined) {\n // Java's default consume time is 1.6 seconds, which is the 32 ticks a\n // Bedrock Dedicated Server reports for the apple.\n const ticks = Math.round((consumableParams.consume_seconds ?? 1.6) * 20);\n const animation = consumableParams.animation ?? 'eat';\n properties.use_duration = ticks;\n properties.use_animation = animation === 'eat' ? 1 : 0;\n projected['minecraft:use_duration'] = ticks;\n projected['minecraft:use_animation'] = { value: animation };\n projected['minecraft:use_modifiers'] = {\n use_duration: ticks,\n movement_modifier: type.params(useEffects)?.speed_multiplier ?? 1\n };\n }\n\n const foodParams = type.params(food);\n if (foodParams !== undefined) {\n // Java stores saturation as an absolute value and Bedrock as the\n // ratio it is computed from: saturation = 2 * nutrition * modifier.\n const modifier = foodParams.nutrition > 0 ? foodParams.saturation / (2 * foodParams.nutrition) : 0;\n const remainder = type.params(useRemainder)?.id;\n const converts = remainder === undefined ? undefined : options.mapIdentifier?.(remainder);\n projected['minecraft:food'] = {\n nutrition: foodParams.nutrition,\n saturation_modifier: modifier,\n can_always_eat: foodParams.can_always_eat ?? false,\n ...(converts !== undefined ? { using_converts_to: converts } : {})\n };\n }\n\n const burnTicks = resolveNumber(type.params(cookingFuel)?.burn_time, context);\n if (burnTicks !== undefined) projected['minecraft:fuel'] = { duration: burnTicks / 20 };\n\n const layers = resolveNumber(type.params(compostable)?.layers, context);\n if (layers !== undefined) {\n projected['minecraft:compostable'] = { composting_chance: Math.round(layers * 100) };\n }\n\n const resistant = type.params(damageResistant);\n if (resistant?.types.kind === 'tag' && resistant.types.tag === 'minecraft:is_fire') {\n projected['minecraft:fire_resistant'] = { value: true };\n }\n\n const cooldown = type.params(useCooldown);\n if (cooldown !== undefined) {\n projected['minecraft:cooldown'] = {\n category: cooldownCategoryOf(type),\n duration: cooldown.seconds,\n type: 'use'\n };\n }\n\n const repairableParams = type.params(repairable);\n if (repairableParams !== undefined) {\n const items = bedrockItemNamesOf(repairableParams.items, options);\n if (items !== undefined) {\n projected['minecraft:repairable'] = {\n repairItems: items.map((name) => ({ items: [name] }))\n };\n }\n }\n\n return projected;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+KA,IAAa,+BAA+B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;;;AAKA,IAAa,iCAAiC,CAAC;;;AAI/C,IAAM,mBAAmB,MAAgB,cAA+B;CACpE,MAAM,SAAS,KAAK,kBAAkB,IAAI,SAAS;CACnD,OAAO,SAAS,MAAM,IAAI,OAAO,QAAQ;AAC7C;;AAGA,IAAM,oBAAoB,MAAgB,cAA2C;CACjF,MAAM,QAAQ,gBAAgB,MAAM,SAAS;CAC7C,OAAO,OAAO,UAAU,YAAY,QAAQ,KAAA;AAChD;;AAGA,IAAM,oBAAoB,MAAgB,cAA0C;CAChF,MAAM,QAAQ,gBAAgB,MAAM,SAAS;CAC7C,OAAO,OAAO,UAAU,YAAY,OAAO,cAAc,KAAK,IAAI,QAAQ,KAAA;AAC9E;;AAGA,IAAM,iBAAiB,SAA4D;CAC/E,MAAM,SAAS,KAAK,kBAAkB,IAAI,gBAAgB;CAC1D,IAAI,OAAO,WAAW,UAAU,OAAO,EAAE,UAAU,EAAE,SAAS,OAAO,EAAE;CACvE,IAAI,CAAC,SAAS,MAAM,GAAG,OAAO,KAAA;CAE9B,MAAM,WAAW,OAAO;CACxB,IAAI,SAAS,QAAQ,GAAG;EACpB,MAAM,UAAU,OAAO,QAAQ,QAAQ,CAAC,CAAC,QACpC,UAAqC,OAAO,MAAM,OAAO,QAC9D;EACA,OAAO,EAAE,UAAU,OAAO,YAAY,OAAO,EAA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E,IAAI,UAAU,KAAA,GACV,UAAU,0BAA0B,EAChC,aAAa,MAAM,KAAK,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EACxD;CAER;CAEA,OAAO;AACX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsprismarine/items",
|
|
3
|
-
"version": "0.23.2
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "The item definition and component runtime: Java 26.3's 122 data component types over Bedrock item identities",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"license": "(MIT OR MPL-2.0)",
|
|
53
53
|
"homepage": "https://github.com/JSPrismarine/JSPrismarine/tree/master/packages/items",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@jsprismarine/content": "0.23.2
|
|
56
|
-
"@jsprismarine/errors": "0.23.2
|
|
55
|
+
"@jsprismarine/content": "0.23.2",
|
|
56
|
+
"@jsprismarine/errors": "0.23.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@jsprismarine/bedrock-data": "0.23.2
|
|
60
|
-
"@jsprismarine/mapping": "0.23.2
|
|
59
|
+
"@jsprismarine/bedrock-data": "0.23.2",
|
|
60
|
+
"@jsprismarine/mapping": "0.23.2",
|
|
61
61
|
"@types/node": "26.6.6",
|
|
62
62
|
"glob": "14.0.6",
|
|
63
63
|
"prettier": "3.10.1",
|