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 18, 2024
1 parent b33c46c commit f830919
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group=org.leavesmc.leaves
version=1.21.1-R0.1-SNAPSHOT
mcVersion=1.21.1
paperRef=57c75a4b67a8b3b3c607126130b7503658b5e98a
paperRef=755a7753af6ad46756bd04b5b3bcfac46a3ec072
preVersion=false
updatingMinecraft=false
org.gradle.jvmargs=-Xmx2G
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0007-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ index 4464ce6ff4fd8eb9570205c7326c9a47b67d634d..7baa336edec37d8ca1d63f71b25d0daf
((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 6998f32f8d79dbdb6b31ffaa126602fc4a428616..7bcadf3b793fd4c5d58e0e3e01a373b2e1a7a628 100644
index 7174f8c89a7cdcf40ff28f6636ecfb23b13ccdaa..7adef76ecc246b131cee35cf00c3c05bd75d5504 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -154,6 +154,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -150,6 +150,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
Expand All @@ -75,7 +75,7 @@ index 6998f32f8d79dbdb6b31ffaa126602fc4a428616..7bcadf3b793fd4c5d58e0e3e01a373b2
// Paper start - Brand support
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload brandPayload) {
this.player.clientBrandName = brandPayload.brand();
@@ -171,6 +176,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -167,6 +172,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 All @@ -84,7 +84,7 @@ index 6998f32f8d79dbdb6b31ffaa126602fc4a428616..7bcadf3b793fd4c5d58e0e3e01a373b2
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9bb0dde8c3e6b3d17b3798a408658a8ffefd831f..e6a1942d44c589d6815824646b5517a5938385c3 100644
index 79237a490d7572eae95384f32e0ebc1a0a005c00..d0190f633e99e2a5b5dc130def10c562ffc4e52e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -349,6 +349,8 @@ public abstract class PlayerList {
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 @@ -120,10 +120,10 @@ index 4ac40259f31f3deef6b5fe4456576bbd44cc2569..e45acea31d61462c877c902b238209f1
}

diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 7bcadf3b793fd4c5d58e0e3e01a373b2e1a7a628..427dede2feca3350c45c4e70fe8efcbb2e6525c3 100644
index 7adef76ecc246b131cee35cf00c3c05bd75d5504..7bc847d7475de6cca22e587fdb9999563bbce14d 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -301,10 +301,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -297,10 +297,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}

public void send(Packet<?> packet) {
Expand Down
16 changes: 8 additions & 8 deletions patches/server/0080-Reduce-array-allocations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ index ff13d67151c50ea11a45117e524c7524e2b1a202..8c3ee4c9aa22bcc46f2dc3a5bc35bdde

@Override
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 46d9c77581b78c427692aa8645d17b3d0c2bb6a6..2452bd38f9efecc6c163b935f81a3b9dcd38f169 100644
index b19298aeaa0dacfe1afb1e672bd30b0c069ec968..8b6304160a6a3ca4c30f1ab75802a9d318d7d7c6 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -66,6 +66,7 @@ import org.apache.commons.lang3.Validate;
Expand All @@ -218,7 +218,7 @@ index 0846e11c82295ccf93683f877962ec7804dad677..b747b3858befe48996ea707cf126f6f8

for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 618ff4d64d5bbebe5b73a575ec52ee17a4392c42..ede3a1466b411b331a837f423ef48a925bf7e44e 100644
index f494ea2671f219ce02c53ad725cc41646558a4c4..fc7ce6a031c50d270a979ec57e05cec0de7426c2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -181,6 +181,7 @@ import org.bukkit.event.server.MapInitializeEvent;
Expand All @@ -230,7 +230,7 @@ index 618ff4d64d5bbebe5b73a575ec52ee17a4392c42..ede3a1466b411b331a837f423ef48a92
public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel, ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevelReader { // 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 96594a76f4c6756214feec62f8e3ecb656493ae6..2e08a927f9c3c4a4cfcad16b7a835b80efefdfca 100644
index bc3b8de51def54996cfe8e7a612f382df0b060e1..17b5d93e4d822d0b815594c18884f5349abbef19 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -249,6 +249,7 @@ import org.bukkit.inventory.EquipmentSlot;
Expand All @@ -245,8 +245,8 @@ index 96594a76f4c6756214feec62f8e3ecb656493ae6..2e08a927f9c3c4a4cfcad16b7a835b80
// Paper start
final int index;
if (packet.getCommand().length() > 64 && ((index = packet.getCommand().indexOf(' ')) == -1 || index >= 64)) {
- this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM);
+ this.disconnect(Component.translatable("disconnect.spam", ArrayConstants.emptyObjectArray), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Leaves - reduce array allocations
- this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - add proper async disconnect
+ this.disconnectAsync(Component.translatable("disconnect.spam", ArrayConstants.emptyObjectArray), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - add proper async disconnect // Leaves - reduce array allocations
return;
}
// Paper end
Expand Down Expand Up @@ -287,7 +287,7 @@ index 40638b439966619e9c70a18a32abd95b2178fe9f..153e918f1059bb09ad074eb06bbdbbdc
final String s;

diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0ba56ea6ca96cd7adb47dad756c8ed2972a2d587..875f88b62d62cc94b1ec09f9cedefc2722ddb5cc 100644
index e62a27431bb2872bdf7dcc34366249dbfe8add17..3322ee4e6720c8b06e6d6684cbac95c2d14babb1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -950,13 +950,9 @@ public abstract class PlayerList {
Expand Down Expand Up @@ -357,7 +357,7 @@ index 2fa2a4eef21e786f738f36616c3160defa95bce8..36c98f611f043ebadffd1b110ba3002b
private EquipmentSlot(final EquipmentSlot.Type type, final int entityId, final int maxCount, final int armorStandId, final String name) {
this.type = type;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ec5ac957bd463496a1d82e22db10be7d1b2de2dd..6d6bca222e5c9d676fc5416fb7f14036f0d87deb 100644
index 567ceb290d91ce6291202e03496d455503ba59c5..28b6689421b311c5aa975c1f9e3deca9ce76d688 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3280,7 +3280,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
Expand Down Expand Up @@ -422,7 +422,7 @@ index 1bf54b0142fe41b29b21c8b97d3f52bb24a36a92..f19ace4f9027260ded3ee37c1bda91c5
public class ShapedRecipe extends io.papermc.paper.inventory.recipe.RecipeBookExactChoiceRecipe<CraftingInput> implements CraftingRecipe { // Paper - improve exact recipe choices

diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 1f6e6bba0f6d16091f4c6a5fdb4bac4579ba525f..1848ed1dff8327db5c9a01e8e2019997e927692c 100644
index 9a6a2acec1bf11282d1451f5d5178e41fab91b39..5452a15b8a082337c9e53a004e93d8058f6a0474 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -102,6 +102,7 @@ import org.bukkit.craftbukkit.util.CraftSpawnCategory;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0090-Avoid-anvil-too-expensive.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Avoid anvil too expensive


diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
index d685511104ac552dfc9ae2111e1bfb60fa812102..f80e09d3105405ecc3c877d389633583e94690f1 100644
index 362278407679f245ebcea778f2199b357339e1fe..6f5a9ce4bf378f414887b93cb38a4d9b70e7b91f 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -280,7 +280,7 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -281,7 +281,7 @@ public class AnvilMenu extends ItemCombinerMenu {
this.cost.set(this.maximumRepairCost - 1); // CraftBukkit
}

Expand Down

0 comments on commit f830919

Please sign in to comment.