Paper/patches/server/0024-Only-refresh-abilities-if-needed.patch
Mariell Hoversholm 415f7ca165 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear 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:
e0598aa2 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter

CraftBukkit Changes:
2cdc6b1e4 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter
2021-08-11 07:01:11 +02: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 6de88d1ea0ff50dddb65a65fa53fba6ee475e886..2685ebf77191a797bc1835a3da13a238ce9432a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1452,12 +1452,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setFlying(boolean value) {
+ boolean needsUpdate = getHandle().getAbilities().flying != value; // Paper - Only refresh abilities if needed
if (!this.getAllowFlight() && value) {
throw new IllegalArgumentException("Cannot make player fly if getAllowFlight() is false");
}
this.getHandle().getAbilities().flying = value;
- this.getHandle().onUpdateAbilities();
+ if (needsUpdate) this.getHandle().onUpdateAbilities(); // Paper - Only refresh abilities if needed
}
@Override