mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: d33ba160 Fix incorrect keyword use on visibleChunksClone 2f343015 Updated Upstream (Bukkit/CraftBukkit) a65831bd Optimize PlayerChunkMap memory use for visibleChunks
This commit is contained in:
55
patches/server/0114-Async-recalc-perms-and-command-map.patch
Normal file
55
patches/server/0114-Async-recalc-perms-and-command-map.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From ca4b3786bb468c1d5f6284cd20c8eacf0c52ea30 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 8 Apr 2020 23:01:20 -0500
|
||||
Subject: [PATCH] Async recalc perms and command map
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/PlayerList.java | 10 ++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index d1c92667d8..a6b9aa898e 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -759,6 +759,15 @@ public abstract class PlayerList {
|
||||
GameProfile gameprofile = entityplayer.getProfile();
|
||||
int i = this.server.b(gameprofile);
|
||||
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.updatePermsAndCommandsAsync) {
|
||||
+ java.util.concurrent.ForkJoinPool.commonPool().invoke(new java.util.concurrent.RecursiveAction() {
|
||||
+ protected void compute() {
|
||||
+ recalculatePermsAndCommands(entityplayer, i);
|
||||
+ }
|
||||
+ });
|
||||
+ } else
|
||||
+ // Purpur end
|
||||
this.a(entityplayer, i);
|
||||
}
|
||||
|
||||
@@ -892,6 +901,7 @@ public abstract class PlayerList {
|
||||
|
||||
}
|
||||
|
||||
+ private void recalculatePermsAndCommands(EntityPlayer entityplayer, int i) { a(entityplayer, i); } // Purpur - OBFHELPER
|
||||
private void a(EntityPlayer entityplayer, int i) {
|
||||
if (entityplayer.playerConnection != null) {
|
||||
byte b0;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index b42b3dfa72..0c4c4ee9d2 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -207,4 +207,9 @@ public class PurpurConfig {
|
||||
enchantment.setMaxLevel(maxLevel);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ public static boolean updatePermsAndCommandsAsync = false;
|
||||
+ private static void updatePermsAndCommandsAsync() {
|
||||
+ updatePermsAndCommandsAsync = getBoolean("settings.update-permissions-and-commands-async", updatePermsAndCommandsAsync);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.24.0
|
||||
|
||||
Reference in New Issue
Block a user