diff options
Diffstat (limited to 'CraftBukkit-Patches/0103-Use-one-PermissibleBase-for-all-Command-Blocks.patch')
-rw-r--r-- | CraftBukkit-Patches/0103-Use-one-PermissibleBase-for-all-Command-Blocks.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/CraftBukkit-Patches/0103-Use-one-PermissibleBase-for-all-Command-Blocks.patch b/CraftBukkit-Patches/0103-Use-one-PermissibleBase-for-all-Command-Blocks.patch new file mode 100644 index 0000000000..de808a9131 --- /dev/null +++ b/CraftBukkit-Patches/0103-Use-one-PermissibleBase-for-all-Command-Blocks.patch @@ -0,0 +1,33 @@ +From 26c6bf2cd39dc4ac183e63fa860440c7310f5bc9 Mon Sep 17 00:00:00 2001 +From: FrozenBrain <[email protected]> +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 1314c74..b339cf3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +@@ -12,9 +12,18 @@ 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) { +-- +1.9.1 + |