Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portable storage piston/dispenser behaviors #60

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

jshipley
Copy link
Contributor

@jshipley jshipley commented Aug 8, 2024

With this change, portable tank and portable energy storage can be broken by pistons and placed by dispensers, just like shulker boxes. This enables redstone filling mechanisms that can keep replacing full storage blocks with empty storage blocks (or vice versa). Super useful for carrying large amounts of lava around (or letting drones carry them around).

The biggest change here is adding block_loot datagen for the Portable Tank and Portable Energy Storage that stores Nbt data in the dropped items.

onBreak() wasn't being called when the blocks were destroyed by pistons, so getDroppedStacks() was implemented to make sure that the blocks were dropping their inventory items when they are broken. This should work when broken by a player, or by a piston, or by an explosion.

Between the new block loot and getDroppedStacks(), the onBreak() methods were redundant and were removed.

@Rearth
Copy link
Owner

Rearth commented Aug 20, 2024

Huh, didnt even know datapacks can do that. I'll keep this in mind for a few things in the future. Huge thanks again for the PR

@Rearth Rearth merged commit ae07c85 into Rearth:1.21 Aug 20, 2024
1 check passed
@jshipley jshipley deleted the portable_storage branch August 21, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants