Only jump with head height

distance of above
This commit is contained in:
fullwall 2020-12-16 01:16:04 +08:00
parent 87cadbfb02
commit 556c58a7f6
9 changed files with 8 additions and 9 deletions

View File

@ -92,7 +92,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue()) * 10;
this.a.l(movement);
this.a.bg = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {

View File

@ -96,7 +96,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue()) * 10;
this.a.l(movement);
this.a.bf = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {

View File

@ -54,7 +54,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue()) * 10;
this.a.k(movement);
this.a.bg = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {

View File

@ -56,7 +56,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue()) * 10;
this.a.o(movement);
this.a.bj = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {

View File

@ -57,7 +57,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue());
this.a.o(movement);
this.a.bd = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {

View File

@ -53,7 +53,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue());
this.a.o(movement);
this.a.bb = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {

View File

@ -70,7 +70,6 @@ public abstract class MobEntityController extends AbstractEntityController {
}
private static final Map<Class<?>, Constructor<?>> CONSTRUCTOR_CACHE = Maps.newHashMap();
private static final MethodHandle UUID_FIELD = NMS.getSetter(net.minecraft.server.v1_16_R3.Entity.class,
"uniqueID");
}

View File

@ -53,7 +53,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue());
this.a.q(movement);
this.a.aT = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || (d2 >= NMS.getStepHeight(a.getBukkitEntity()) && (d0 * d0 + d1 * d1) < 1.0D)) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {

View File

@ -92,7 +92,7 @@ public class PlayerControllerMove extends ControllerMove {
float movement = (float) (this.e * speed.getValue()) * 10;
this.a.k(movement);
this.a.ba = movement;
if (shouldSlimeJump() || ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))) {
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
this.h = cg();
this.h /= 3;
if (this.a instanceof EntityHumanNPC) {