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

Update to 1.20.5 #4186

Merged
merged 22 commits into from
Sep 13, 2024
Merged

Update to 1.20.5 #4186

merged 22 commits into from
Sep 13, 2024

Conversation

WalshyDev
Copy link
Member

@WalshyDev WalshyDev commented May 5, 2024

Description

Relatively easy update just a bunch of enum changes for which we can just provide a compatible API for.

Proposed changes

Created a bunch of VersionedX classes, I don't really like this but it works for now. Ideally, we build a proper mapping system but for now, I think this is fine. These names have been wrong a long time, I don't see them changing much from here.

Related Issues (if applicable)

N/A

Checklist

  • I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
  • I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.16.* - 1.20.*).
  • I followed the existing code standards and didn't mess up the formatting.
  • I did my best to add documentation to any public classes or methods I added.
  • I have added Nonnull and Nullable annotations to my methods to indicate their behaviour for null values
  • I added sufficient Unit Tests to cover my code.

Still to do

@WalshyDev WalshyDev requested review from a team as code owners May 5, 2024 13:03
@github-actions github-actions bot added the 🧹 Chores Refactoring / Cleanup. label May 5, 2024
Copy link
Contributor

github-actions bot commented May 5, 2024

Your Pull Request was automatically labelled as: "🧹 Chores"
Thank you for contributing to this project! ❤️

Copy link
Contributor

@JustAHuman-xD JustAHuman-xD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should this be something we maybe put in dough instead of SF itself?

@WalshyDev
Copy link
Member Author

Also should this be something we maybe put in dough instead of SF itself?

MinecraftVersion or the versioned stuff? We have a MinecraftVersion in dough, just not with the actual MC vers. The versioned classes, maybe but I don't intend for them to be around forever or widely used.

@JustAHuman-xD
Copy link
Contributor

Also should this be something we maybe put in dough instead of SF itself?

MinecraftVersion or the versioned stuff? We have a MinecraftVersion in dough, just not with the actual MC vers. The versioned classes, maybe but I don't intend for them to be around forever or widely used.

I was meaning the versioned stuff but yeah if they're temp then it's probably fine

@WalshyDev
Copy link
Member Author

Tests are due to mix of 1.20.6 and 1.20.4, will wait for MockBukkit

This looks alright to me on 1.20.4, not tested 1.20.6 yet since Paper is broken

@J3fftw1
Copy link
Contributor

J3fftw1 commented May 10, 2024

MockBukkit/MockBukkit#1008

@JustAHuman-xD JustAHuman-xD added the 🎮 Game Update This pull request adds compatibility with a new version of Minecraft. label May 30, 2024
@ybw0014
Copy link
Contributor

ybw0014 commented Jun 5, 2024

MockBukkit/MockBukkit#1008

PR is merged, time to have some progress?

@J3fftw1
Copy link
Contributor

J3fftw1 commented Jun 5, 2024

A billion tests have failed

@JustAHuman-xD
Copy link
Contributor

Java version issue by the look of the errors

@J3fftw1
Copy link
Contributor

J3fftw1 commented Jun 5, 2024

Ah I saw an open PR for that on mockbukkit

@JustAHuman-xD
Copy link
Contributor

I think we need to bump Java up to 21 for tests since that's what mockbukkits Java is now... Could be wrong tho

@TheBusyBot TheBusyBot added the ⚡ Merge Conflicts This Pull Request has merged conflicts which need to be resolved! label Jun 8, 2024
@md5sha256
Copy link
Contributor

md5sha256 commented Aug 11, 2024

Okay so tests now compiled on Java 21 (main sources still compile agains 16) and the mockbukkit version. I've also fixed the merge conflict so now all thats left for the tests to pass is dough... not entirely sure how to fix this. The ItemUtils class doesn't compile on 1.20.5+ due to the enchantments constants changes. So unless dough adopts some sort of Versioned enchantment, we'd have to make dough support 1.20.5+ exclusively for this to work.

@J3fftw1
Copy link
Contributor

J3fftw1 commented Aug 11, 2024

the e2e tester also needs to be updated otherwise it will check against 1.21

@ybw0014
Copy link
Contributor

ybw0014 commented Aug 11, 2024

putting the link to MockBukkit's basePotionType PR here: MockBukkit/MockBukkit#1059

@md5sha256
Copy link
Contributor

putting the link to MockBukkit's basePotionType PR here: MockBukkit/MockBukkit#1059

the PR targets 1.21 though, we won't be able to use it until then...

@ybw0014
Copy link
Contributor

ybw0014 commented Aug 12, 2024

We should probably temporarily disable the tests that use the base potion type. When we work on 1.21, we re-enable and fix those tests.

@J3fftw1
Copy link
Contributor

J3fftw1 commented Aug 12, 2024

We would have to disable the unit test for 1.20.5 and 1.20.6
kinda annoying

@TheBusyBot TheBusyBot removed the ⚡ Merge Conflicts This Pull Request has merged conflicts which need to be resolved! label Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 9, 2024

Slimefun preview build

A Slimefun preview build is available for testing!
Commit: 00544df

https://preview-builds.walshy.dev/download/Slimefun/4186/00544df8

Note: This is not a supported build and is only here for the purposes of testing.
Do not run this on a live server and do not report bugs anywhere but this PR!

@WalshyDev
Copy link
Member Author

WalshyDev commented Sep 9, 2024

Testing is done: https://discord.com/channels/565557184348422174/565570276038017044/1282538803940163584

Planned merge date: 9/10th Sept

md5sha256
md5sha256 previously approved these changes Sep 9, 2024
Copy link
Contributor

@md5sha256 md5sha256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@J3fftw1 J3fftw1 added the Build tested Used to indicate the PR preview build has been tested by one of the team label Sep 9, 2024
Copy link
Contributor

@J3fftw1 J3fftw1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after the points from YB have been addressed

* fix: fix isBefore, also added unit tests

* chore: comments

* chore: simplify

* chore: use == for enum comparison

* chore: retrigger ci

* chore(ci): e2e on more versions
Copy link

sonarcloud bot commented Sep 11, 2024

@ybw0014 ybw0014 mentioned this pull request Sep 12, 2024
5 tasks
Copy link
Member

@svr333 svr333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, should add that it's been a while since I've done mc related coding

@@ -31,6 +33,8 @@ public final class FireworkUtils {
Color.RED, Color.SILVER, Color.TEAL, Color.WHITE, Color.YELLOW
};
// @formatter:on

private static final EntityType firework = VersionedEntityType.FIREWORK;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why you make it a static variable when its only used once

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure either but can be cleaned up later

<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-20240205.114523-90</version>
<version>1.20.6-R0.1-SNAPSHOT</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-SNAPSHOT is still latest version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep that's latest -- probably worth pinning again once we're in .21

Copy link
Contributor

@JustAHuman-xD JustAHuman-xD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as far as I can see as long as it's been tested too!

@WalshyDev WalshyDev merged commit 4e46546 into master Sep 13, 2024
22 checks passed
@WalshyDev WalshyDev deleted the chore/update-to-1-20-5 branch September 13, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build tested Used to indicate the PR preview build has been tested by one of the team 🧹 Chores Refactoring / Cleanup. 🎮 Game Update This pull request adds compatibility with a new version of Minecraft.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants