Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
fix: Registering a bukkit command also auto-registers its perm
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Mar 29, 2024
1 parent 9ed2b44 commit 134eb37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 10 additions & 0 deletions bukkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id 'xyz.jpenilla.run-paper' version '2.2.3'
}

dependencies {
implementation project(path: ':common')

Expand Down Expand Up @@ -36,4 +40,10 @@ shadowJar {
}

minimize()
}

tasks {
runServer {
minecraftVersion('1.20.4')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
Expand All @@ -46,11 +45,6 @@ public BukkitCommand(@NotNull CommandBase command, @NotNull BukkitHuskChat plugi

// Register command & permission with Bukkit
plugin.getCommandMap().register("huskchat", this);
if (getPermission() != null) {
plugin.getServer().getPluginManager().addPermission(new Permission(
getPermission(), getUsage(), Permission.DEFAULT_PERMISSION)
);
}
}

@Override
Expand Down

0 comments on commit 134eb37

Please sign in to comment.