mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 8d036cea Expose the internal current tick 0c715390 [PATCH] bounding box check for hanging entities (#2664) 527073aa Update config version 0d3b35c3 Rename baby zombie movement config option
This commit is contained in:
97
patches/api/0017-Add-entity-jump-API.patch
Normal file
97
patches/api/0017-Add-entity-jump-API.patch
Normal file
@@ -0,0 +1,97 @@
|
||||
From 5ca385b0adb500d67a5ae59cda74cbcbe05a2cc7 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 23:34:38 -0500
|
||||
Subject: [PATCH] Add entity jump API
|
||||
|
||||
---
|
||||
.../purpur/event/entity/EntityJumpEvent.java | 46 +++++++++++++++++++
|
||||
.../java/org/bukkit/entity/LivingEntity.java | 21 +++++++++
|
||||
2 files changed, 67 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/entity/EntityJumpEvent.java
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/EntityJumpEvent.java b/src/main/java/net/pl3x/purpur/event/entity/EntityJumpEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..08546c01d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/EntityJumpEvent.java
|
||||
@@ -0,0 +1,46 @@
|
||||
+package net.pl3x.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.LivingEntity;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when an entity jumps
|
||||
+ * <p>
|
||||
+ * Cancelling the event will stop the entity from jumping
|
||||
+ */
|
||||
+public class EntityJumpEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean canceled;
|
||||
+
|
||||
+ public EntityJumpEvent(@NotNull LivingEntity entity) {
|
||||
+ super(entity);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public LivingEntity getEntity() {
|
||||
+ return (LivingEntity) entity;
|
||||
+ }
|
||||
+
|
||||
+ public boolean isCancelled() {
|
||||
+ return canceled;
|
||||
+ }
|
||||
+
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ canceled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 3a8961853..7196c1b79 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -710,5 +710,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param canBeRiddenInWater Whether or not this entity can be ridden in water
|
||||
*/
|
||||
void setCanBeRiddenInWater(boolean canBeRiddenInWater);
|
||||
+
|
||||
+ /**
|
||||
+ * Get entity jump state
|
||||
+ * <p>
|
||||
+ * Jump state will be true when the entity has been marked to jump
|
||||
+ *
|
||||
+ * @return Jump state
|
||||
+ */
|
||||
+ boolean isJumping();
|
||||
+
|
||||
+ /**
|
||||
+ * Set entity jump state
|
||||
+ * <p>
|
||||
+ * Setting to true will mark the entity to jump
|
||||
+ * <p>
|
||||
+ * Setting to false will unmark the entity from jumping, but
|
||||
+ * will not stop a jump that has already started
|
||||
+ *
|
||||
+ * @param jumping Jump state
|
||||
+ */
|
||||
+ void setJumping(boolean jumping);
|
||||
// Purpur end
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
|
||||
Reference in New Issue
Block a user