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 Dec 30, 2023
1 parent cb31cda commit 783ea26
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 51 deletions.
4 changes: 0 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import io.papermc.paperweight.tasks.BaseTask
import io.papermc.paperweight.util.*
import java.io.ByteArrayOutputStream
import java.nio.file.Path
import java.util.regex.Pattern
import kotlin.io.path.*

plugins {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
packageVersion=1_20_R3
org.gradle.jvmargs=-Xmx2G
paperRef=8221b085f91a6ce65701b02fbb6a29e54bcc6023
preVersion=true
updatingMinecraft=true
paperRef=0ae58c09a15ee1ad307a2b8ef7e8ad735d336651
preVersion=false
updatingMinecraft=false
6 changes: 3 additions & 3 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1578,18 +1578,18 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890

} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 30ccbab1586a656e0ae41d7406525fb02d9e025b..0046043408e5ec5737857d833f0a43f91d418df0 100644
index 64255f7db85886421d5029766e8a6d1eadb94cff..abf864b0f4c20ee9c2b52456f931b58495f97fa2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2391,7 +2391,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2398,7 +2398,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

public void handleCommand(String s) { // Paper - private -> public
org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher
- co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);

@@ -2401,20 +2400,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2408,20 +2407,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.cserver.getPluginManager().callEvent(event);

