Paper/Spigot-Server-Patches/0029-Only-refresh-abilities-if-needed.patch
Zach Brown 233814297b Remove the spigot TileEntity/Entity capping feature
It appears to cause visual glitching issues with certain TNT entities
fired from cannons. TileEntity tick capping has already been removed
for some time, Entity tick capping removal is new to this patch.
2015-05-30 01:39:20 -05:00

29 Zeilen
1.1 KiB
Diff

From 91e1a03598b3c340ad7d81d50767be446924b959 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 130dcce..3c5d90d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1147,12 +1147,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
--
2.4.1.windows.1