geforkt von Mirrors/Paper
Add getHandRaised to LivingEntity (#5752)
Dieser Commit ist enthalten in:
Ursprung
0d254aed35
Commit
4e835fca94
@ -61,9 +61,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||||
* @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
|
|
||||||
*/
|
*/
|
||||||
boolean isHandRaised();
|
@NotNull
|
||||||
|
org.bukkit.inventory.EquipmentSlot getHandRaised();
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Get entity jump state.
|
+ * Get entity jump state.
|
||||||
|
@ -48,5 +48,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
|
+ * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
|
||||||
+ */
|
+ */
|
||||||
+ boolean isHandRaised();
|
+ boolean isHandRaised();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Gets the hand raised by this living entity. Will be either
|
||||||
|
+ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or
|
||||||
|
+ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}.
|
||||||
|
+ *
|
||||||
|
+ * @return the hand raised
|
||||||
|
+ */
|
||||||
|
+ @NotNull
|
||||||
|
+ org.bukkit.inventory.EquipmentSlot getHandRaised();
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
|
((EntityInsentient) getHandle()).getControllerJump().jump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
|
+ public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
|
||||||
+ getHandle().receive(((CraftItem) item).getHandle(), quantity);
|
+ getHandle().receive(((CraftItem) item).getHandle(), quantity);
|
||||||
|
@ -38,8 +38,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
public boolean isHandRaised() {
|
public org.bukkit.inventory.EquipmentSlot getHandRaised() {
|
||||||
return getHandle().isHandRaised();
|
return getHandle().getRaisedHand() == net.minecraft.world.EnumHand.MAIN_HAND ? org.bukkit.inventory.EquipmentSlot.HAND : org.bukkit.inventory.EquipmentSlot.OFF_HAND;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
@ -55,6 +55,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ ((EntityInsentient) getHandle()).getControllerJump().jump();
|
+ ((EntityInsentient) getHandle()).getControllerJump().jump();
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isHandRaised() {
|
+ public boolean isHandRaised() {
|
||||||
+ return getHandle().isHandRaised();
|
+ return getHandle().isHandRaised();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public org.bukkit.inventory.EquipmentSlot getHandRaised() {
|
||||||
|
+ return getHandle().getRaisedHand() == net.minecraft.world.EnumHand.MAIN_HAND ? org.bukkit.inventory.EquipmentSlot.HAND : org.bukkit.inventory.EquipmentSlot.OFF_HAND;
|
||||||
+ }
|
+ }
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren