Compare commits

...

3 Commits

Author SHA1 Message Date
14043fe2a0 fix(addons): silence boot-time warnings on naturalist + dynamite
All checks were successful
Deploy Addons / deploy (push) Successful in 14s
- naturalist-lite: add stub item definitions for silverlabs_nat:frog_leg,
  cooked_frog_leg, snake_egg_block. Owl + snake behaviour files
  reference these but they were never defined, so BDS logged "Unknown
  item during Deferred ItemDescriptor resolution" on every boot. Stubs
  are functional — frog_leg restores 2 hunger, cooked 4, snake egg is
  a placeable nature-tab item. RP texture entries + lang strings added
  for completeness; icons fall back to candy-cane until art lands.
- dynamite: drop the broken spawn_aoe_cloud component on thrown_banger
  (its particle id "minecraft:explosion_manual" doesn't exist in BDS;
  every replacement I tried also failed schema validation). The
  random.fuse hit_sound + impact_damage still fire, the entity is
  destroyed on hit — just no lingering AOE puff.

Also: add *.bak.local to .gitignore so docker-compose.yml.bak.local and
similar local backup files stop showing up in git status.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 23:15:13 +01:00
eb82c8307b feat(hemp): wild patches in plains/forest + chest seed injection
Two new ways to find hemp seeds without already having any:

1. Worldgen: minecraft:scatter_feature spawns 1-3 mature
   silverlabs:hemp_crop blocks on grass/dirt in plains/forest/birch/
   flower_forest biomes (~14% scatter chance per chunk surface pass).
2. Chest injection: 8% chance per chest first-open to plant 1-3 seeds
   in a random empty slot. Tracked per-chest via world dynamic property
   (rolling cap of 500 entries) so each chest only contributes once.

Bedrock has no loot-table merge mechanism so we can't add seeds to
vanilla village chests without losing their vanilla loot — script
injection sidesteps that and stays version-independent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 23:14:54 +01:00
cc57662468 feat(hub-return): rotating-needle recovery compass texture (32 frames)
Replaces vanilla blue right-pointing-triangle with a red/white compass
needle on a lodestone face, rotating through 32 angular positions
(11.25° per frame). RP bumped 1.0.1 → 1.0.2.

Earlier 16-frame attempt caused GPU sampling beyond the texture buffer
(flashing diagonal-line corruption); Bedrock's recovery_compass_atlas
expects 32 frames at 16×16 each = 512×16 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 23:14:40 +01:00
13 changed files with 193 additions and 8 deletions

3
.gitignore vendored
View File

@@ -20,6 +20,9 @@ addon/build/
# (LEVEL_NAME, etc.) that must survive deploys. Never committed.
docker-compose.override.yml
# Local-only backup files (e.g. docker-compose.yml.bak.local)
*.bak.local
# Server data (Docker volumes are external, but just in case)
server-data/

View File

@@ -25,12 +25,6 @@
"destroy_on_hit": true,
"semi_random_diff_damage": false
},
"spawn_aoe_cloud": {
"radius": 1.5,
"duration": 0,
"particle": "minecraft:explosion_manual",
"affect_owner": false
},
"remove_on_hit": {}
},
"power": 1.4,

View File

@@ -0,0 +1,35 @@
{
"format_version": "1.21.0",
"minecraft:feature_rules": {
"description": {
"identifier": "silverlabs:hemp_patch_rule",
"places_feature": "silverlabs:hemp_patch_feature"
},
"conditions": {
"placement_pass": "surface_pass",
"minecraft:biome_filter": [
{
"any_of": [
{ "test": "has_biome_tag", "value": "plains" },
{ "test": "has_biome_tag", "value": "forest" },
{ "test": "has_biome_tag", "value": "birch" },
{ "test": "has_biome_tag", "value": "flower_forest" }
]
},
{ "test": "has_biome_tag", "operator": "!=", "value": "monster" }
]
},
"distribution": {
"iterations": 1,
"scatter_chance": 14,
"x": { "distribution": "uniform", "extent": [0, 16] },
"y": {
"distribution": "fixed_grid",
"extent": [0, 64],
"grid_offset": 0,
"step_size": 1
},
"z": { "distribution": "uniform", "extent": [0, 16] }
}
}
}

View File

@@ -0,0 +1,12 @@
{
"format_version": "1.21.0",
"minecraft:scatter_feature": {
"description": { "identifier": "silverlabs:hemp_patch_feature" },
"iterations": 3,
"scatter_chance": 65,
"x": { "distribution": "uniform", "extent": [-3, 4] },
"y": 0,
"z": { "distribution": "uniform", "extent": [-3, 4] },
"places_feature": "silverlabs:hemp_single_feature"
}
}

View File

@@ -0,0 +1,27 @@
{
"format_version": "1.21.0",
"minecraft:single_block_feature": {
"description": { "identifier": "silverlabs:hemp_single_feature" },
"places_block": {
"name": "silverlabs:hemp_crop",
"states": {
"silverlabs:hemp_age": 4,
"silverlabs:hemp_top": false
}
},
"enforce_survivability_rules": true,
"enforce_placement_rules": true,
"may_attach_to": {
"min_sides_must_attach": 1,
"top": [
"minecraft:grass_block",
"minecraft:dirt",
"minecraft:podzol",
"minecraft:coarse_dirt"
]
},
"may_replace": [
"minecraft:air"
]
}
}

View File

