diff --git a/package.json b/package.json index b8ca258..3b1edf5 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "lint:fix": "eslint --fix src && prettier --check --write src" }, "devDependencies": { - "@minecraft/server": "1.11.0-beta.1.20.80-stable", + "@minecraft/server": "1.11.0", "@rollup/plugin-node-resolve": "^15.1.0", "@rollup/plugin-typescript": "^11.1.2", "@types/fs-extra": "^11.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33086b7..a29818c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,8 +11,8 @@ dependencies: devDependencies: '@minecraft/server': - specifier: 1.11.0-beta.1.20.80-stable - version: 1.11.0-beta.1.20.80-stable + specifier: 1.11.0 + version: 1.11.0 '@rollup/plugin-node-resolve': specifier: ^15.1.0 version: 15.1.0(rollup@3.27.0) @@ -126,23 +126,16 @@ packages: /@mcbe-mods/utils@0.1.1: resolution: {integrity: sha512-mXGzkyDUqS6IKDhOhW1l+OF0bQtW+U6bb+RcOZwX/H70Tbh6Ro0C4ZifihMLHUqo5lOcmvok0vjkuYJ+NQSMGQ==} dependencies: - '@minecraft/server': 1.10.0 + '@minecraft/server': 1.11.0 dev: false /@minecraft/common@1.1.0: resolution: {integrity: sha512-stbUtINCXbcLNRlGNVX68xRC6ZYq3k3CYmfptwrCcPBEUjVOpVkSj3H4Y0qiSYB+1rVWv7DgiP7Uf9++50Ne5g==} - /@minecraft/server@1.10.0: - resolution: {integrity: sha512-liBalm1XKMtf7LPyKZ4VcuwxAbprKcAHnG6b0VUdULezOz/RFj2gqmfyA0qE8azMMa8KVPmnl7hYq4KjoGZmmA==} + /@minecraft/server@1.11.0: + resolution: {integrity: sha512-sVTKkAR7fgcgRrBrl+QiqlwiL07JTCSRbwSLpkmsPDvgfhH4bQsdPXC8fWZGRxwKikC4/oBxGq5j6pJp87yF6Q==} dependencies: '@minecraft/common': 1.1.0 - dev: false - - /@minecraft/server@1.11.0-beta.1.20.80-stable: - resolution: {integrity: sha512-nedguYKlNHbwe34YlmwF4R1K3ZDW3qzD7xnxODt9PuSwyFfmQzTG0JbN6ulBrMdE60VwQ3qBr46sGO6xtaNJSA==} - dependencies: - '@minecraft/common': 1.1.0 - dev: true /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} diff --git a/src/behavior_pack/manifest.json b/src/behavior_pack/manifest.json index 76390d5..7a05794 100644 --- a/src/behavior_pack/manifest.json +++ b/src/behavior_pack/manifest.json @@ -4,8 +4,8 @@ "description": "pack.description", "name": "pack.name", "uuid": "90ce7a3b-8477-49cf-9d35-7e56b27f7e9c", - "version": [1, 0, 3], - "min_engine_version": [1, 20, 80] + "version": [1, 0, 4], + "min_engine_version": [1, 21, 0] }, "modules": [ { @@ -13,7 +13,7 @@ "language": "javascript", "type": "script", "uuid": "c947417b-7bc9-4c35-85dc-2eafc2579200", - "version": [1, 0, 3], + "version": [1, 0, 4], "entry": "scripts/main.js" } ], @@ -25,7 +25,7 @@ "dependencies": [ { "module_name": "@minecraft/server", - "version": "1.11.0-beta" + "version": "1.11.0" } ] } diff --git a/src/behavior_pack/scripts/main.ts b/src/behavior_pack/scripts/main.ts index b415f40..a7bb467 100644 --- a/src/behavior_pack/scripts/main.ts +++ b/src/behavior_pack/scripts/main.ts @@ -38,7 +38,7 @@ world.afterEvents.playerBreakBlock.subscribe(async (e) => { */ // eslint-disable-next-line max-statements async function digOre(player: Player, dimension: Dimension, location: Vector3, blockTypeId: string) { - const equipmentInventory = player.getComponent(EntityEquippableComponent.componentId) + const equipmentInventory = player.getComponent(EntityEquippableComponent.componentId) as EntityEquippableComponent if (!equipmentInventory) return const mainHand = equipmentInventory.getEquipmentSlot(EquipmentSlot.Mainhand) @@ -50,14 +50,14 @@ async function digOre(player: Player, dimension: Dimension, location: Vector3, b const pickaxe = pickaxe_level[currentSlotItem.typeId as keyof typeof pickaxe_level] // The player is not stalking or not holding an axe, one of the conditions is not met will end directly - if (!player.isSneaking || !currentSlotItem?.typeId.endsWith('_pickaxe')) return + if (!player.isSneaking || !currentSlotItem.hasTag('is_pickaxe')) return const survivalPlayer = isSurvivalPlayer(dimension, player) if (survivalPlayer) mainHand.lockMode = ItemLockMode.slot - const itemDurability = currentSlotItem.getComponent(ItemDurabilityComponent.componentId) - const enchantments = currentSlotItem.getComponent(ItemEnchantableComponent.componentId) + const itemDurability = currentSlotItem.getComponent(ItemDurabilityComponent.componentId) as ItemDurabilityComponent + const enchantments = currentSlotItem.getComponent(ItemEnchantableComponent.componentId) as ItemEnchantableComponent if (!enchantments || !itemDurability) return diff --git a/src/behavior_pack/texts/en_US.lang b/src/behavior_pack/texts/en_US.lang index 0b0e970..1e641d1 100644 --- a/src/behavior_pack/texts/en_US.lang +++ b/src/behavior_pack/texts/en_US.lang @@ -1,2 +1,2 @@ -pack.name=One Click Dig Ore v1.0.3 -pack.description=Minecraft Bedrock Edition One Click Dig Ore mods \ No newline at end of file +pack.name=One Click Dig Ore v1.0.4 +pack.description=Chain mining with one click to make mining easier \ No newline at end of file diff --git a/src/behavior_pack/texts/zh_CN.lang b/src/behavior_pack/texts/zh_CN.lang index 53e6b74..04953c8 100644 --- a/src/behavior_pack/texts/zh_CN.lang +++ b/src/behavior_pack/texts/zh_CN.lang @@ -1,2 +1,2 @@ -pack.name=一键挖矿 v1.0.3 -pack.description=我的世界基岩版一键挖矿模组 \ No newline at end of file +pack.name=一键挖矿 v1.0.4 +pack.description=一键连锁采矿,让采矿更轻松 \ No newline at end of file