mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
Use one PermissibleBase for all Command Blocks.
This fixes issues with too many command blocks lagging or crashing the server, as well as just increases their performance in general.
This commit is contained in:
parent
3b52578a51
commit
4bd27f7d0f
1 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,33 @@
|
|||
From aefc5f0df1c5ec8a8172bef74967b1f34336d200 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 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.7.9.5
|
||||
|
Loading…
Reference in a new issue