mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-10 21:02:36 +01:00
Fix mistranslation
This commit is contained in:
parent
5306a68b6a
commit
aabdf8e37a
@ -1110,7 +1110,7 @@ public class NMSImpl implements NMSBridge {
|
||||
|
||||
@Override
|
||||
public void setBodyYaw(org.bukkit.entity.Entity entity, float yaw) {
|
||||
getHandle(entity).setYBodyRot(yaw);
|
||||
getHandle(entity).setYRot(yaw);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,8 +22,11 @@ public class PlayerLookControl {
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (!NMSImpl.isNavigationFinished(this.a.getNavigation()))
|
||||
if (!NMSImpl.isNavigationFinished(this.a.getNavigation())) {
|
||||
// TODO: use Citizens AI?
|
||||
// this.a.yHeadRot = Mth.rotateIfNecessary(this.a.yHeadRot, this.a.yBodyRot, 75);
|
||||
return;
|
||||
}
|
||||
if (this.b()) {
|
||||
// this.a.setXRot(0.0F);
|
||||
}
|
||||
@ -63,9 +66,6 @@ public class PlayerLookControl {
|
||||
} else {
|
||||
// this.a.yHeadRot = rotateTowards(this.a.yHeadRot, this.a.yBodyRot, 10.0F);
|
||||
}
|
||||
if (!this.a.getNavigation().isDone()) { // TODO: use Citizens AI?
|
||||
this.a.yHeadRot = Mth.rotateIfNecessary(this.a.yHeadRot, this.a.yBodyRot, 75);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(double var0, double var2, double var4) {
|
||||
|
@ -15,7 +15,7 @@ import net.minecraft.world.entity.monster.Slime;
|
||||
|
||||
public class PlayerMoveControl extends MoveControl {
|
||||
protected LivingEntity a;
|
||||
private int h;
|
||||
private int jumpTicks;
|
||||
protected boolean moving;
|
||||
protected double speed;
|
||||
protected double tx;
|
||||
@ -31,10 +31,6 @@ public class PlayerMoveControl extends MoveControl {
|
||||
this.tz = entityinsentient.getZ();
|
||||
}
|
||||
|
||||
protected int cg() {
|
||||
return new Random().nextInt(20) + 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSpeedModifier() {
|
||||
return this.speed;
|
||||
@ -60,6 +56,10 @@ public class PlayerMoveControl extends MoveControl {
|
||||
return this.moving;
|
||||
}
|
||||
|
||||
protected int jumpTicks() {
|
||||
return new Random().nextInt(20) + 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float rotlerp(float f, float f1, float f2) {
|
||||
float f3 = Mth.wrapDegrees(f1 - f);
|
||||
@ -92,11 +92,11 @@ public class PlayerMoveControl extends MoveControl {
|
||||
this.moving = true;
|
||||
}
|
||||
|
||||
private boolean shouldSlimeJump() {
|
||||
private boolean shouldJump() {
|
||||
if (!(this.a instanceof Slime)) {
|
||||
return false;
|
||||
}
|
||||
if (this.h-- <= 0) {
|
||||
if (this.jumpTicks-- <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -115,7 +115,7 @@ public class PlayerMoveControl extends MoveControl {
|
||||
this.a.zza = 0.0F;
|
||||
return;
|
||||
}
|
||||
float f = (float) Math.toDegrees(Mth.atan2(dZ, dX)) - 90.0F;
|
||||
float f = (float) (Mth.atan2(dZ, dX) * 57.2957763671875D) - 90.0F;
|
||||
this.a.setYRot(rotlerp(this.a.getYRot(), f, 90.0F));
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.getYRot());
|
||||
AttributeInstance speed = this.a.getAttribute(Attributes.MOVEMENT_SPEED);
|
||||
@ -123,9 +123,9 @@ public class PlayerMoveControl extends MoveControl {
|
||||
float movement = (float) (this.speed * speed.getValue());
|
||||
this.a.setSpeed(movement);
|
||||
this.a.zza = movement;
|
||||
if (shouldSlimeJump() || (dY >= NMS.getStepHeight(a.getBukkitEntity()) && dXZ < 1.0D)) {
|
||||
this.h = cg();
|
||||
this.h /= 3;
|
||||
if (shouldJump() || (dY >= NMS.getStepHeight(a.getBukkitEntity()) && dXZ < 1.0D)) {
|
||||
this.jumpTicks = jumpTicks();
|
||||
this.jumpTicks /= 3;
|
||||
if (this.a instanceof EntityHumanNPC) {
|
||||
((EntityHumanNPC) this.a).getControllerJump().jump();
|
||||
} else {
|
||||
|
@ -527,7 +527,7 @@ public class PlayerNavigation extends PathNavigation {
|
||||
if (isDone())
|
||||
return;
|
||||
Vec3 var0 = this.path.getNextEntityPos(this.mob);
|
||||
BlockPos var1 = new BlockPos(var0);
|
||||
BlockPos var1 = new BlockPos(var0);
|
||||
this.mob.getMoveControl().setWantedPosition(var0.x, this.level.getBlockState(var1.down()).isAir() ? var0.y
|
||||
: WalkNodeEvaluator.getFloorLevel(this.level, var1), var0.z, this.speedModifier);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user