Add permission for command blocks

This commit is contained in:
Mariell Hoversholm
2020-05-16 10:05:30 +02:00
parent 1b13d5c85e
commit 2a6962e59e
5 changed files with 63 additions and 20 deletions

View File

@@ -20,3 +20,12 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Executing command block");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Command to be executed");
@@ -200,7 +204,7 @@
}
public InteractionResult usedBy(Player player) {
- if (!player.canUseGameMasterBlocks()) {
+ if (!player.canUseGameMasterBlocks() && (!player.isCreative() || !player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
return InteractionResult.PASS;
} else {
if (player.getCommandSenderWorld().isClientSide) {