mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
d28dd3edbd
Brought our multiple TNT change patches into a single patch and configuraiton section. You /will/ need to update your configs, sorry. Adds additional configuration and features as well.
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
From b787bc58e8224d8db379608f104cd935f17889fc Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Fri, 28 Nov 2014 13:20:22 -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 942a6ab..0c9f241 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -1146,12 +1146,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
@Override
|
|
public void setFlying(boolean value) {
|
|
+ boolean needsUpdate = getHandle().abilities.canFly != value; // PaperSpigot - 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(); // PaperSpigot - Only refresh abilities if needed
|
|
}
|
|
|
|
@Override
|
|
--
|
|
1.9.5.msysgit.0
|
|
|