mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
Add methods to change entity physics (#10334)
This commit is contained in:
parent
9ec7dfcbc4
commit
b6001403e9
@ -1,43 +0,0 @@
|
||||
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] 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 e8e56e89e32d84af0639fe2e9b0eeabd747b6007..225a24898acd25038ea2a8448f9f3b57643d3026 100644
|
||||
--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
|
||||
+++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
|
||||
@@ -143,6 +143,28 @@ public interface AbstractArrow extends Projectile {
|
||||
}
|
||||
|
||||
// Paper start
|
||||
+ /**
|
||||
+ * Gets the ItemStack for this arrow.
|
||||
+ *
|
||||
+ * @return The ItemStack, as if a player picked up the arrow
|
||||
+ */
|
||||
+ @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.
|
||||
*
|
@ -5,7 +5,7 @@ Subject: [PATCH] Support components in ItemMeta
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
index 420a91a834016d3af95efd79ca92ae45c4f081c4..ea64d5b1ebaa652785ddbc7b515808174f636a62 100644
|
||||
index f23c0c942f200a68d2620f225ab90399a9057dfc..478b6d2acbc5788f72db81f387daa08df7837a5d 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
@@ -5,6 +5,7 @@ import java.util.Collection;
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 3f062e0fe9cb632dece9ce3fdc985ab1bf5a425f..590d69f57722a40addf73131fa60e952f303230b 100644
|
||||
index 10d76fcd509702042c528fab96b963e9c6d210a5..3969f3c188211838cb576465bd64c0f63ae85080 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1045,5 +1045,28 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
@ -282,7 +282,7 @@ index d3087d60378822cdd7cea25fd63d3f496e3cd2fb..5d8fa5b39a5d50cca48ba63af3a84b80
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index a7c58adb6404e04a673bf91d491d7fef56dc890e..85a5e9a3b41798cb3cb6687ed379a5e3eedd698a 100644
|
||||
index bf29d9b733afc7c62725d259f4920c4f211cc6d0..1d3812db989a55b6f31bb30dffe70323eb592a15 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable;
|
@ -5,7 +5,7 @@ Subject: [PATCH] Item no age & no player pickup
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
|
||||
index ab06c640cef1309ab44b0fae8d95df48cdc869a7..48858e1c58c13d786bbc935abedb0f059837833c 100644
|
||||
index bfecd0633458586c0352eeb1a95bb57b12f9101e..6239aec4f6c625a814fa4fd610cdc5ab1a9f6e0f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Item.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Item.java
|
||||
@@ -104,5 +104,34 @@ public interface Item extends Entity {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add Destroy Speed API
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 85a5e9a3b41798cb3cb6687ed379a5e3eedd698a..c1705e518af08841e8154caf183bc808366feb2e 100644
|
||||
index 1d3812db989a55b6f31bb30dffe70323eb592a15..4aea4be0677d93e17a4ce98dd340dd9921f996a0 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -690,4 +690,31 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 590d69f57722a40addf73131fa60e952f303230b..191a3c3ee46649d2a539597258485752b34fac02 100644
|
||||
index 3969f3c188211838cb576465bd64c0f63ae85080..9d58da4686a22893455b9cc75fb8e73a87d2d06d 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -996,6 +996,13 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
@ -26,7 +26,7 @@ index 94f2c3167f4ce7f5f2b4ecc067739c64af0a2508..4054d2c836342f0e4bcbd33adb13f50d
|
||||
* Get the sleep ticks of the player. This value may be capped.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 191a3c3ee46649d2a539597258485752b34fac02..62d0d2fe3c6dfc9faaa821bde074b623914e4a44 100644
|
||||
index 9d58da4686a22893455b9cc75fb8e73a87d2d06d..e9919fce380ec1d0d48b3ac706e7fd31af0be26b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1075,5 +1075,21 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
@ -9,7 +9,7 @@ process to do this in the Bukkit API
|
||||
Adds API for buildable, replaceable, burnable too.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 137a40c708bb67de4608447975867a07240ddc88..3fd364e5875f95296e75dede4c610d3dd3e0038e 100644
|
||||
index 4aea4be0677d93e17a4ce98dd340dd9921f996a0..c68ed7de2d50da4105dd38c0986f237e8c56b2d6 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -439,6 +439,42 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerKickEvent causes
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 59821aba66edbef2644bdd21646f556e773a898b..793df7533096efb0f60bddcb3e4e1575cbcc1069 100644
|
||||
index d735ed635022d170c6b1080ed87f3c2a799202f6..4906bec154d0f60420fbe2cffa8c7df0918ca61b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -277,6 +277,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
@ -11,6 +11,7 @@ Co-authored-by: booky10 <boooky10@gmail.com>
|
||||
Co-authored-by: Amin <amin.haddou@frg.wwschool.de>
|
||||
Co-authored-by: TrollyLoki <trollyloki@gmail.com>
|
||||
Co-authored-by: FireInstall <kettnerl@hu-berlin.de>
|
||||
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/entity/SchoolableFish.java b/src/main/java/io/papermc/paper/entity/SchoolableFish.java
|
||||
new file mode 100644
|
||||
@ -416,14 +417,14 @@ index 9e7f42caab1204036f4203354c115fd40c6def92..138d2530de2410f4a9424dabd3e5ce0c
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index d68ccecaadcf7a906058e66a750f4cfce5dd7b3f..efe812b4d47df6f8b5ba54ec4526f3dcd20f180f 100644
|
||||
index d68ccecaadcf7a906058e66a750f4cfce5dd7b3f..578c22b0aef9c89a3c33b75c33bcdc60bdab6b49 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -283,6 +283,26 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -283,6 +283,40 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
boolean isFrozen();
|
||||
|
||||
+ // Paper start - move invisibility up to Entity
|
||||
+ // Paper start - missing entity api
|
||||
+ /**
|
||||
+ * Sets whether the entity is invisible or not.
|
||||
+ * <p>
|
||||
@ -433,15 +434,29 @@ index d68ccecaadcf7a906058e66a750f4cfce5dd7b3f..efe812b4d47df6f8b5ba54ec4526f3dc
|
||||
+ *
|
||||
+ * @param invisible If the entity is invisible
|
||||
+ */
|
||||
+ void setInvisible(boolean invisible);
|
||||
+ void setInvisible(boolean invisible); // Paper - moved up from LivingEntity
|
||||
+
|
||||
+ /**
|
||||
+ * Gets whether the entity is invisible or not.
|
||||
+ *
|
||||
+ * @return Whether the entity is invisible
|
||||
+ */
|
||||
+ boolean isInvisible();
|
||||
+ // Paper end - move invisibility up to Entity
|
||||
+ boolean isInvisible(); // Paper - moved up from LivingEntity
|
||||
+
|
||||
+ /**
|
||||
+ * Sets this entities no physics status.
|
||||
+ *
|
||||
+ * @param noPhysics boolean indicating if the entity should not have physics.
|
||||
+ */
|
||||
+ void setNoPhysics(boolean noPhysics);
|
||||
+
|
||||
+ /**
|
||||
+ * Gets if this entity has no physics.
|
||||
+ *
|
||||
+ * @return true if the entity does not have physics.
|
||||
+ */
|
||||
+ boolean hasNoPhysics();
|
||||
+ // Paper end - missing entity api
|
||||
+
|
||||
/**
|
||||
* Mark the entity's removal.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user