mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
e7f3ca4505
Allows us much greater control over the Spigot portion of the code and makes us more "proper" Credit to @Dmck2b for originally passing the idea along a while back
31 lines
No EOL
1.3 KiB
Diff
31 lines
No EOL
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: FrozenBrain <carstenbamsti@googlemail.com>
|
|
Date: Sun, 2 Mar 2014 21:13:46 +0100
|
|
Subject: [PATCH] Use one PermissibleBase for all Command Blocks
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java
|
|
@@ -0,0 +0,0 @@ import org.bukkit.plugin.Plugin;
|
|
import java.util.Set;
|
|
|
|
public abstract class ServerCommandSender implements CommandSender {
|
|
- private final PermissibleBase perm = new PermissibleBase(this);
|
|
+ private static PermissibleBase blockPermInst;
|
|
+ private final PermissibleBase perm;
|
|
|
|
public ServerCommandSender() {
|
|
+ if (this instanceof CraftBlockCommandSender) {
|
|
+ if (blockPermInst == null) {
|
|
+ blockPermInst = new PermissibleBase(this);
|
|
+ }
|
|
+ this.perm = blockPermInst;
|
|
+ } else {
|
|
+ this.perm = new PermissibleBase(this);
|
|
+ }
|
|
}
|
|
|
|
public boolean isPermissionSet(String name) {
|
|
--
|