Skip to content

Commit

Permalink
Update Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Oct 13, 2023
1 parent 27c5f53 commit 06e88af
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.7"
id("io.papermc.paperweight.patcher") version "1.5.8"
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version=1.20.2-R0.1-SNAPSHOT
mcVersion=1.20.2
packageVersion=1_20_R2
org.gradle.jvmargs=-Xmx2G
paperRef=29a02095754a8bc76f996f53e1da1cc04b5fd167
preVersion=true
paperRef=f6134370195d24e249237c89e54cb8d87f80164a
preVersion=false
8 changes: 4 additions & 4 deletions patches/server/0006-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ index c798fbe078e14b0473b2d8bcdccc11238d28025e..68a242f6aaa4aeebff5c2c566ac2aab5
((Runnable) this.tickables.get(i)).run();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 231150bac0ae61e9722c2cdfd70d6f7d254681e4..c8a20791db9e2f18c7ed02bb810190e21353203b 100644
index 20122bf191ebc74c223310aea1f004fdbb163e57..6f758e7bf7c93dae1c7f459e0bc4a32e91a09ca0 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -116,6 +116,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -115,6 +115,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
+ top.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePayload(player, packet.payload()); // Leaves - protocol
// Paper start - handle brand payload packet
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload brandPayload) {
this.clientBrandName = brandPayload.brand();
@@ -133,6 +134,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
this.player.clientBrandName = brandPayload.brand();
@@ -132,6 +133,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
String channels = payload.toString(com.google.common.base.Charsets.UTF_8);
for (String channel : channels.split("\0")) {
this.getCraftPlayer().addChannel(channel);
Expand Down
12 changes: 6 additions & 6 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ index 8bb72e567633dff5d5748b221771d16d25bf8e39..e809ef00c17d2a55877799c595c6732f

}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index d4aec99cac3f83d764e21946cc904c00e084704e..ae6fe20cac39766bd1cde1adfd93072ce4a8f44c 100644
index 76157319b79d7fefe38cb2cc10b2d79c12667e3d..5c2aa7dc056a3597afded89d493ac7188228d4d1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -95,7 +95,6 @@ import net.minecraft.util.Mth;
Expand All @@ -106,7 +106,7 @@ index d4aec99cac3f83d764e21946cc904c00e084704e..ae6fe20cac39766bd1cde1adfd93072c
// CraftBukkit end

public class ServerPlayer extends Player {
@@ -722,15 +722,19 @@ public class ServerPlayer extends Player {
@@ -723,15 +723,19 @@ public class ServerPlayer extends Player {
}

// Paper start - Configurable container update tick rate
Expand Down Expand Up @@ -134,7 +134,7 @@ index d4aec99cac3f83d764e21946cc904c00e084704e..ae6fe20cac39766bd1cde1adfd93072c

Entity entity = this.getCamera();

@@ -746,7 +750,7 @@ public class ServerPlayer extends Player {
@@ -747,7 +751,7 @@ public class ServerPlayer extends Player {
}
}

Expand All @@ -143,7 +143,7 @@ index d4aec99cac3f83d764e21946cc904c00e084704e..ae6fe20cac39766bd1cde1adfd93072c
if (this.levitationStartPos != null) {
CriteriaTriggers.LEVITATION.trigger(this, this.levitationStartPos, this.tickCount - this.levitationStartTime);
}
@@ -939,7 +943,7 @@ public class ServerPlayer extends Player {
@@ -940,7 +944,7 @@ public class ServerPlayer extends Player {
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(this.getInventory().getContainerSize());
boolean keepInventory = this.level().getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) || this.isSpectator();

Expand All @@ -152,7 +152,7 @@ index d4aec99cac3f83d764e21946cc904c00e084704e..ae6fe20cac39766bd1cde1adfd93072c
for (ItemStack item : this.getInventory().getContents()) {
if (!item.isEmpty() && !EnchantmentHelper.hasVanishingCurse(item)) {
loot.add(CraftItemStack.asCraftMirror(item));
@@ -1268,6 +1272,13 @@ public class ServerPlayer extends Player {
@@ -1269,6 +1273,13 @@ public class ServerPlayer extends Player {
this.lastSentHealth = -1.0F;
this.lastSentFood = -1;

Expand Down Expand Up @@ -396,7 +396,7 @@ index 57696b8fe6eec4c0431ef873c980d37f31ff805b..c2909d4c275714e0751210847798da70
+ // Leaves end - Bot API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 315d8260e196709ed9084272aa640f11e327c0a8..e7b7e1f670ec90b130f6388a5c9ded271b18fb01 100644
index f7ebddd35ff5a60a81034fd7de035ebba83e9517..80afcba1a1918ee8f108976a4b82302370bee9c0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -194,6 +194,8 @@ import org.bukkit.plugin.Plugin;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0018-No-chat-sign.patch
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ index 0835a4ab23b3cb0864d9b452e1a6c8141496cd57..7362fb735a7eb006ebe63190992ae098

@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index c8a20791db9e2f18c7ed02bb810190e21353203b..40c817044a1934194490c3863a570e621877d53c 100644
index 6f758e7bf7c93dae1c7f459e0bc4a32e91a09ca0..0059a650608cc0adc75851beeffc7370c6309478 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -234,10 +234,27 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -226,10 +226,27 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}

public void send(Packet<?> packet) {
Expand Down
10 changes: 5 additions & 5 deletions patches/server/0047-Player-operation-limiter.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -20,15 +20,15 @@ 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
+ this.resetOperationCountPerTick(); // Leaves - player operation limiter
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();
}
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0052-Return-nether-portal-fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Return nether portal fix
This patch is powered by NetherPortalFix(https://github.com/TwelveIterationMods/NetherPortalFix)

diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 4f47b1123eb517ffda3c1a0e61434e459b38d679..7cd939bd90cf047e7bd4f894906c2af4198534d2 100644
index 08ea2ca7586bb4fb7f8257b900035b0a4e1b261f..26584359959f3d809760be4b0a8983f48a197882 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -180,6 +180,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
Expand All @@ -17,7 +17,7 @@ index 4f47b1123eb517ffda3c1a0e61434e459b38d679..7cd939bd90cf047e7bd4f894906c2af4
// CraftBukkit end

public class ServerPlayer extends Player {
@@ -1288,6 +1289,24 @@ public class ServerPlayer extends Player {
@@ -1289,6 +1290,24 @@ public class ServerPlayer extends Player {
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
// CraftBukkit end
Expand All @@ -42,7 +42,7 @@ index 4f47b1123eb517ffda3c1a0e61434e459b38d679..7cd939bd90cf047e7bd4f894906c2af4
}
// Paper start
if (this.isBlocking()) {
@@ -1340,6 +1359,30 @@ public class ServerPlayer extends Player {
@@ -1341,6 +1360,30 @@ public class ServerPlayer extends Player {
protected Optional<BlockUtil.FoundRectangle> getExitPortal(ServerLevel worldserver, BlockPos blockposition, boolean flag, WorldBorder worldborder, int searchRadius, boolean canCreatePortal, int createRadius) { // CraftBukkit
Optional<BlockUtil.FoundRectangle> optional = super.getExitPortal(worldserver, blockposition, flag, worldborder, searchRadius, canCreatePortal, createRadius); // CraftBukkit

Expand Down
10 changes: 5 additions & 5 deletions patches/server/0074-Fix-Paper-9372.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ Subject: [PATCH] Fix Paper#9372
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 7cd939bd90cf047e7bd4f894906c2af4198534d2..cd68b7b969a7b06181a7c2d92ed6a1a2a3897f3a 100644
index 26584359959f3d809760be4b0a8983f48a197882..0ab5a5622b2687a6f5da2ac4d4457878a0b439fb 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1259,6 +1259,7 @@ public class ServerPlayer extends Player {
@@ -1260,6 +1260,7 @@ public class ServerPlayer extends Player {
this.setServerLevel(worldserver);
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
+ if (top.leavesmc.leaves.LeavesConfig.fixPaper9372) this.mainSupportingBlockPos = Optional.empty(); // Leaves - fix paper 9372
worldserver.addDuringPortalTeleport(this);
worldserver1.getProfiler().pop();
this.triggerDimensionChangeTriggers(worldserver1);
@@ -1975,6 +1976,7 @@ public class ServerPlayer extends Player {
@@ -1976,6 +1977,7 @@ public class ServerPlayer extends Player {
public void moveTo(double x, double y, double z) {
super.moveTo(x, y, z);
this.connection.resetPosition();
+ if (top.leavesmc.leaves.LeavesConfig.fixPaper9372) this.mainSupportingBlockPos = Optional.empty(); // Leaves - fix paper 9372
}

@Override
@@ -2214,6 +2216,7 @@ public class ServerPlayer extends Player {
@@ -2215,6 +2217,7 @@ public class ServerPlayer extends Player {

this.connection.send(new ClientboundSetCameraPacket(this.camera));
this.connection.resetPosition();
+ if (top.leavesmc.leaves.LeavesConfig.fixPaper9372) this.mainSupportingBlockPos = Optional.empty(); // Leaves - fix paper 9372
}
}

@@ -2652,6 +2655,7 @@ public class ServerPlayer extends Player {
@@ -2653,6 +2656,7 @@ public class ServerPlayer extends Player {
public void forceSetPositionRotation(double x, double y, double z, float yaw, float pitch) {
this.moveTo(x, y, z, yaw, pitch);
this.connection.resetPosition();
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0112-Leaves-tick-command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ index fccb76a8dfa6a0c5d704a0a8f7392beedea320c9..781a0fc1988f950ca85c05614fec0a8e
ReportedException reportedexception = null;

diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index cd68b7b969a7b06181a7c2d92ed6a1a2a3897f3a..96e05080abc8c2f2f915e976ea6bcb04927ceef6 100644
index 0ab5a5622b2687a6f5da2ac4d4457878a0b439fb..1e54816b487922d380941aa5f5d0e35ec91ec014 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2733,7 +2733,7 @@ public class ServerPlayer extends Player {
@@ -2734,7 +2734,7 @@ public class ServerPlayer extends Player {
}

public boolean allowOperation() {
Expand Down

0 comments on commit 06e88af

Please sign in to comment.