mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
72 lines
3.4 KiB
Diff
72 lines
3.4 KiB
Diff
From 65faf2f8eb765570b0a4dc61580943aa2c1737d3 Mon Sep 17 00:00:00 2001
|
|
From: Tom <cryptite@gmail.com>
|
|
Date: Fri, 12 Jul 2019 07:59:35 -0500
|
|
Subject: [PATCH] Don't recalculate permissions for players on world change
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/PlayerList.java | 9 +++++----
|
|
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
|
2 files changed, 10 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
|
index 7b79ee4fe5..3975312394 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
@@ -32,13 +32,10 @@ import org.bukkit.Location;
|
|
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
|
-import org.bukkit.event.player.PlayerPortalEvent;
|
|
import org.bukkit.event.player.PlayerJoinEvent;
|
|
import org.bukkit.event.player.PlayerLoginEvent;
|
|
import org.bukkit.event.player.PlayerQuitEvent;
|
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
|
-import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
|
-import org.bukkit.util.Vector;
|
|
import org.spigotmc.event.player.PlayerSpawnLocationEvent;
|
|
// CraftBukkit end
|
|
|
|
@@ -712,7 +709,9 @@ public abstract class PlayerList {
|
|
entityplayer1.playerConnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
|
entityplayer1.playerConnection.sendPacket(new PacketPlayOutExperience(entityplayer1.exp, entityplayer1.expTotal, entityplayer1.expLevel));
|
|
this.a(entityplayer1, worldserver);
|
|
+ movedToWorld = true; // Purpur
|
|
this.d(entityplayer1);
|
|
+ movedToWorld = false; // Purpur
|
|
if (!entityplayer.playerConnection.isDisconnected()) {
|
|
worldserver.addPlayerRespawn(entityplayer1);
|
|
this.players.add(entityplayer1);
|
|
@@ -907,10 +906,12 @@ public abstract class PlayerList {
|
|
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
|
|
}
|
|
|
|
- entityplayer.getBukkitEntity().recalculatePermissions(); // CraftBukkit
|
|
+ if (!(movedToWorld && !net.pl3x.purpur.PurpurConfig.recalculatePermsOnWorldChange)) entityplayer.getBukkitEntity().recalculatePermissions(); // CraftBukkit // Purpur
|
|
this.server.getCommandDispatcher().a(entityplayer);
|
|
}
|
|
|
|
+ private boolean movedToWorld = false; // Purpur
|
|
+
|
|
// Paper start
|
|
public boolean isWhitelisted(GameProfile gameprofile) {
|
|
return isWhitelisted(gameprofile, null);
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index 9f6b4dc9a5..a8276ab477 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -181,6 +181,11 @@ public class PurpurConfig {
|
|
slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
|
}
|
|
|
|
+ public static boolean recalculatePermsOnWorldChange = true;
|
|
+ private static void updatePermissionsOnWorldChange() {
|
|
+ recalculatePermsOnWorldChange = getBoolean("settings.recalculate-perms-on-world-change", recalculatePermsOnWorldChange);
|
|
+ }
|
|
+
|
|
private static void timingsSettings() {
|
|
getString("settings.timings.url", "https://timings.pl3x.net");
|
|
}
|
|
--
|
|
2.24.0
|
|
|