Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,6 @@ public final class PaperweightAdapter implements BukkitImplAdapter {

private static final RandomSource random = RandomSource.create();

private static final String WRONG_VERSION =
"""
This version of WorldEdit has not been tested with the current Minecraft version.
While it may work, there might be unexpected issues.
It is recommended to use a version of WorldEdit that supports your Minecraft version.
For more information, see https://worldedit.enginehub.org/en/latest/faq/#bukkit-adapters
""".stripIndent();

// ------------------------------------------------------------------------
// Code that may break between versions of Minecraft
// ------------------------------------------------------------------------
Expand All @@ -236,10 +228,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {

int dataVersion = SharedConstants.getCurrentVersion().dataVersion().version();
if (dataVersion != Constants.DATA_VERSION_MC_1_21_11) {
logger.warning(WRONG_VERSION);
}
if (dataVersion >= Constants.DATA_VERSION_MC_26_1) {
throw new RuntimeException("Force prevent this loading on 26.1+");
throw new RuntimeException("Force prevent this loading on >=26.1 or <=1.21.10");
}

serverWorldsField = CraftServer.class.getDeclaredField("worlds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {

int dataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
if (dataVersion != Constants.DATA_VERSION_MC_1_21_4) {
throw new UnsupportedClassVersionError("Not 1.21.4!");
throw new RuntimeException("Not 1.21.4!");
}

serverWorldsField = CraftServer.class.getDeclaredField("worlds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {

int dataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
if (dataVersion != Constants.DATA_VERSION_MC_1_21_5) {
throw new UnsupportedClassVersionError("Not 1.21.5!");
throw new RuntimeException("Not 1.21.5!");
}

serverWorldsField = CraftServer.class.getDeclaredField("worlds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,6 @@ public final class PaperweightAdapter implements BukkitImplAdapter {

private static final RandomSource random = RandomSource.create();

private static final String WRONG_VERSION =
"""
This version of WorldEdit has not been tested with the current Minecraft version.
While it may work, there might be unexpected issues.
It is recommended to use a version of WorldEdit that supports your Minecraft version.
For more information, see https://worldedit.enginehub.org/en/latest/faq/#bukkit-adapters
""".stripIndent();

// ------------------------------------------------------------------------
// Code that may break between versions of Minecraft
// ------------------------------------------------------------------------
Expand All @@ -237,7 +229,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {

int dataVersion = SharedConstants.getCurrentVersion().dataVersion().version();
if (dataVersion < Constants.DATA_VERSION_MC_1_21_6 || dataVersion > Constants.DATA_VERSION_MC_1_21_8) {
logger.warning(WRONG_VERSION);
throw new RuntimeException("Force prevent this loading on >=1.21.9 or <=1.21.5");
}

serverWorldsField = CraftServer.class.getDeclaredField("worlds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,6 @@ public final class PaperweightAdapter implements BukkitImplAdapter {

private static final RandomSource random = RandomSource.create();

private static final String WRONG_VERSION =
"""
This version of WorldEdit has not been tested with the current Minecraft version.
While it may work, there might be unexpected issues.
It is recommended to use a version of WorldEdit that supports your Minecraft version.
For more information, see https://worldedit.enginehub.org/en/latest/faq/#bukkit-adapters
""".stripIndent();

// ------------------------------------------------------------------------
// Code that may break between versions of Minecraft
// ------------------------------------------------------------------------
Expand All @@ -236,7 +228,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {

int dataVersion = SharedConstants.getCurrentVersion().dataVersion().version();
if (dataVersion != Constants.DATA_VERSION_MC_1_21_9 && dataVersion != Constants.DATA_VERSION_MC_1_21_10) {
logger.warning(WRONG_VERSION);
throw new RuntimeException("Force prevent this loading on >=1.21.11 or <=1.21.8");
}

serverWorldsField = CraftServer.class.getDeclaredField("worlds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter {
While it may work, there might be unexpected issues.
It is recommended to use a version of WorldEdit that supports your Minecraft version.
For more information, see https://worldedit.enginehub.org/en/latest/faq/#bukkit-adapters
""".stripIndent();
""";

// ------------------------------------------------------------------------
// Code that may break between versions of Minecraft
Expand All @@ -237,6 +237,9 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {

int dataVersion = SharedConstants.getCurrentVersion().dataVersion().version();
if (dataVersion < Constants.DATA_VERSION_MC_26_1 || dataVersion > Constants.DATA_VERSION_MC_26_1_2) {
if (dataVersion <= Constants.DATA_VERSION_MC_1_21_11) {
throw new RuntimeException("Force prevent this loading on <=1.21.11");
}
logger.warning(WRONG_VERSION);
}

Expand Down
Loading