Detect unknown bukkit versions with the dataversion#53
Open
Joo200 wants to merge 1 commit intolmk02:masterfrom
Open
Detect unknown bukkit versions with the dataversion#53Joo200 wants to merge 1 commit intolmk02:masterfrom
Joo200 wants to merge 1 commit intolmk02:masterfrom
Conversation
…nown bukkit versions
syldium
reviewed
Jan 23, 2022
Contributor
syldium
left a comment
There was a problem hiding this comment.
Less duplication is a must 👍
| return new Version(1, Integer.parseInt(split[1]), | ||
| split.length > 2 ? Integer.parseInt(split[2]) : 0, pack.substring(pack.lastIndexOf('.') + 1)); | ||
| } | ||
| return v1_12; |
Contributor
There was a problem hiding this comment.
Is there a reason that 1.12 is the default version?
Author
There was a problem hiding this comment.
Short answer: No. Currently the plugin crashes with an exception when no valid version is found. This is not a good thing and there might be a better way to handle this.
Comment on lines
+19
to
+21
| //public static final Version v1_18_1 = new Version(1, 18, 1, "v1_18_R1", 2865); | ||
| //public static final Version v1_18 = new Version(1, 18, "v1_18_R1", 2860); | ||
| //public static final Version v1_17_1 = new Version(1, 17, 1, "v1_17_R1", 2730); |
Author
There was a problem hiding this comment.
Okay, I'm not too familiar with that Version stuff in BlockParty, I just had some problems getting it to work with my custom paper fork.
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.
I removed the duplicated MinecraftVersion class and added some code to detect the used Minecraft version based on the DataVersion of the server.
The DataVersion is accesible through Bukkit.getUnsafe().getDataVersion() since 1.13.x.
https://minecraft.fandom.com/wiki/Data_version#List_of_data_versions
Depending on your used server the version string might be malformed. The DataVersion should work but is not accessible in Bukkit =< 1.12