mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Gamemode extra permissions
This commit is contained in:
committed by
granny
parent
438f5e1ee8
commit
e13a2f1ff6
@@ -1,9 +1,30 @@
|
||||
--- a/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -517,6 +_,30 @@
|
||||
@@ -431,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;
|
||||
}
|
||||
@@ -516,6 +_,30 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+
|
||||
+ // Purpur start - Purpur config files
|
||||
+ public void sendSuccess(@Nullable String message) {
|
||||
+ sendSuccess(message, false);
|
||||
@@ -27,7 +48,6 @@
|
||||
+ 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;
|
||||
boolean flag1 = allowLogging && this.source.shouldInformAdmins() && !this.silent;
|
||||
|
||||
Reference in New Issue
Block a user