Skip to content

feat(block): implement decorated pot - #979

Open
PowerRubik wants to merge 1 commit into
Steel-Foundation:masterfrom
PowerRubik:feat/decorated-pot
Open

PowerRubik wants to merge 1 commit into
Steel-Foundation:masterfrom
PowerRubik:feat/decorated-pot

Conversation

@PowerRubik

Copy link
Copy Markdown

Type of change

  • Block implementation
  • Item implementation
  • Command implementation
  • Entity implementation
  • Bug fix
  • New feature
  • Breaking change
  • Refactor / code cleanup
  • Performance improvement
  • Chore / tooling

Description

Implements the decorated pot, ported from vanilla DecoratedPotBlock and DecoratedPotBlockEntity.

  • Block: placement (horizontal facing, waterlogging), water ticks in updateShape, not pathfindable, comparator output and output-signal update on removal.
    • useItemOn: inserts one item into an empty pot or onto a matching, non-full stack (isSameItemSameComponents), with the positive wobble, item_used stat, insert sound pitched by fill level, dust_plume particles and a block_change game event. Otherwise falls through to useWithoutItem (fail sound, negative wobble, game event).
    • playerWillDestroy: cracks the pot when the main-hand item is in #breaks_decorated_pots and has no #prevents_decorated_pot_shattering enchantment.
    • onProjectileHit: cracks and destroys the pot when the projectile may interact and break it.
    • getDrops: supplies the minecraft:sherds dynamic drop (left, back, front, right), so cracked pots drop their sherds and intact ones drop the pot with pot_decorations.
    • getCloneItemStack: the pot with its decorations.
  • Block entity: one-slot randomizable container on RandomizableContainerStorage, with the vanilla NBT format (sherds, item, or LootTable/LootTableSeed via tryLoadLootTable / trySaveLootTable), update tag, pot_decorations + container implicit components and the wobble block event.

Loot infrastructure

The pot's loot table needed two pieces that were missing, both implemented generically:

  • minecraft:dynamic entries now resolve drops a block supplies through BlockLootContext::with_dynamic_drops (vanilla LootParams.DynamicDrop).
  • copy_components with a block_entity source now copies any collected component (vanilla CopyComponentsFunction + BlockEntity.collectComponents), not just custom_name. Supported by ItemStack::set_raw.

Side effects on other blocks using the same function:

  • Banners now drop with their patterns and name (they dropped nothing before).
  • Beehives and bee nests now drop, but without bees, since Steel doesn't collect that component yet (they also dropped nothing before).

Not covered: rotate/mirror and the cracked sound type, since Steel has no hooks for them yet.

How this was tested

  • Unit tests in behavior/blocks/decoration/decorated_pot_tests.rs: insertion and stacking rules, intact vs. cracked drops (sherd order), NBT round-trip under vanilla keys, clone item stack.
  • cargo test -p steel-core passes, cargo clippy -p steel-core -p steel-registry --all-targets --all-features is clean.
  • Manually tested in game (MC 26.3, Linux).

Screenshots / logs

Checklist

  • Code builds w/o errors or warnings
  • Self-reviewed the diff
  • Docs updated (if applicable)
  • No leftover debug code / comments

Classes / commands modified:

DecoratedPotBlock, DecoratedPotBlockEntity

Additional notes

  • block_entity/registry.rs uses the same #[expect(clippy::too_many_lines, ...)] as feat(block): implement hopper #978 (hopper), so the two should merge cleanly in either order.
  • Small overlap with draft add map #886 in randomizable_container/storage.rs and loot/context.rs.

🤖 Generated with Claude Code

Port vanilla DecoratedPotBlock and DecoratedPotBlockEntity: single-stack
item insertion with wobble, sound and particles, sherd decorations,
shattering by tool tag or projectile into sherds, clone item stacks,
comparator output and vanilla persistence (sherds, item, loot table).

Loot support needed for the pot's drops, implemented generically:
- `minecraft:dynamic` entries resolve drops supplied by the block
- `copy_components` with a `block_entity` source copies any collected
  component, not only `custom_name`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown

Flint test report

Implemented tests: 820 total, 771 passed, 49 failed

Regressions

  • ❌ bamboo_stacking_on_stalk (missing from results)
  • ❌ cactus_destroys_items_inside

Newly implemented blocks/items

minecraft:decorated_pot

0 tests, 0 passed, 0 failed

⚠️ No Flint tests cover these ids yet.

Workflow run · failure links to flint-viz are in the test log

@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown

This pull request has conflicts with the base branch "master". Please resolve those so we can test out your changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant