mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 19ff55ef Update upstream B/CB 79710332 Update upstream CB 19de9af6 1.15.2 update (#2887) d4ae43fc Updated Upstream (Bukkit/CraftBukkit) 9c2d9a5f [CI-SKIP] Rebuild patches 86a4b752 Fix items not falling correctly (Resolves #2835) (#2872) 35472de2 Port activation range improvement patch (#2763) 617f6033 Add effect to block break naturally (#2819) f63cfe00 Updated Upstream (Bukkit/CraftBukkit) 00860e4e [CI-SKIP] rebuild patches 3d519668 Prevent sync chunk loads when villagers try to find beds (#2855)
53 lines
2.2 KiB
Diff
53 lines
2.2 KiB
Diff
From 76ec68db1e1b4af4b2039dbc84b1a075bc760388 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 18 Oct 2019 23:34:48 -0500
|
|
Subject: [PATCH] Add entity jump API
|
|
|
|
---
|
|
.../java/net/minecraft/server/EntityLiving.java | 2 ++
|
|
.../craftbukkit/entity/CraftLivingEntity.java | 14 ++++++++++++++
|
|
2 files changed, 16 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
index d4fb8e4a6..3b6a337e6 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -2619,8 +2619,10 @@ public abstract class EntityLiving extends Entity {
|
|
} else if (this.aH()) {
|
|
this.c(TagsFluid.LAVA);
|
|
} else if ((this.onGround || this.N > 0.0D && this.N <= 0.4D) && this.jumpTicks == 0) {
|
|
+ if (new net.pl3x.purpur.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Purpur
|
|
this.jump();
|
|
this.jumpTicks = 10;
|
|
+ } // Purpur
|
|
}
|
|
} else {
|
|
this.jumpTicks = 0;
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index ffd137228..e408c8922 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -733,5 +733,19 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
public void setCanBeRiddenInWater(boolean canBeRiddenInWater) {
|
|
getHandle().setCanBeRiddenInWater(canBeRiddenInWater);
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean isJumping() {
|
|
+ return getHandle().isJumping();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setJumping(boolean jumping) {
|
|
+ getHandle().setJumping(jumping);
|
|
+ if (jumping && getHandle() instanceof EntityInsentient) {
|
|
+ // this is needed to actually make a mob jump
|
|
+ ((EntityInsentient) getHandle()).getControllerJump().jump();
|
|
+ }
|
|
+ }
|
|
// Purpur end
|
|
}
|
|
--
|
|
2.24.0
|
|
|