Skip to content

Commit

Permalink
Patch in missing LivingJumpEvent for Slime and Camel
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt committed May 16, 2024
1 parent bb3537b commit 1da84e9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions patches/net/minecraft/world/entity/animal/camel/Camel.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
@@ -286,6 +_,7 @@
this.dashCooldown = 55;
this.setDashing(true);
this.hasImpulse = true;
+ net.neoforged.neoforge.common.CommonHooks.onLivingJump(this);
}

public boolean isDashing() {
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
this.setDeltaMovement(vec3.x, d0, vec3.z);
this.setIsJumping(true);
this.hasImpulse = true;
+ net.neoforged.neoforge.common.CommonHooks.onLivingJump(this);
+ net.neoforged.neoforge.common.CommonHooks.onLivingJump(this);
if (p_275435_.z > 0.0) {
float f = Mth.sin(this.getYRot() * (float) (Math.PI / 180.0));
float f1 = Mth.cos(this.getYRot() * (float) (Math.PI / 180.0));
Expand Down
8 changes: 8 additions & 0 deletions patches/net/minecraft/world/entity/monster/Slime.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
}
}

@@ -332,6 +_,7 @@
Vec3 vec3 = this.getDeltaMovement();
this.setDeltaMovement(vec3.x, (double)this.getJumpPower(), vec3.z);
this.hasImpulse = true;
+ net.neoforged.neoforge.common.CommonHooks.onLivingJump(this);
}

@Nullable
@@ -361,6 +_,12 @@
public EntityDimensions getDefaultDimensions(Pose p_316359_) {
return super.getDefaultDimensions(p_316359_).scale((float)this.getSize());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public LivingEntity getEntity() {
* LivingJumpEvent is fired when an Entity jumps.<br>
* This event is fired whenever an Entity jumps in
* {@code LivingEntity#jumpFromGround()}, {@code MagmaCube#jumpFromGround()},
* and {@code Horse#jumpFromGround()}.<br>
* {@code Slime#jumpFromGround()}, {@code Camel#executeRidersJump()},
* and {@code AbstractHorse#executeRidersJump()}.<br>
* <br>
* This event is fired via the {@link CommonHooks#onLivingJump(LivingEntity)}.<br>
* <br>
Expand Down

0 comments on commit 1da84e9

Please sign in to comment.