aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/server/ServerTickRateManager.java.patch
diff options
context:
space:
mode:
authorMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
committerMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
commitbee74680e607c2e29b038329f62181238911cd83 (patch)
tree708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/mache-spigotflower/net/minecraft/server/ServerTickRateManager.java.patch
parent0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff)
downloadPaper-bee74680e607c2e29b038329f62181238911cd83.tar.gz
Paper-bee74680e607c2e29b038329f62181238911cd83.zip
add remapped patches as a testsoftspoon
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/server/ServerTickRateManager.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/server/ServerTickRateManager.java.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/server/ServerTickRateManager.java.patch b/patch-remap/mache-spigotflower/net/minecraft/server/ServerTickRateManager.java.patch
new file mode 100644
index 0000000000..fbc3470f36
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/server/ServerTickRateManager.java.patch
@@ -0,0 +1,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));
+ }
+ }