mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Add method to set noclip on arrows (#7263)
This commit is contained in:
parent
372f051008
commit
31255d3db4
2 changed files with 34 additions and 2 deletions
patches
|
@ -1,8 +1,12 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nesaak <52047222+Nesaak@users.noreply.github.com>
|
||||
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 <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/AbstractArrow.java b/src/main/java/org/bukkit/entity/AbstractArrow.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -19,6 +23,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ */
|
||||
+ @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.
|
|
@ -1,8 +1,12 @@
|
|||
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
|
||||
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 <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -17,6 +21,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ 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
|
Loading…
Add table
Reference in a new issue