Skip to content

Commit

Permalink
Fix 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KaspianDev committed Jun 16, 2023
1 parent 92918a6 commit 776c250
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tasks {

allprojects {
group = "com.github.kaspiandev.antipopup"
version = "6"
version = "6.1"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,22 @@ public void onEnable() {
&& serverManager.getVersion().isOlderThan(ServerVersion.V_1_19_1)) {
yamlDoc.set("block-chat-reports", false);
ConsoleMessages.log(ConsoleMessages.BLOCKING_REPORTS_UNSUPPORTED, getLogger()::severe);
Bukkit.getServer().getPluginManager().disablePlugin(this);
pluginManager.disablePlugin(this);
return;
}

if (yamlDoc.getBoolean("block-chat-reports")) {
PlayerListener playerListener = null;
switch (serverManager.getVersion()) {
case V_1_20 -> playerListener = new PlayerListener(new PlayerInjector_v1_20());
case V_1_20, V_1_20_1 -> playerListener = new PlayerListener(new PlayerInjector_v1_20());
case V_1_19_4 -> playerListener = new PlayerListener(new PlayerInjector_v1_19_4());
case V_1_19_3 -> playerListener = new PlayerListener(new PlayerInjector_v1_19_3());
case V_1_19_1, V_1_19_2 -> playerListener = new PlayerListener(new PlayerInjector_v1_19_2());
}
if (playerListener == null) {
getLogger().severe("No supported server version found! Exiting.");
pluginManager.disablePlugin(this);
return;
} else {
pluginManager.registerEvents(playerListener, this);
getLogger().info("Hooked on " + serverManager.getVersion().getReleaseName());
Expand Down

0 comments on commit 776c250

Please sign in to comment.