1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
--- a/net/minecraft/server/ServerTickRateManager.java
+++ b/net/minecraft/server/ServerTickRateManager.java
@@ -25,7 +25,6 @@
}
@Override
- @Override
public void setFrozen(boolean flag) {
super.setFrozen(flag);
this.updateStateToClients();
@@ -60,8 +59,14 @@
}
public boolean stopSprinting() {
+ // CraftBukkit start, add sendLog parameter
+ return stopSprinting(true);
+ }
+
+ public boolean stopSprinting(boolean sendLog) {
+ // CraftBukkit end
if (this.remainingSprintTicks > 0L) {
- this.finishTickSprint();
+ this.finishTickSprint(sendLog); // CraftBukkit - add sendLog parameter
return true;
} else {
return false;
@@ -79,7 +84,7 @@
return flag;
}
- private void finishTickSprint() {
+ private void finishTickSprint(boolean sendLog) { // CraftBukkit - add sendLog parameter
long i = this.scheduledCurrentSprintTicks - this.remainingSprintTicks;
double d0 = Math.max(1.0D, (double) this.sprintTimeSpend) / (double) TimeUtil.NANOSECONDS_PER_MILLISECOND;
int j = (int) ((double) (TimeUtil.MILLISECONDS_PER_SECOND * i) / d0);
@@ -87,9 +92,13 @@
this.scheduledCurrentSprintTicks = 0L;
this.sprintTimeSpend = 0L;
- this.server.createCommandSourceStack().sendSuccess(() -> {
- return Component.translatable("commands.tick.sprint.report", j, s);
- }, true);
+ // CraftBukkit start - add sendLog parameter
+ if (sendLog) {
+ this.server.createCommandSourceStack().sendSuccess(() -> {
+ return Component.translatable("commands.tick.sprint.report", j, s);
+ }, true);
+ }
+ // CraftBukkit end
this.remainingSprintTicks = 0L;
this.setFrozen(this.previousIsFrozen);
this.server.onTickRateChanged();
@@ -103,7 +112,7 @@
--this.remainingSprintTicks;
return true;
} else {
- this.finishTickSprint();
+ this.finishTickSprint(true); // CraftBukkit - add sendLog parameter
return false;
}
}
@@ -113,15 +122,14 @@
}
@Override
- @Override
public void setTickRate(float f) {
super.setTickRate(f);
this.server.onTickRateChanged();
this.updateStateToClients();
}
- public void updateJoiningPlayer(ServerPlayer serverplayer) {
- serverplayer.connection.send(ClientboundTickingStatePacket.from(this));
- serverplayer.connection.send(ClientboundTickingStepPacket.from(this));
+ public void updateJoiningPlayer(ServerPlayer entityplayer) {
+ entityplayer.connection.send(ClientboundTickingStatePacket.from(this));
+ entityplayer.connection.send(ClientboundTickingStepPacket.from(this));
}
}
|