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

Fix Aliases For 1.20.5/1.20.6 #112

Merged
merged 5 commits into from
May 1, 2024
Merged

Conversation

APickledWalrus
Copy link
Member

@APickledWalrus APickledWalrus commented Apr 27, 2024

This PR fixes aliases definitions for 1.20.5 support.

There are some additional improvements made to potion patterns (there should be no breaking changes; these changes are intended to improve the toString output).

Data Component Support

Since items can no longer be parsed using the old NBT format, this PR updates NBT-using aliases to use the new data component format. As part of these changes, a new {potion types} global variation has been added (it is shared between potion bottles and tipped arrows).

Deduplication Tag

A deduplication tag can be appended onto an alias to prevent the deduplication process from taking place. It is similar to the relatedEntity tag in that it is internal and removed from the block states map during the parsing process. This is important for items like beacons that have block entity data, which is not associated with any ItemMeta. As a result, if deduplication occurs, a level one beacon and level three beacon are seen as the same thing (the item metas appear to be identical). Thus, we simply opt out of this process for beacons to ensure a level one beacon and level three beacon actually represent different items (at least when in the inventory!)

For more details, see:

Since they are block entity data, they would be mistakenly deduplicated.
@APickledWalrus APickledWalrus added the bug Something isn't working label Apr 27, 2024
@EquipableMC
Copy link

Just out of curiosity, what about servers not using 1.20.5 and the new NBT? How would that play out?

@GStudiosX2
Copy link

Just out of curiosity, what about servers not using 1.20.5 and the new NBT? How would that play out?

I looked through it a bit and seems like they have x after components and x before components so probably should work fine

@APickledWalrus
Copy link
Member Author

Just out of curiosity, what about servers not using 1.20.5 and the new NBT? How would that play out?

The old definitions still exist for versions 1.20.4 and earlier. It will use the correct definition depending on the server version.

This should result in better toString outputs
@APickledWalrus APickledWalrus changed the title Fix Aliases For 1.20.5 Fix Aliases For 1.20.5/1.20.6 Apr 30, 2024
@APickledWalrus APickledWalrus merged commit 9ea857f into master May 1, 2024
@APickledWalrus APickledWalrus deleted the patch/1.20.5-support branch May 1, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants