mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 23ee0a8a Fix issue with 0,0 chunks causing crash bc8fafb2 Updated Upstream (CraftBukkit/Spigot) ebbca5ce Drowned is a RangedEntity (fixes API for Drowned to support Ranged) 83b03eee Don't move existing players to world spawn 3b3e38fd Fix issue with loading chunk during ticking chunks issue 78431dca Update test server startup script
56 lines
2.2 KiB
Diff
56 lines
2.2 KiB
Diff
From 2c4b9f9f107c1da3f2f9d86f13a3ad2bdfab4291 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 0d985b83d8..eba32e614e 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
@@ -760,6 +760,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);
|
|
}
|
|
|
|
@@ -893,6 +902,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
|
|
|