From ad5c365c2c9a5490ec3ca7e278875404b3b13faf Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Fri, 24 Apr 2026 15:19:39 +0100 Subject: [PATCH] fix(camping): use air/liquid check for tent ground + legacy geo format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two live-testing regressions: - block.isSolid is not a reliable member of the @minecraft/server Block API in BDS 1.26 — it returned undefined, so !b.isSolid was always true and every ground cell failed. Replaced with !b.isAir && !b.isLiquid (same predicate the clear-space check below already uses), which correctly accepts grass/dirt/stone and only rejects air or water/lava. - The half-slab hammock geometry was silently rejected and rendered invisible. The block-model parser wants the legacy 1.12.0 format with simple "uv": [0, 0], not 1.21.0 with per-face UV objects. Rewritten hammock_slab.geo.json to match the working addon/spark_pet_RP/models/blocks/dragon_basket.geo.json format. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../camping_supplies_BP/scripts/main.js | 2 +- .../models/blocks/hammock_slab.geo.json | 22 ++++--------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/camping-supplies-addon/camping_supplies_BP/scripts/main.js b/camping-supplies-addon/camping_supplies_BP/scripts/main.js index dc8215f..650bbab 100644 --- a/camping-supplies-addon/camping_supplies_BP/scripts/main.js +++ b/camping-supplies-addon/camping_supplies_BP/scripts/main.js @@ -130,7 +130,7 @@ function tryPlaceTent(player) { for (const g of groundCells) { const b = dim.getBlock(g); - if (!b || !b.isSolid) { + if (!b || b.isAir || b.isLiquid) { const seen = b ? b.typeId : "unloaded"; player.sendMessage(`§c[Camping] §7Ground at §f${g.x},${g.y},${g.z}§7 is §f${seen}§7 — need solid ground there.`); return false; diff --git a/camping-supplies-addon/camping_supplies_RP/models/blocks/hammock_slab.geo.json b/camping-supplies-addon/camping_supplies_RP/models/blocks/hammock_slab.geo.json index 10d8eba..f7e15a6 100644 --- a/camping-supplies-addon/camping_supplies_RP/models/blocks/hammock_slab.geo.json +++ b/camping-supplies-addon/camping_supplies_RP/models/blocks/hammock_slab.geo.json @@ -1,32 +1,18 @@ { - "format_version": "1.21.0", + "format_version": "1.12.0", "minecraft:geometry": [ { "description": { "identifier": "geometry.silverlabs.hammock_slab", "texture_width": 16, - "texture_height": 16, - "visible_bounds_width": 2, - "visible_bounds_height": 1, - "visible_bounds_offset": [0, 0.25, 0] + "texture_height": 16 }, "bones": [ { - "name": "root", + "name": "slab", "pivot": [0, 0, 0], "cubes": [ - { - "origin": [-8, 0, -8], - "size": [16, 4, 16], - "uv": { - "north": { "uv": [0, 12], "uv_size": [16, 4] }, - "south": { "uv": [0, 12], "uv_size": [16, 4] }, - "east": { "uv": [0, 12], "uv_size": [16, 4] }, - "west": { "uv": [0, 12], "uv_size": [16, 4] }, - "up": { "uv": [0, 0], "uv_size": [16, 16] }, - "down": { "uv": [0, 0], "uv_size": [16, 16] } - } - } + { "origin": [-8, 0, -8], "size": [16, 4, 16], "uv": [0, 0] } ] } ]