@@ -681,6 +681,62 @@ world.afterEvents.itemCompleteUse.subscribe((event) => {
}
});
// --- Chest loot injection: first-time-open chests sometimes contain seeds ---
// Bedrock has no merge-loot-table mechanism, so we hook chest opens and
// deposit hemp_seeds with low probability into a random empty slot.
// Tracking is per-chest via a world dynamic property holding a JSON list
// of "dim:x:y:z" keys; pruned to a rolling cap to bound storage.
const CHEST_TYPES = new Set(["minecraft:chest", "minecraft:trapped_chest"]);
const CHEST_SEED_CHANCE = 0.08;
const SEEDED_PROP = "hemp_seeded_chests_v1";
const SEEDED_CAP = 500;
function chestKey(block) {
const l = block.location;
return `${block.dimension.id}:${l.x}:${l.y}:${l.z}`;
}
function loadSeededChests() {
try {
const raw = world.getDynamicProperty(SEEDED_PROP);
return new Set(raw ? JSON.parse(raw) : []);
} catch (_) { return new Set(); }
}
function saveSeededChests(set) {
// Prune oldest if over cap (Set preserves insertion order in JS)
if (set.size > SEEDED_CAP) {
const arr = Array.from(set).slice(set.size - SEEDED_CAP);
set = new Set(arr);
}
try {
world.setDynamicProperty(SEEDED_PROP, JSON.stringify(Array.from(set)));
} catch (_) {}
}
world.afterEvents.playerInteractWithBlock.subscribe((event) => {
const block = event.block;
if (!block || !CHEST_TYPES.has(block.typeId)) return;
// Only on the open hand (not while holding an item, to avoid placing-into events firing twice)
const stack = event.itemStack;
if (stack) return;
const key = chestKey(block);
const seeded = loadSeededChests();
if (seeded.has(key)) return;
seeded.add(key);
saveSeededChests(seeded);
if (!chance(CHEST_SEED_CHANCE)) return;
// Try to insert into a random empty slot
let inv;
try { inv = block.getComponent("minecraft:inventory")?.container; } catch (_) { return; }
if (!inv) return;
const empties = [];
for (let i = 0; i < inv.size; i++) if (!inv.getItem(i)) empties.push(i);
if (empties.length === 0) return;
const slot = empties[rand(empties.length)];
const count = 1 + rand(3); // 1-3 seeds
try { inv.setItem(slot, new ItemStack(SEEDS, count)); } catch (_) {}
// No chat ping — let the player discover the seeds organically.
});
system.run(() => {
world.sendMessage("§a[Hemp] §7Hemp pack loaded.");
});

View File

@@ -7,7 +7,7 @@
"version": [
1,
0,
1
2
],
"min_engine_version": [
1,
@@ -22,7 +22,7 @@
"version": [
1,
0,
1
2
]
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,16 @@
{
"format_version": "1.21.0",
"minecraft:item": {
"description": {
"identifier": "silverlabs_nat:cooked_frog_leg",
"menu_category": { "category": "items", "group": "itemGroup.name.miscFood" }
},
"components": {
"minecraft:icon": "silverlabs_nat.cooked_frog_leg",
"minecraft:max_stack_size": 64,
"minecraft:food": { "nutrition": 4, "saturation_modifier": 1.2 },
"minecraft:use_animation": "eat",
"minecraft:use_modifiers": { "use_duration": 1.6, "movement_modifier": 0.35 }
}
}
}

View File

@@ -0,0 +1,16 @@
{
"format_version": "1.21.0",
"minecraft:item": {
"description": {
"identifier": "silverlabs_nat:frog_leg",
"menu_category": { "category": "items", "group": "itemGroup.name.miscFood" }
},
"components": {
"minecraft:icon": "silverlabs_nat.frog_leg",
"minecraft:max_stack_size": 64,
"minecraft:food": { "nutrition": 2, "saturation_modifier": 0.6 },
"minecraft:use_animation": "eat",
"minecraft:use_modifiers": { "use_duration": 1.6, "movement_modifier": 0.35 }
}
}
}

View File

@@ -0,0 +1,13 @@
{
"format_version": "1.21.0",
"minecraft:item": {
"description": {
"identifier": "silverlabs_nat:snake_egg_block",
"menu_category": { "category": "nature" }
},
"components": {
"minecraft:icon": "silverlabs_nat.snake_egg_block",
"minecraft:max_stack_size": 16
}
}
}

View File

@@ -16,4 +16,8 @@ entity.silverlabs_nat:coral_snake_egg.name=Coral Snake Egg
tile.silverlabs_nat:cave_snake_egg.name=Cave Snake Egg
tile.silverlabs_nat:coral_snake_egg.name=Coral Snake Egg
item.silverlabs_nat:frog_leg.name=Frog Leg
item.silverlabs_nat:cooked_frog_leg.name=Cooked Frog Leg
item.silverlabs_nat:snake_egg_block.name=Snake Egg

View File

@@ -94,6 +94,15 @@
},
"silverlabs_nat.tiger_spawn_egg": {
"textures": "textures/sf/nba/items/tiger_default_spawn_egg"
},
"silverlabs_nat.frog_leg": {
"textures": "textures/sf/nba/items/frog_leg"
},
"silverlabs_nat.cooked_frog_leg": {
"textures": "textures/sf/nba/items/cooked_frog_leg"
},
"silverlabs_nat.snake_egg_block": {
"textures": "textures/sf/nba/items/snake_egg_block"
}
}
}