Files
Purpur/purpur-server/minecraft-patches/sources/net/minecraft/commands/CommandSourceStack.java.patch
granny c39c270a37 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@73d218c1 Improve command permission lookups
PaperMC/Paper@7c2ffd5e Prune the api version suffix
PaperMC/Paper@c609d6dc Remove SERVER_ONLY command flag functionality
PaperMC/Paper@3594d24a Properly send over SADDLE and BODY equipment items to PlayerInventory
PaperMC/Paper@720e63ff Remove craft flying
PaperMC/Paper@1e441025 Removed inlined art api
PaperMC/Paper@adb5aefc Add api for shear equippable logic
PaperMC/Paper@4604c5f2 Change ordering on YamlSanitizationTest
PaperMC/Paper@c986ce54 Fix V4307 ordering issues
PaperMC/Paper@48e94e8c fix sponge absorb resetting block entity data of waterlogged blocks
PaperMC/Paper@c5fc0dc8 support block state mutation of already placed block entity in BlockStateListPopulator
2025-06-08 12:06:00 -07:00

54 lines
2.0 KiB
Diff

--- a/net/minecraft/commands/CommandSourceStack.java
+++ b/net/minecraft/commands/CommandSourceStack.java
@@ -447,6 +_,19 @@
}
// CraftBukkit end
+ // Purpur start - Gamemode extra permissions
+ public boolean testPermission(int i, String bukkitPermission) {
+ if (hasPermission(i, bukkitPermission)) {
+ return true;
+ }
+ net.kyori.adventure.text.Component permissionMessage = getLevel().getServer().server.permissionMessage();
+ if (!permissionMessage.equals(net.kyori.adventure.text.Component.empty())) {
+ sendFailure(io.papermc.paper.adventure.PaperAdventure.asVanilla(permissionMessage.replaceText(net.kyori.adventure.text.TextReplacementConfig.builder().matchLiteral("<permission>").replacement(bukkitPermission).build())));
+ }
+ return false;
+ }
+ // Purpur end - Gamemode extra permissions
+
public Vec3 getPosition() {
return this.worldPosition;
}
@@ -531,6 +_,30 @@
}
}
}
+
+ // Purpur start - Purpur config files
+ public void sendSuccess(@Nullable String message) {
+ sendSuccess(message, false);
+ }
+
+ public void sendSuccess(@Nullable String message, boolean broadcastToOps) {
+ if (message == null) {
+ return;
+ }
+ sendSuccess(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message), broadcastToOps);
+ }
+
+ public void sendSuccess(@Nullable net.kyori.adventure.text.Component message) {
+ sendSuccess(message, false);
+ }
+
+ public void sendSuccess(@Nullable net.kyori.adventure.text.Component message, boolean broadcastToOps) {
+ if (message == null) {
+ return;
+ }
+ sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(message), broadcastToOps);
+ }
+ // Purpur end - Purpur config files
public void sendSuccess(Supplier<Component> messageSupplier, boolean allowLogging) {
boolean flag = this.source.acceptsSuccess() && !this.silent;