Entity Jump API

== AT ==
public net.minecraft.world.entity.LivingEntity jumping
This commit is contained in:
BillyGalbreath
2020-02-08 23:26:11 -06:00
parent 4e20691d59
commit 0dd8044178
4 changed files with 110 additions and 59 deletions

View File

@@ -10,7 +10,7 @@
public class Ravager extends Raider {
@@ -158,6 +161,11 @@
@@ -158,12 +161,19 @@
Block block = iblockdata.getBlock();
if (block instanceof LeavesBlock) {
@@ -22,7 +22,15 @@
flag = worldserver.destroyBlock(blockposition, true, this) || flag;
}
}
@@ -281,7 +289,7 @@
if (!flag && this.onGround()) {
+ if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper - Entity Jump API
this.jumpFromGround();
+ } else { this.setJumping(false); } // Paper - Entity Jump API; setJumping(false) stops a potential loop
}
}
}
@@ -281,7 +291,7 @@
double d1 = entity.getZ() - this.getZ();
double d2 = Math.max(d0 * d0 + d1 * d1, 0.001D);