Paper/Spigot-Server-Patches/0058-Add-methods-for-working-with-arrows-stuck-in-living-.patch
Zach Brown 70ce6ce831
Move version command update checking to the implementation
This makes it easier for downstream projects (forks) to replace the
version fetching system with their own. It is as simple as implementing
an interface and overriding the default implementation of
org.bukkit.UnsafeValues#getVersionFetcher()

It also makes it easier for us to organize things like the version
history feature.

Lastly I have updated the paper implementation to check against the site
API rather than against jenkins.
2019-05-27 04:13:41 -05:00

31 Zeilen
1.1 KiB
Diff

From d34919be9cd4477522345cde214da56d535c6f92 Mon Sep 17 00:00:00 2001
From: mrapple <tony@oc.tc>
Date: Sun, 25 Nov 2012 13:43:39 -0600
Subject: [PATCH] Add methods for working with arrows stuck in living entities
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 82b3c0a7d..aa50435be 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -598,4 +598,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public <T> void setMemory(MemoryKey<T> memoryKey, T t) {
getHandle().getBehaviorController().setMemory(CraftMemoryKey.fromMemoryKey(memoryKey), CraftMemoryMapper.toNms(t));
}
+
+ // Paper start
+ @Override
+ public int getArrowsStuck() {
+ return getHandle().getArrowCount();
+ }
+
+ @Override
+ public void setArrowsStuck(int arrows) {
+ getHandle().setArrowCount(arrows);
+ }
+ // Paper end
}
--
2.21.0