SkriptLang / skript-aliases

Aliases for Skript
20 stars 36 forks source link

Fix Aliases For 1.20.5/1.20.6 #112

Closed APickledWalrus closed 5 months ago

APickledWalrus commented 5 months ago

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:

EquipableMC commented 5 months ago

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

GStudiosX2 commented 5 months ago

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 commented 5 months ago

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.