aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0515-Expose-Arrow-getItemStack.patch
blob: 6e89c259a7769704a05edb857615a7cd8b0825f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nesaak <52047222+Nesaak@users.noreply.github.com>
Date: Sat, 23 May 2020 10:31:11 -0400
Subject: [PATCH] Expose Arrow getItemStack


diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index c552962a9a2c8dac6794ef6698943c7d91ea45c4..f8772a853ea9b5ca45c78a2fd8bd3f1fa6abf5d2 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -520,6 +520,7 @@ public abstract class EntityArrow extends IProjectile {
         }
     }
 
+    public final ItemStack getOriginalItemStack() { return getItemStack(); }  // Paper - OBFHELPER - exists purely due to overrides all as protected and dont want to change them all
     protected abstract ItemStack getItemStack();
 
     @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
index cf40d62492dc207815487d6f64e7d11892adc09b..5a0a78d7edead8712090dfb9c53ff904abf5b118 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
@@ -102,6 +102,13 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
         getHandle().fromPlayer = EntityArrow.PickupStatus.a(status.ordinal());
     }
 
+    // Paper start
+    @Override
+    public org.bukkit.craftbukkit.inventory.CraftItemStack getItemStack() {
+        return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getOriginalItemStack());
+    }
+    //Paper end
+
     @Override
     public void setTicksLived(int value) {
         super.setTicksLived(value);