mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-31 20:51:47 +01:00
Port lag compensation patch
This commit is contained in:
parent
8a7d58d082
commit
235d6cc2dd
@ -31,10 +31,10 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
return player != null && player.level() == this ? player : null;
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
return this.nearbyPlayers;
|
||||
}
|
||||
// Paper end - optimise getPlayerByUUID
|
||||
// Paper end - rewrite chunk system
|
||||
+ // Paper start - lag compensation
|
||||
+ private long lagCompensationTick = net.minecraft.server.MinecraftServer.SERVER_INIT;
|
||||
+
|
||||
@ -95,9 +95,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper - Prevent consuming the wrong itemstack
|
||||
this.useItem = itemstack;
|
||||
- this.useItemRemaining = itemstack.getUseDuration();
|
||||
- this.useItemRemaining = itemstack.getUseDuration(this);
|
||||
+ // Paper start - lag compensate eating
|
||||
+ this.useItemRemaining = this.totalEatTimeTicks = itemstack.getUseDuration();
|
||||
+ this.useItemRemaining = this.totalEatTimeTicks = itemstack.getUseDuration(this);
|
||||
+ this.eatStartTime = System.nanoTime();
|
||||
+ // Paper end - lag compensate eating
|
||||
if (!this.level().isClientSide) {
|
Loading…
Reference in New Issue
Block a user