Skip to content

Commit 9164c46

Browse files
authored
[Bukkit] Warn on version mismatch (#2805)
* [Bukkit] Warn on version mismatch * Fix checkstyle & add link
1 parent 4808c08 commit 9164c46

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • worldedit-bukkit/adapters/adapter-1.21.6/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/v1_21_6

worldedit-bukkit/adapters/adapter-1.21.6/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/v1_21_6/PaperweightAdapter.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ public final class PaperweightAdapter implements BukkitImplAdapter {
212212

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

215+
private static final String WRONG_VERSION =
216+
"""
217+
This version of WorldEdit has not been tested with the current Minecraft version.
218+
While it may work, there might be unexpected issues.
219+
It is recommended to use a version of WorldEdit that supports your Minecraft version.
220+
For more information, see https://worldedit.enginehub.org/en/latest/faq/#bukkit-adapters
221+
""".stripIndent();
222+
215223
// ------------------------------------------------------------------------
216224
// Code that may break between versions of Minecraft
217225
// ------------------------------------------------------------------------
@@ -222,7 +230,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {
222230

223231
int dataVersion = SharedConstants.getCurrentVersion().dataVersion().version();
224232
if (dataVersion != Constants.DATA_VERSION_MC_1_21_6 && dataVersion != Constants.DATA_VERSION_MC_1_21_7) {
225-
throw new UnsupportedClassVersionError("Not 1.21.6 or 1.21.7!");
233+
logger.warning(WRONG_VERSION);
226234
}
227235

228236
serverWorldsField = CraftServer.class.getDeclaredField("worlds");

0 commit comments

Comments
 (0)