Skip to content

Commit 431dc48

Browse files
Disabling CommandAPI after 1.21.8
1 parent 6c80880 commit 431dc48

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/main/java/me/general_breddok/blockdisplaycreator/BlockDisplayCreator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ public void onLoad() {
124124

125125
this.versionManager = new VersionManager(this.getServer());
126126

127-
if (!this.versionManager.isVersion1_19_4()) {
127+
if (this.versionManager.isVersion1_19_4() || this.versionManager.isVersionLater1_21_8()) {
128+
ChatUtil.log("&6[BlockDisplayCreator] &eCommandAPI is not supported on Minecraft 1.19.4 and 1.21.8+, using legacy commands.");
129+
} else {
128130
this.capi = true;
129131
CommandAPI.onLoad(new CommandAPISpigotConfig(this).setNamespace("bdc"));
130-
} else {
131-
ChatUtil.log("&6[BlockDisplayCreator] &eCommandAPI is not supported on Minecraft 1.19.4 and below, using legacy commands.");
132132
}
133133

134134
this.dependentPluginsManager.loadPacketEvents();

src/main/java/me/general_breddok/blockdisplaycreator/version/VersionManager.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ private String extractVersion(String bukkitVersion) {
6363
return bukkitVersion.split("-")[0];
6464
}
6565

66+
67+
/**
68+
* Checks if the server is running a version later than 1.21.8.
69+
*
70+
* @return {@code true} if the current version is 1.21.9 or later
71+
*/
72+
public boolean isVersionLater1_21_8() {
73+
return this.currentVersion.isAtLeast(MinecraftVersion.V1_21_9);
74+
}
75+
6676
/**
6777
* Checks if the server is running a version earlier than 1.20.5.
6878
*

0 commit comments

Comments
 (0)