Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/Spigot-Server-Patches/0042-Only-refresh-abilities-if-needed.patch
Zach Brown 20973ffd0f Make certain game mechanics configurable
Boat drops and rail placement at this time
2014-11-28 14:19:09 -06:00

29 Zeilen
1.1 KiB
Diff

From 08fbd413515b6fdb8bb299485d9bd60bbe62c24b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 19 Oct 2014 16:04:28 -0500
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 096615e..73ec0f7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1176,12 +1176,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
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
}
public boolean getAllowFlight() {
--
1.9.1