2015-02-23 22:03:10 +01:00
|
|
|
From b787bc58e8224d8db379608f104cd935f17889fc Mon Sep 17 00:00:00 2001
|
2014-10-20 00:58:49 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
2014-11-28 02:17:45 +01:00
|
|
|
Date: Fri, 28 Nov 2014 13:20:22 -0600
|
2014-10-20 00:58:49 +02:00
|
|
|
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
|
2015-01-29 22:26:20 +01:00
|
|
|
index 942a6ab..0c9f241 100644
|
2014-10-20 00:58:49 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2015-01-29 22:26:20 +01:00
|
|
|
@@ -1146,12 +1146,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2014-10-20 00:58:49 +02:00
|
|
|
|
2014-11-28 02:17:45 +01:00
|
|
|
@Override
|
2014-10-20 00:58:49 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2014-11-28 02:17:45 +01:00
|
|
|
@Override
|
2014-10-20 00:58:49 +02:00
|
|
|
--
|
2015-01-29 22:26:20 +01:00
|
|
|
1.9.5.msysgit.0
|
2014-10-20 00:58:49 +02:00
|
|
|
|