mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 18:50:51 +01:00
31 lines
1.4 KiB
Diff
31 lines
1.4 KiB
Diff
--- a/net/minecraft/world/level/BaseCommandBlock.java
|
|
+++ b/net/minecraft/world/level/BaseCommandBlock.java
|
|
@@ -33,6 +33,10 @@
|
|
private String command = "";
|
|
@Nullable
|
|
private Component customName;
|
|
+ // CraftBukkit start
|
|
+ @Override
|
|
+ public abstract org.bukkit.command.CommandSender getBukkitSender(CommandSourceStack wrapper);
|
|
+ // CraftBukkit end
|
|
|
|
public BaseCommandBlock() {}
|
|
|
|
@@ -132,7 +136,7 @@
|
|
|
|
});
|
|
|
|
- minecraftserver.getCommands().performPrefixedCommand(commandlistenerwrapper, this.command);
|
|
+ minecraftserver.getCommands().dispatchServerCommand(commandlistenerwrapper, this.command); // CraftBukkit
|
|
} 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) {
|