Paper/Spigot-Server-Patches/0024-Only-refresh-abilities-if-needed.patch
Aikar f5265d6688
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
6ff65c82 SPIGOT-5908: CompassMeta for new lodestone compass data

CraftBukkit Changes:
3b9cf0f8 Improve code formatting
008f039f SPIGOT-5913: MOTD no longer supports new line character
b8b65eb7 SPIGOT-5908: CompassMeta for new lodestone compass data

Spigot Changes:
4d9262cf Rebuild patches
d27f7952 SPIGOT-5912: Outdated client message shows outdated server message
2020-07-01 02:11:46 -04:00

26 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 23:12:03 -0600
Subject: [PATCH] Only refresh abilities if needed
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 32f55645c14d5f25235a2e1efbbc8260bf1972f7..b2f9f4e9350cde9c79801b83e43c181c31f90131 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1355,12 +1355,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setFlying(boolean value) {
+ boolean needsUpdate = getHandle().abilities.isFlying != value; // Paper - Only refresh abilities if needed
if (!getAllowFlight() && value) {
throw new IllegalArgumentException("Cannot make player fly if getAllowFlight() is false");
}
getHandle().abilities.isFlying = value;
- getHandle().updateAbilities();
+ if (needsUpdate) getHandle().updateAbilities(); // Paper - Only refresh abilities if needed
}
@Override