Skip to content

Commit

Permalink
Override addMovement for Player
Browse files Browse the repository at this point in the history
  • Loading branch information
SupremeMortal committed Feb 11, 2020
1 parent ff8b4fd commit 385d42b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/cn/nukkit/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ protected void processMovement(int tickDiff) {
if (!to.equals(ev.getTo())) { //If plugins modify the destination
this.teleport(ev.getTo(), null);
} else {
this.sendPosition(new Vector3(this.x, this.y, this.z), this.yaw, this.pitch, MovePlayerPacket.MODE_NORMAL, this.getViewers().values().toArray(new Player[0]));
this.addMovement(this.x, this.y, this.z, this.yaw, this.pitch, this.yaw);
}
//Biome biome = Biome.biomes[level.getBiomeId(this.getFloorX(), this.getFloorZ())];
//sendTip(biome.getName() + " (" + biome.doesOverhang() + " " + biome.getBaseHeight() + "-" + biome.getHeightVariation() + ")");
Expand Down Expand Up @@ -1610,6 +1610,11 @@ protected void processMovement(int tickDiff) {
this.newPosition = null;
}

@Override
public void addMovement(double x, double y, double z, double yaw, double pitch, double headYaw) {
this.sendPosition(new Vector3(x, y, z), yaw, pitch, MovePlayerPacket.MODE_NORMAL, this.getViewers().values().toArray(new Player[0]));
}

@Override
public boolean setMotion(Vector3 motion) {
if (super.setMotion(motion)) {
Expand Down

0 comments on commit 385d42b

Please sign in to comment.