fix movements 1.21.2
All checks were successful
Build fabric mod / build (push) Successful in 35m53s
All checks were successful
Build fabric mod / build (push) Successful in 35m53s
This commit is contained in:
parent
412c3f47ab
commit
d101b11c36
@ -17,4 +17,4 @@ mod_version = 1.1.2+1.21.2
|
|||||||
maven_group = ru.themixray
|
maven_group = ru.themixray
|
||||||
archives_base_name = repeating-mod
|
archives_base_name = repeating-mod
|
||||||
|
|
||||||
# Compatible with: 1.21, 1.21.1
|
# Compatible with: 1.21.2, ?
|
@ -18,6 +18,8 @@ public class InputEvent extends RecordEvent {
|
|||||||
public float body_yaw;
|
public float body_yaw;
|
||||||
public float pitch;
|
public float pitch;
|
||||||
public float speed;
|
public float speed;
|
||||||
|
public float movementForward;
|
||||||
|
public float movementSideways;
|
||||||
|
|
||||||
public static InputEvent current() {
|
public static InputEvent current() {
|
||||||
if (Main.client.player == null) return null;
|
if (Main.client.player == null) return null;
|
||||||
@ -33,7 +35,9 @@ public class InputEvent extends RecordEvent {
|
|||||||
Main.client.player.getBodyYaw(),
|
Main.client.player.getBodyYaw(),
|
||||||
Main.client.player.getPitch(),
|
Main.client.player.getPitch(),
|
||||||
Main.client.player.getYaw(),
|
Main.client.player.getYaw(),
|
||||||
Main.client.player.getMovementSpeed()
|
Main.client.player.getMovementSpeed(),
|
||||||
|
Main.client.player.input.movementForward,
|
||||||
|
Main.client.player.input.movementSideways
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +52,9 @@ public class InputEvent extends RecordEvent {
|
|||||||
float body_yaw,
|
float body_yaw,
|
||||||
float head_pitch,
|
float head_pitch,
|
||||||
float yaw,
|
float yaw,
|
||||||
float speed) {
|
float speed,
|
||||||
|
float movementForward,
|
||||||
|
float movementSideways) {
|
||||||
this.forward = forward;
|
this.forward = forward;
|
||||||
this.backward = backward;
|
this.backward = backward;
|
||||||
this.left = left;
|
this.left = left;
|
||||||
@ -62,6 +68,8 @@ public class InputEvent extends RecordEvent {
|
|||||||
this.pitch = head_pitch;
|
this.pitch = head_pitch;
|
||||||
this.yaw = yaw;
|
this.yaw = yaw;
|
||||||
this.speed = speed;
|
this.speed = speed;
|
||||||
|
this.movementForward = movementForward;
|
||||||
|
this.movementSideways = movementSideways;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,7 +88,9 @@ public class InputEvent extends RecordEvent {
|
|||||||
body_yaw,
|
body_yaw,
|
||||||
pitch,
|
pitch,
|
||||||
yaw,
|
yaw,
|
||||||
speed
|
speed,
|
||||||
|
movementForward,
|
||||||
|
movementSideways
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,24 +107,28 @@ public class InputEvent extends RecordEvent {
|
|||||||
Float.parseFloat(a[8]),
|
Float.parseFloat(a[8]),
|
||||||
Float.parseFloat(a[9]),
|
Float.parseFloat(a[9]),
|
||||||
Float.parseFloat(a[10]),
|
Float.parseFloat(a[10]),
|
||||||
Float.parseFloat(a[11])
|
Float.parseFloat(a[11]),
|
||||||
|
Float.parseFloat(a[12]),
|
||||||
|
Float.parseFloat(a[13])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String[] serializeArgs() {
|
protected String[] serializeArgs() {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
((forward == null) ? "n" : (forward ? "1" : "0")),
|
((forward == null) ? "n" : (forward ? "1" : "0")),
|
||||||
((backward == null) ? "n" : (backward ? "1" : "0")),
|
((backward == null) ? "n" : (backward ? "1" : "0")),
|
||||||
((left == null) ? "n" : (left ? "1" : "0")),
|
((left == null) ? "n" : (left ? "1" : "0")),
|
||||||
((right == null) ? "n" : (right ? "1" : "0")),
|
((right == null) ? "n" : (right ? "1" : "0")),
|
||||||
((jump == null) ? "n" : (jump ? "1" : "0")),
|
((jump == null) ? "n" : (jump ? "1" : "0")),
|
||||||
((sneak == null) ? "n" : (sneak ? "1" : "0")),
|
((sneak == null) ? "n" : (sneak ? "1" : "0")),
|
||||||
((sprint == null) ? "n" : (sprint ? "1" : "0")),
|
((sprint == null) ? "n" : (sprint ? "1" : "0")),
|
||||||
String.valueOf(head_yaw),
|
String.valueOf(head_yaw),
|
||||||
String.valueOf(body_yaw),
|
String.valueOf(body_yaw),
|
||||||
String.valueOf(pitch),
|
String.valueOf(pitch),
|
||||||
String.valueOf(yaw),
|
String.valueOf(yaw),
|
||||||
String.valueOf(speed),
|
String.valueOf(speed),
|
||||||
|
String.valueOf(movementForward),
|
||||||
|
String.valueOf(movementSideways)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +144,9 @@ public class InputEvent extends RecordEvent {
|
|||||||
event.head_yaw == head_yaw &&
|
event.head_yaw == head_yaw &&
|
||||||
event.body_yaw == body_yaw &&
|
event.body_yaw == body_yaw &&
|
||||||
event.yaw == yaw &&
|
event.yaw == yaw &&
|
||||||
event.pitch == pitch;
|
event.pitch == pitch &&
|
||||||
|
event.movementForward == movementForward &&
|
||||||
|
event.movementSideways == movementSideways;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void replay() {
|
public void replay() {
|
||||||
@ -152,8 +168,10 @@ public class InputEvent extends RecordEvent {
|
|||||||
if (Main.client.player.getMovementSpeed() != speed)
|
if (Main.client.player.getMovementSpeed() != speed)
|
||||||
Main.client.player.setMovementSpeed(speed);
|
Main.client.player.setMovementSpeed(speed);
|
||||||
|
|
||||||
PlayerInput input = Main.client.player.input.playerInput;
|
Main.client.player.input.movementSideways = movementSideways;
|
||||||
|
Main.client.player.input.movementForward = movementForward;
|
||||||
|
|
||||||
|
PlayerInput input = Main.client.player.input.playerInput;
|
||||||
Main.client.player.input.playerInput = new PlayerInput(
|
Main.client.player.input.playerInput = new PlayerInput(
|
||||||
this.forward == null ? input.forward() : this.forward,
|
this.forward == null ? input.forward() : this.forward,
|
||||||
this.backward == null ? input.backward() : this.backward,
|
this.backward == null ? input.backward() : this.backward,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user