Repository navigation
feat(block): implement decorated pot - #979
Open
PowerRubik wants to merge 1 commit into
Open
PowerRubik wants to merge 1 commit into
PowerRubik wants to merge 1 commit into
Conversation
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>
Flint test reportImplemented tests: 820 total, 771 passed, 49 failed Regressions
Newly implemented blocks/items
0 tests, 0 passed, 0 failed Workflow run · failure links to flint-viz are in the test log |
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
Implements the decorated pot, ported from vanilla
DecoratedPotBlockandDecoratedPotBlockEntity.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_usedstat, insert sound pitched by fill level,dust_plumeparticles and ablock_changegame event. Otherwise falls through touseWithoutItem(fail sound, negative wobble, game event).playerWillDestroy: cracks the pot when the main-hand item is in#breaks_decorated_potsand has no#prevents_decorated_pot_shatteringenchantment.onProjectileHit: cracks and destroys the pot when the projectile may interact and break it.getDrops: supplies theminecraft:sherdsdynamic drop (left, back, front, right), so cracked pots drop their sherds and intact ones drop the pot withpot_decorations.getCloneItemStack: the pot with its decorations.RandomizableContainerStorage, with the vanilla NBT format (sherds,item, orLootTable/LootTableSeedviatryLoadLootTable/trySaveLootTable), update tag,pot_decorations+containerimplicit components and the wobble block event.Loot infrastructure
The pot's loot table needed two pieces that were missing, both implemented generically:
minecraft:dynamicentries now resolve drops a block supplies throughBlockLootContext::with_dynamic_drops(vanillaLootParams.DynamicDrop).copy_componentswith ablock_entitysource now copies any collected component (vanillaCopyComponentsFunction+BlockEntity.collectComponents), not justcustom_name. Supported byItemStack::set_raw.Side effects on other blocks using the same function:
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
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-corepasses,cargo clippy -p steel-core -p steel-registry --all-targets --all-featuresis clean.Screenshots / logs
Checklist
Classes / commands modified:
DecoratedPotBlock, DecoratedPotBlockEntity
Additional notes
block_entity/registry.rsuses the same#[expect(clippy::too_many_lines, ...)]as feat(block): implement hopper #978 (hopper), so the two should merge cleanly in either order.randomizable_container/storage.rsandloot/context.rs.🤖 Generated with Claude Code