Try using base value for movement speed instead of modified value in movement control

This commit is contained in:
fullwall 2024-08-25 22:01:34 +08:00
parent bce7baced9
commit b984fb9312
8 changed files with 8 additions and 8 deletions

View File

@ -47,7 +47,7 @@ public class PlayerControllerMove extends ControllerMove {
float f = (float) Math.toDegrees(Math.atan2(d1, d0)) - 90.0F;
this.a.yaw = a(this.a.yaw, f, 90.0F);
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
this.a.bd = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
this.a.bd = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue());
if (a instanceof EntitySlime && h-- <= 0) {
this.h = new Random().nextInt(20) + 10;
this.h /= 3;

View File

@ -47,7 +47,7 @@ public class PlayerControllerMove extends ControllerMove {
float f = (float) Math.toDegrees(Math.atan2(d1, d0)) - 90.0F;
this.a.yaw = a(this.a.yaw, f, 90.0F);
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
this.a.bb = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
this.a.bb = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue());
if (a instanceof EntitySlime && h-- <= 0) {
this.h = new Random().nextInt(20) + 10;
this.h /= 3;

View File

@ -48,7 +48,7 @@ public class EntityMoveControl extends ControllerMove {
float f = (float) Math.toDegrees(Math.atan2(d1, d0)) - 90.0F;
this.a.yaw = a(this.a.yaw, f, 90.0F);
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
this.a.aT = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
this.a.aT = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue());
if (a instanceof EntitySlime && h-- <= 0) {
this.h = new Random().nextInt(20) + 10;
if (((EntitySlime) a).isAggressive()) {

View File

@ -108,7 +108,7 @@ public class EntityMoveControl extends MoveControl {
entity.setYRot(rotlerp(this.entity.getYRot(), f, 90.0F));
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
}
this.entity.zza = (float) (this.speed * entity.getAttribute(Attributes.MOVEMENT_SPEED).getValue());
this.entity.zza = (float) (this.speed * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
if (entity instanceof Slime && jumpTicks-- <= 0) {
this.jumpTicks = new Random().nextInt(20) + 10;
if (((Slime) entity).isAggressive()) {

View File

@ -108,7 +108,7 @@ public class EntityMoveControl extends MoveControl {
entity.setYRot(rotlerp(this.entity.getYRot(), f, 90.0F));
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
}
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getValue());
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
if (entity instanceof Slime && jumpTicks-- <= 0) {
this.jumpTicks = new Random().nextInt(20) + 10;
if (((Slime) entity).isAggressive()) {

View File

@ -108,7 +108,7 @@ public class EntityMoveControl extends MoveControl {
entity.setYRot(rotlerp(this.entity.getYRot(), f, 90.0F));
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
}
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getValue());
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
if (entity instanceof Slime && jumpTicks-- <= 0) {
this.jumpTicks = new Random().nextInt(20) + 10;
if (((Slime) entity).isAggressive()) {

View File

@ -106,7 +106,7 @@ public class EntityMoveControl extends MoveControl {
entity.setYRot(rotlerp(this.entity.getYRot(), f, 90.0F));
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
}
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getValue());
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
if (entity instanceof Slime && jumpTicks-- <= 0) {
this.jumpTicks = new Random().nextInt(20) + 10;
if (((Slime) entity).isAggressive()) {

View File

@ -106,7 +106,7 @@ public class EntityMoveControl extends MoveControl {
entity.setYRot(rotlerp(this.entity.getYRot(), f, 90.0F));
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
}
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getValue());
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
if (entity instanceof Slime && jumpTicks-- <= 0) {
this.jumpTicks = new Random().nextInt(20) + 10;
if (((Slime) entity).isAggressive()) {