2020-05-22 19:56:24 +02:00
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
2021-03-16 08:19:45 +01:00
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
2021-05-16 01:42:36 +02:00
index c325c9fe680d9033b20909bcd6100ecc4b0195f6..ce754e0da047050daa08e5e0564fa399d334c04b 100644
2021-03-16 08:19:45 +01:00
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
@@ -558,6 +558,7 @@ public abstract class EntityArrow extends IProjectile {
2020-05-22 19:56:24 +02:00
}
}
2020-08-02 07:39:36 +02:00
+ public final ItemStack getOriginalItemStack() { return getItemStack(); } // Paper - OBFHELPER - exists purely due to overrides all as protected and dont want to change them all
2020-05-22 19:56:24 +02:00
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
2021-03-16 08:19:45 +01:00
index ea33a36dfa6f304946f5b998eb536678a9b2f98c..2ab41a24a22e736753276b95fa0d060017cca0bc 100644
2020-05-22 19:56:24 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
2021-03-09 00:12:31 +01:00
@@ -103,6 +103,13 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
2020-05-22 19:56:24 +02:00
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);