Skript icon indicating copy to clipboard operation
Skript copied to clipboard

1.21 Support

Open APickledWalrus opened this issue 1 year ago • 7 comments

Description

This PR intends to add support for Minecraft 1.21.

I have added a new testing environment for Paper 1.21. Skript compiled without issue (at the time of writing this).

However, without this PR, Skript fails to load on Paper 1.21 (and presumably any further new releases) due to ItemStack changes. ItemStacks can no longer represent block-only materials (that is, materials such that !Material#isItem). This is only more of a push for us to make strong changes regarding the ItemType/ItemStack/BlockData trio, but an ideal fix would likely require a significant time investment to completely rework the alias/ItemType system.

Fortunately, I have managed to get Skript loading and tests passing without too many changes. One significant change is that ItemStack#getRandom is now nullable. There is no way to avoid this. There are now likely instances of unsafe getRandom usage that need fixed (I have not taken the time to resolve this yet). Internally, it is now the case that an ItemData may not have an ItemStack. This item stack was likely unused in many cases as these datas represented blocks. With all of these changes, this PR needs extensive testing to determine how


Target Minecraft Versions: 1.21+, though these ItemType/ItemData changes apply to all versions (which we may want to discuss) Requirements: none Related Issues:

  • https://github.com/SkriptLang/Skript/issues/6796

APickledWalrus avatar Jun 18 '24 05:06 APickledWalrus

Yeah! This works perfectly for me. Great work! Big up

PetyXbron avatar Jun 21 '24 17:06 PetyXbron

Works perfectly for me aswell, please merge it, so auto update works instead of using a custom version

csd4ni3l avatar Jun 28 '24 12:06 csd4ni3l

Works perfectly for me aswell, please merge it, so auto update works instead of using a custom version

The next public beta is scheduled for the 1st of July (in 3 days) where you'll be able to download it from the GitHub. There'll be about 15 days for people to review and give feedback before the next stable version is released after that. You can find more information in our release document and readme :)

Moderocky avatar Jun 28 '24 12:06 Moderocky

related? #6830

sovdeeth avatar Jun 28 '24 21:06 sovdeeth

Likely. There are probably mainly places that do not properly check ItemMeta/Stack nullability

APickledWalrus avatar Jun 28 '24 23:06 APickledWalrus

Can any of you build this version and link it as a .jar, so we don't have to do it ourselves, thank you

itfoldy avatar Jun 28 '24 23:06 itfoldy

Can any of you build this version and link it as a .jar, so we don't have to do it ourselves, thank you

This is automatically done 🙂 You can download the nightly build artifact from here: https://github.com/SkriptLang/Skript/actions/runs/9702144977

APickledWalrus avatar Jun 28 '24 23:06 APickledWalrus

The exp orb merge regression test is failing in a novel way, which seems unrelated to the changes here. Perhaps Paper 1.21 doesn't merge xp as aggressively?

sovdeeth avatar Jul 01 '24 13:07 sovdeeth

FYI @sovdeeth regarding this:

The exp orb merge regression test is failing in a novel way, which seems unrelated to the changes here. Perhaps Paper 1.21 doesn't merge xp as aggressively?

The defaults were reduced in a recent Paper commit here.

I've used this branch in my 1.21 testing with no issues so far -- thanks/great work team!

TheBentoBox avatar Jul 01 '24 17:07 TheBentoBox

FYI @sovdeeth regarding this:

The exp orb merge regression test is failing in a novel way, which seems unrelated to the changes here. Perhaps Paper 1.21 doesn't merge xp as aggressively?

The defaults were reduced in a recent Paper commit here.

I've used this branch in my 1.21 testing with no issues so far -- thanks/great work team!

yeah, we (I) couldn't figure out how to edit the configs in the test servers so i just disabled it for now.

sovdeeth avatar Jul 01 '24 17:07 sovdeeth