2024-12-11 22:26:55 +01:00
|
|
|
--- a/net/minecraft/world/level/BaseCommandBlock.java
|
|
|
|
+++ b/net/minecraft/world/level/BaseCommandBlock.java
|
2024-04-29 22:15:00 +02:00
|
|
|
@@ -33,6 +33,10 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
private String command = "";
|
2024-04-23 17:15:00 +02:00
|
|
|
@Nullable
|
2024-12-11 22:26:55 +01:00
|
|
|
private Component customName;
|
2018-07-15 02:00:00 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ @Override
|
2024-12-11 22:26:55 +01:00
|
|
|
+ public abstract org.bukkit.command.CommandSender getBukkitSender(CommandSourceStack wrapper);
|
2018-07-15 02:00:00 +02:00
|
|
|
+ // CraftBukkit end
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2024-12-11 22:26:55 +01:00
|
|
|
public BaseCommandBlock() {}
|
2024-04-23 17:15:00 +02:00
|
|
|
|
2024-04-29 22:15:00 +02:00
|
|
|
@@ -132,7 +136,7 @@
|
2020-01-06 03:44:16 +01:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
- minecraftserver.getCommands().performPrefixedCommand(commandlistenerwrapper, this.command);
|
2021-11-21 23:00:00 +01:00
|
|
|
+ minecraftserver.getCommands().dispatchServerCommand(commandlistenerwrapper, this.command); // CraftBukkit
|
2017-05-14 04:00:00 +02:00
|
|
|
} catch (Throwable throwable) {
|
2021-11-21 23:00:00 +01:00
|
|
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Executing command block");
|
2024-12-11 22:26:55 +01:00
|
|
|
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Command to be executed");
|
2022-06-16 23:22:56 +02:00
|
|
|
@@ -174,6 +178,7 @@
|
|
|
|
@Override
|
|
|
|
public void sendSystemMessage(Component message) {
|
|
|
|
if (this.trackOutput) {
|
|
|
|
+ org.spigotmc.AsyncCatcher.catchOp("sendSystemMessage to a command block"); // Paper - Don't broadcast messages to command blocks
|
|
|
|
SimpleDateFormat simpledateformat = BaseCommandBlock.TIME_FORMAT;
|
|
|
|
Date date = new Date();
|
|
|
|
|
|
|
|
@@ -200,7 +205,7 @@
|
2020-05-16 10:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|