9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-30 20:39:15 +00:00

Update Paper

This commit is contained in:
violetc
2023-10-13 16:28:10 +08:00
parent 27c5f5371b
commit 06e88af9c1
9 changed files with 30 additions and 30 deletions

View File

@@ -6,12 +6,12 @@ Subject: [PATCH] Player operation limiter
This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ae6fe20cac39766bd1cde1adfd93072ce4a8f44c..4f47b1123eb517ffda3c1a0e61434e459b38d679 100644
index 5c2aa7dc056a3597afded89d493ac7188228d4d1..08ea2ca7586bb4fb7f8257b900035b0a4e1b261f 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -273,6 +273,10 @@ public class ServerPlayer extends Player {
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
@@ -274,6 +274,10 @@ public class ServerPlayer extends Player {
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
public @Nullable String clientBrandName = null; // Paper - Brand name
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event
+ // Leaves start - player operation limiter
+ private int instaBreakCountPerTick = 0;
@@ -20,7 +20,7 @@ index ae6fe20cac39766bd1cde1adfd93072ce4a8f44c..4f47b1123eb517ffda3c1a0e61434e45
// Paper start - replace player chunk loader
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
@@ -714,6 +718,7 @@ public class ServerPlayer extends Player {
@@ -715,6 +719,7 @@ public class ServerPlayer extends Player {
this.joining = false;
}
// CraftBukkit end
@@ -28,7 +28,7 @@ index ae6fe20cac39766bd1cde1adfd93072ce4a8f44c..4f47b1123eb517ffda3c1a0e61434e45
this.gameMode.tick();
this.wardenSpawnTracker.tick();
--this.spawnInvulnerableTime;
@@ -2657,5 +2662,32 @@ public class ServerPlayer extends Player {
@@ -2658,5 +2663,32 @@ public class ServerPlayer extends Player {
public CraftPlayer getBukkitEntity() {
return (CraftPlayer) super.getBukkitEntity();
}