fix block state meta when no id nbt key is present#10032
Closed
Machine-Maker wants to merge 1 commit into
Closed
Conversation
8339d8c to
c9f1a9b
Compare
Owen1212055
approved these changes
Dec 26, 2023
1eb2cc5 to
c9f1a9b
Compare
Member
Author
|
No longer makes sense with recent blockstatemeta changes |
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.
It is valid in vanilla to have a blockentitytag for an itemstack that does not have an
idkey specifying the type of block entity. This doesn't matter when placing the block because the block type determines the tile entity type, not the ID read from the nbt tag compound. Previously, CraftMetaBlockState expected theidtag except for 2 or 3 exceptions where it was manually added. Not sure why those were singled out, but now this adds a type override based on the specific material.You can test this bug with an item like
minecraft:chest{BlockEntityTag: {Items: [{Slot: 0b, Count: 1b, id: "minecraft:stone"}]}}which is a chest that contains a stone block. It works when placed, but if you call getBlockState on the meta of the stack, you will get an empty chest.