2021-06-14 08:37:14 +00: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
|
2022-03-06 21:19:08 +00:00
|
|
|
Subject: [PATCH] Improve Arrow API
|
2021-06-14 08:37:14 +00:00
|
|
|
|
2022-03-06 21:19:08 +00:00
|
|
|
Add method to get the arrow's itemstack and a method
|
|
|
|
to set the arrow's "noclip" status
|
|
|
|
|
|
|
|
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
2021-06-14 08:37:14 +00:00
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
2022-03-06 21:19:08 +00:00
|
|
|
index 376885c8148da619a3b203145d315ebaf44994fb..15abd085eeb0a31a925c1a8d6de903c9d4625a29 100644
|
2021-06-14 08:37:14 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
2022-03-06 21:19:08 +00:00
|
|
|
@@ -102,6 +102,23 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
|
2021-06-14 08:37:14 +00:00
|
|
|
this.getHandle().pickup = net.minecraft.world.entity.projectile.AbstractArrow.Pickup.byOrdinal(status.ordinal());
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public org.bukkit.craftbukkit.inventory.CraftItemStack getItemStack() {
|
|
|
|
+ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem());
|
|
|
|
+ }
|
2022-03-06 21:19:08 +00:00
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setNoPhysics(boolean noPhysics) {
|
|
|
|
+ this.getHandle().setNoPhysics(noPhysics);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean hasNoPhysics() {
|
|
|
|
+ return this.getHandle().isNoPhysics();
|
|
|
|
+ }
|
2021-09-11 10:22:51 +00:00
|
|
|
+ // Paper end
|
2021-06-14 08:37:14 +00:00
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public void setTicksLived(int value) {
|
|
|
|
super.setTicksLived(value);
|