Add methods to change entity physics (#10334)

This commit is contained in:
maxcom1
2024-03-23 22:26:17 +01:00
parent 0c76cbb7cc
commit 6a200a1663
11 changed files with 66 additions and 106 deletions

View File

@@ -10,9 +10,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
+++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
@@ -0,0 +0,0 @@ public interface AbstractArrow extends Projectile {
@NotNull
org.bukkit.inventory.ItemStack getItemStack();
ALLOWED,
CREATIVE_ONLY;
}
+
+ /**
+ * Gets the ItemStack for this arrow.
+ *
+ * @return The ItemStack, as if a player picked up the arrow
+ */
+ @NotNull
+ org.bukkit.inventory.ItemStack getItemStack();
+
+ /**
+ * Sets the amount of ticks this arrow has been alive in the world
+ * This is used to determine when the arrow should be automatically despawned.
@@ -42,10 +51,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param sound sound that is played
+ */
+ void setHitSound(@NotNull org.bukkit.Sound sound);
+
/**
* Sets this arrow to "noclip" status.
*
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Firework.java