aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2022-03-06 13:19:08 -0800
committerGitHub <[email protected]>2022-03-06 22:19:08 +0100
commitd9bf5e740bb7c9d726d01ab4a3cfb558ff1d8a85 (patch)
treeac1ad83bab696e2d373e3d2ed5a379953cc84adb
parent7b9c30fb82d79599878543d7877f686678db0792 (diff)
downloadPaper-d9bf5e740bb7c9d726d01ab4a3cfb558ff1d8a85.tar.gz
Paper-d9bf5e740bb7c9d726d01ab4a3cfb558ff1d8a85.zip
Add method to set noclip on arrows (#7263)
-rw-r--r--patches/api/0207-Improve-Arrow-API.patch (renamed from patches/api/0207-Expose-Arrow-getItemStack.patch)24
-rw-r--r--patches/server/0446-Improve-Arrow-API.patch (renamed from patches/server/0446-Expose-Arrow-getItemStack.patch)20
2 files changed, 38 insertions, 6 deletions
diff --git a/patches/api/0207-Expose-Arrow-getItemStack.patch b/patches/api/0207-Improve-Arrow-API.patch
index e718e0e598..1c70418e98 100644
--- a/patches/api/0207-Expose-Arrow-getItemStack.patch
+++ b/patches/api/0207-Improve-Arrow-API.patch
@@ -1,14 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nesaak <[email protected]>
Date: Fri, 22 May 2020 13:35:21 -0400
-Subject: [PATCH] Expose Arrow getItemStack
+Subject: [PATCH] Improve Arrow API
+Add method to get the arrow's itemstack and a method
+to set the arrow's "noclip" status
+
+Co-authored-by: Jake Potrebic <[email protected]>
diff --git a/src/main/java/org/bukkit/entity/AbstractArrow.java b/src/main/java/org/bukkit/entity/AbstractArrow.java
-index e8e56e89e32d84af0639fe2e9b0eeabd747b6007..b1d8007eed489aa061c1a6813bcdafc101231e56 100644
+index e8e56e89e32d84af0639fe2e9b0eeabd747b6007..225a24898acd25038ea2a8448f9f3b57643d3026 100644
--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
+++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
-@@ -143,6 +143,14 @@ public interface AbstractArrow extends Projectile {
+@@ -143,6 +143,28 @@ public interface AbstractArrow extends Projectile {
}
// Paper start
@@ -20,6 +24,20 @@ index e8e56e89e32d84af0639fe2e9b0eeabd747b6007..b1d8007eed489aa061c1a6813bcdafc1
+ @NotNull
+ org.bukkit.inventory.ItemStack getItemStack();
+
++ /**
++ * Sets this arrow to "noclip" status.
++ *
++ * @param noPhysics true to set "noclip"
++ */
++ void setNoPhysics(boolean noPhysics);
++
++ /**
++ * Gets if this arrow has "noclip".
++ *
++ * @return true if noclip is active
++ */
++ boolean hasNoPhysics();
++
/**
* Gets the {@link PickupRule} for this arrow.
*
diff --git a/patches/server/0446-Expose-Arrow-getItemStack.patch b/patches/server/0446-Improve-Arrow-API.patch
index 38c157797a..47bb897a5a 100644
--- a/patches/server/0446-Expose-Arrow-getItemStack.patch
+++ b/patches/server/0446-Improve-Arrow-API.patch
@@ -1,14 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nesaak <[email protected]>
Date: Sat, 23 May 2020 10:31:11 -0400
-Subject: [PATCH] Expose Arrow getItemStack
+Subject: [PATCH] Improve Arrow API
+Add method to get the arrow's itemstack and a method
+to set the arrow's "noclip" status
+
+Co-authored-by: Jake Potrebic <[email protected]>
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
-index 376885c8148da619a3b203145d315ebaf44994fb..454c8fab2f0b60aa3afd73805ea3586881605450 100644
+index 376885c8148da619a3b203145d315ebaf44994fb..15abd085eeb0a31a925c1a8d6de903c9d4625a29 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 {
+@@ -102,6 +102,23 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
this.getHandle().pickup = net.minecraft.world.entity.projectile.AbstractArrow.Pickup.byOrdinal(status.ordinal());
}
@@ -17,6 +21,16 @@ index 376885c8148da619a3b203145d315ebaf44994fb..454c8fab2f0b60aa3afd73805ea35868
+ public org.bukkit.craftbukkit.inventory.CraftItemStack getItemStack() {
+ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem());
+ }
++
++ @Override
++ public void setNoPhysics(boolean noPhysics) {
++ this.getHandle().setNoPhysics(noPhysics);
++ }
++
++ @Override
++ public boolean hasNoPhysics() {
++ return this.getHandle().isNoPhysics();
++ }
+ // Paper end
+
@Override