if (event.isCancelled()) {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ index 931d77112ad02e712225efe7e0218fadde24400d..3e7bdcfd3d0ba845fef79c02d110d4a5

}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0eb3384df396508c3d26d1e155cd0e6d64251346..6f062dc3e48d1c7a1e766f699428b44ef91bace4 100644
index be05a52be037042c6158100e2ce880b8ed415d53..d9038d85f8a04381a92567acf1c8922d666aa3e8 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -186,6 +186,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
Expand Down Expand Up @@ -156,7 +156,7 @@ index 0eb3384df396508c3d26d1e155cd0e6d64251346..6f062dc3e48d1c7a1e766f699428b44e
for (ItemStack item : this.getInventory().getContents()) {
if (!item.isEmpty() && !EnchantmentHelper.hasVanishingCurse(item)) {
loot.add(new DefaultDrop(item, stack -> this.drop(stack, true, false, false))); // Paper - drop function taken from Inventory#dropAll (don't fire drop event)
@@ -1271,6 +1276,13 @@ public class ServerPlayer extends Player {
@@ -1272,6 +1277,13 @@ public class ServerPlayer extends Player {
this.lastSentHealth = -1.0F;
this.lastSentFood = -1;

Expand All @@ -171,7 +171,7 @@ index 0eb3384df396508c3d26d1e155cd0e6d64251346..6f062dc3e48d1c7a1e766f699428b44e
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0046043408e5ec5737857d833f0a43f91d418df0..68cc14ef2176dd20ede46af3d62ef0797169b87e 100644
index abf864b0f4c20ee9c2b52456f931b58495f97fa2..ae7cf2b0a90044e93360fc914573c6a549cb6731 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -298,7 +298,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Make shears in dispenser can unlimited use


diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
index e17090003988ad2c890d48666c2234b14d511345..f3cbb95eed1d85c96bb52e05b5274ed249298d60 100644
index ec43e8294d7e7112478a2fc1475f0852690a4882..840524c55d52b5ecaf0b1decfdc871c1fd8e0f42 100644
--- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
@@ -63,7 +63,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0018-No-chat-sign.patch
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ index 72a8aa676836fcb3b4578689d16af65e18f55bbe..47a06936a4727c6209a7ad0fb8fb1099
public MessageSignature get(String argumentName) {
for(ArgumentSignatures.Entry entry : this.entries) {
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index b13bc90b28b02f5e80d935bfcba727f92c5e4c4f..15b41328948ae11b16584484f5973b00bb456a13 100644
index a5bcad412fb1ac3b6a3eee3f4618dc6c1ca66936..a9dbe17dfc1ed81775e5a9500527cdf010f3d223 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -138,6 +138,16 @@ public class FriendlyByteBuf extends ByteBuf {
public <T> void writeJsonWithCodec(Codec<T> codec, T value) {
@@ -143,6 +143,16 @@ public class FriendlyByteBuf extends ByteBuf {
// Paper end - Adventure
DataResult<JsonElement> dataresult = codec.encodeStart(JsonOps.INSTANCE, value);

+ // Leaves start - no chat sign
Expand All @@ -60,7 +60,7 @@ index b13bc90b28b02f5e80d935bfcba727f92c5e4c4f..15b41328948ae11b16584484f5973b00
+
this.writeUtf(FriendlyByteBuf.GSON.toJson((JsonElement) Util.getOrThrow(dataresult, (s) -> {
return new EncoderException("Failed to encode: " + s + " " + value);
})));
})), maxLength); // Paper - Adventure
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
index d1d2fc0c57523c1abf1e8bfec913c78927c3dafc..50c1b722231c2add72663c475ae9068a35bfd524 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Throttle goal selector during inactive ticking
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 5af48151159135b869ec4753bbcf79dd257c1570..339782b10101189fdf70d41330d2e793713d1544 100644
index e0cf7771488ab0065708d68b4e8550b865af0ed4..dc196d04afa8e74be1a43994212d17b430aad2ee 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -221,11 +221,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0047-Player-operation-limiter.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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 6f062dc3e48d1c7a1e766f699428b44ef91bace4..75188dbdaf10d60d11f2b76a73ad0fd2c9b7e643 100644
index d9038d85f8a04381a92567acf1c8922d666aa3e8..b22dd3700c913d0391c8641fca46e89ed5cfff6b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -282,6 +282,10 @@ public class ServerPlayer extends Player {
Expand All @@ -28,7 +28,7 @@ index 6f062dc3e48d1c7a1e766f699428b44ef91bace4..75188dbdaf10d60d11f2b76a73ad0fd2
this.gameMode.tick();
this.wardenSpawnTracker.tick();
--this.spawnInvulnerableTime;
@@ -2767,5 +2772,32 @@ public class ServerPlayer extends Player {
@@ -2768,5 +2773,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 75188dbdaf10d60d11f2b76a73ad0fd2c9b7e643..e2d54448cc9007e2f056d90b77229a664967789b 100644
index b22dd3700c913d0391c8641fca46e89ed5cfff6b..ee85716ac98caa2e63f34be26a48d6b75b0179e3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -187,6 +187,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
Expand All @@ -17,7 +17,7 @@ index 75188dbdaf10d60d11f2b76a73ad0fd2c9b7e643..e2d54448cc9007e2f056d90b77229a66
// CraftBukkit end

public class ServerPlayer extends Player {
@@ -1292,6 +1293,24 @@ public class ServerPlayer extends Player {
@@ -1293,6 +1294,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 75188dbdaf10d60d11f2b76a73ad0fd2c9b7e643..e2d54448cc9007e2f056d90b77229a66
}
// Paper start
if (this.isBlocking()) {
@@ -1344,6 +1363,30 @@ public class ServerPlayer extends Player {
@@ -1345,6 +1364,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
6 changes: 3 additions & 3 deletions patches/server/0060-Syncmatica-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Syncmatica Protocol
This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica)

diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 68cc14ef2176dd20ede46af3d62ef0797169b87e..507285757ed8c3997748647947b16b7db62ff5f1 100644
index ae7cf2b0a90044e93360fc914573c6a549cb6731..eacc68696f8d78114c7129b390e1a1e915f29223 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -313,6 +313,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand All @@ -17,8 +17,8 @@ index 68cc14ef2176dd20ede46af3d62ef0797169b87e..507285757ed8c3997748647947b16b7d
}

// CraftBukkit start - add fields
@@ -332,6 +333,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private boolean hasMoved; // Spigot
@@ -331,6 +332,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private boolean justTeleported = false;
// CraftBukkit end

+ public final top.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget exchangeTarget; // Leaves - Syncmatica Protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Disable distance check for UseItemOnPacket


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 507285757ed8c3997748647947b16b7db62ff5f1..ab64a28775d3b5b57a103e2bedaf6af30e62bca7 100644
index eacc68696f8d78114c7129b390e1a1e915f29223..6e70d8832ca06367573b0c8066a5d9fe41c0d9cf 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1932,7 +1932,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1936,7 +1936,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Vec3 vec3d2 = vec3d.subtract(vec3d1);
double d0 = 1.0000001D;

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0068-Creative-fly-no-clip.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Creative fly no clip


diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 3e597833b57377b855505b8a0f2744801c791f90..d866f957a0ce59588a5b58cc9a974193048cb3d2 100644
index ccc1caafb0ada52c7b99b7358253826f5390843e..c908ddf5214a6c9a5800fff87f5865b110d24fe1 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -238,8 +238,8 @@ public abstract class Player extends LivingEntity {
Expand Down Expand Up @@ -37,7 +37,7 @@ index 3e597833b57377b855505b8a0f2744801c791f90..d866f957a0ce59588a5b58cc9a974193
AABB axisalignedbb;

if (this.isPassenger() && !this.getVehicle().isRemoved()) {
@@ -2051,6 +2051,12 @@ public abstract class Player extends LivingEntity {
@@ -2067,6 +2067,12 @@ public abstract class Player extends LivingEntity {
@Override
public abstract boolean isSpectator();

Expand Down
6 changes: 3 additions & 3 deletions patches/server/0073-Elytra-aeronautics-no-chunk-load.patch
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ index 24936f6b97a2c42259fcb6a9e914fe1175cce241..2e3061b3874764fa2bde068486fa0c03

SectionPos sectionposition = player.getLastSectionPos();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ab64a28775d3b5b57a103e2bedaf6af30e62bca7..c70597690364e044a0d4231eb2895cc5bf35820a 100644
index 6e70d8832ca06367573b0c8066a5d9fe41c0d9cf..9be579fae145329196c33d2c23c7bbd55470c549 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -543,7 +543,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -549,7 +549,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player

// Paper start - Prevent moving into unloaded chunks
Expand Down Expand Up @@ -85,7 +85,7 @@ index e4ad454fed1d4f615621c7973598f8106f57b5ab..c555922aaf678261fa67403194b3df08
}

diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index d866f957a0ce59588a5b58cc9a974193048cb3d2..fd4be9152fa49b76b2aa9ff79b1eb993582b090a 100644
index c908ddf5214a6c9a5800fff87f5865b110d24fe1..82b73e4080ee8a1883847db378e373bfde7e8e1e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -183,6 +183,7 @@ public abstract class Player extends LivingEntity {
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 e2d54448cc9007e2f056d90b77229a664967789b..0d2ace4bc177ed975b6bf0cbe2e3eb8d691c9c01 100644
index ee85716ac98caa2e63f34be26a48d6b75b0179e3..297d51fada6e89980d0daccdb636dcc3aef3e6cf 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1263,6 +1263,7 @@ public class ServerPlayer extends Player {
@@ -1264,6 +1264,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);
@@ -2076,6 +2077,7 @@ public class ServerPlayer extends Player {
@@ -2077,6 +2078,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
@@ -2322,6 +2324,7 @@ public class ServerPlayer extends Player {
@@ -2323,6 +2325,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
}

}
@@ -2761,6 +2764,7 @@ public class ServerPlayer extends Player {
@@ -2762,6 +2765,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
Loading

0 comments on commit 783ea26

Please sign in to comment.