Skip to content

Commit

Permalink
Updated Upstream (Paper)
Browse files Browse the repository at this point in the history
Updated to latest Paper 1.20.6 branch, unlike Leaf 1.20.4, this upstream update didn't include backport from latest Gale branch, we recommend to use Leaf 1.21.1
  • Loading branch information
Dreeam-qwq committed Nov 1, 2024
1 parent f0e36a8 commit becd099
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 63 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group = cn.dreeam.leaf
mcVersion = 1.20.6
version = 1.20.6-R0.1-SNAPSHOT

galeCommit = f01910e3bd510a5a1fa4561fee96434b4d4b45da
galeCommit = b325756ee34f87acef908d527f544c0bfe01dd3a

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
8 changes: 4 additions & 4 deletions patches/api/0004-Purpur-API-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -905,13 +905,13 @@ index bcc6ba95bd21c7972865838c636a03f50b6c1f1a..c3fcd8dd7dbb1e1a18e17c014c1e6411
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 5c29956c6db53440322330ff723c7087193641f1..544b1d8aa5665fd2567605014adee6222d2cb312 100644
index a1e54e9d14393a6c0ea57cca854071c5396d9717..150d2a6fe437ef142fb16ff3b7bacd20f95b928e 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1447,4 +1447,27 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1458,4 +1458,27 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setBodyYaw(float bodyYaw);
// Paper end - body yaw API
boolean canUseEquipmentSlot(org.bukkit.inventory.@NotNull EquipmentSlot slot);
// Paper end - Expose canUseSlot
+
+ // Purpur start
+ /**
Expand Down
79 changes: 37 additions & 42 deletions patches/server/0011-Purpur-Server-Changes.patch

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This Check is added in 1.17.x -> 1.18.x that updated by Mojang.
By removing this check, it gives ability for hackers to use some modules of hack clients.

diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c53e01260b4ca6f637b3d55798cda4cab822b5fe..d107cd93a6d43f060a7bcfc4a3ee0c82c51bc9b9 100644
index 59c67ce370c8c1a14631e268ade4291d3a365b11..4429c37cae6cb1550532dde78db66024f575739f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2008,7 +2008,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2005,7 +2005,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Vec3 vec3d1 = vec3d.subtract(Vec3.atCenterOf(blockposition));
double d0 = 1.0000001D;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Original project: https://github.com/LeavesMC/Leaves
Commit: e234432bd99e1c4b07c24d1dd247977226a7516a

diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2461fdfe02dc2252178e442f54ef4f584ba75cf8..a0abb0182aa6166b1d2702aa9964132889dc9d86 100644
index 4429c37cae6cb1550532dde78db66024f575739f..2e0d0270785e1f04a7b9f21011620541fb81ea1b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -589,7 +589,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand All @@ -30,7 +30,7 @@ index 2461fdfe02dc2252178e442f54ef4f584ba75cf8..a0abb0182aa6166b1d2702aa99641328
flag2 = true; // Paper - diff on change, this should be moved wrongly
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)});
}
@@ -1486,7 +1486,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1483,7 +1483,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
toX, toY, toZ, toYaw, toPitch, true);
if (!event.isAllowed()) {
Expand All @@ -39,7 +39,7 @@ index 2461fdfe02dc2252178e442f54ef4f584ba75cf8..a0abb0182aa6166b1d2702aa99641328
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
return;
@@ -1556,7 +1556,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1553,7 +1553,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean movedWrongly = false; // Paper - Add fail move event; rename

Expand Down
8 changes: 4 additions & 4 deletions patches/server/0067-Improve-Purpur-AFK-system.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AFK command & command cooldown
AFK title message

diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 95c84e0f83d056ee080061cd495c95a328814469..a5784aa215522c4666139a8eac3711c966cc7cb1 100644
index f00005b10a6f01e6244defcdffe8e147381ccee1..90f9c365ff84ad401d2b40a48cb09f2c424cf18c 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -250,6 +250,7 @@ public class Commands {
Expand Down Expand Up @@ -53,10 +53,10 @@ index 9b97d5ca67c0e53f318a54465708e21ae906e994..2a76960ebd0270ab5a6f850dc7b0b1a6
} else {
getBukkitEntity().setPlayerListName(prefix + scoreboardName + suffix, true);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a0abb0182aa6166b1d2702aa9964132889dc9d86..6f38bd7a7c6e7bb8ade7b79756ab0afded6add99 100644
index 2e0d0270785e1f04a7b9f21011620541fb81ea1b..00005518d555aef1940919a9b7894adca04b4fea 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2254,8 +2254,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2251,8 +2251,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}

Expand Down Expand Up @@ -86,7 +86,7 @@ index a0abb0182aa6166b1d2702aa9964132889dc9d86..6f38bd7a7c6e7bb8ade7b79756ab0afd
// CraftBukkit start - SPIGOT-7346: Prevent disconnected players from executing commands
if (this.player.hasDisconnected()) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b87fa81ccee6792b3a202b2c193299dbd2cce112..471933d0e676f600233c7c726c22b866bd4b2f57 100644
index ff734686a781fe8b6cfc4c81ec53c2afffbdce69..d4aafae19aeab8f79a4b575eab35967de4b9719b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -623,6 +623,7 @@ public abstract class PlayerList {
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0070-Block-log4j-rce-exploit-in-chat.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Block log4j rce exploit in chat


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 6f38bd7a7c6e7bb8ade7b79756ab0afded6add99..9546f79db7ab0a247cc658640e861e96eb1c0ace 100644
index 00005518d555aef1940919a9b7894adca04b4fea..f41c6154c134fd6354b25e3f76458b565924af11 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2438,6 +2438,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2435,6 +2435,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}

private void tryHandleChat(String s, Runnable runnable, boolean sync) { // CraftBukkit
Expand All @@ -17,7 +17,7 @@ index 6f38bd7a7c6e7bb8ade7b79756ab0afded6add99..9546f79db7ab0a247cc658640e861e96
if (ServerGamePacketListenerImpl.isChatMessageIllegal(s)) {
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
@@ -2469,6 +2471,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2466,6 +2468,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}

Expand All @@ -34,7 +34,7 @@ index 6f38bd7a7c6e7bb8ade7b79756ab0afded6add99..9546f79db7ab0a247cc658640e861e96
for (int i = 0; i < message.length(); ++i) {
if (!StringUtil.isAllowedChatCharacter(message.charAt(i))) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 547bb44769e3cf23cd0fee669d335c37ff15aa92..14678f175a02592db1305584d36421e20e6263d8 100644
index 0d2803a094b48fe864d59c342cc65f480ce747c3..8fbddb424946d8197c3b3cbcf5ea4e00d39232e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -751,6 +751,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0081-Configurable-connection-message.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection message


diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e7f83ed096257ad8906b3398a7bcb80a787dfa5a..7c8e9c3c00d7941f2a87b7175ffe2281f31da205 100644
index 3fcd4d93112c22717aedee2e1121d4e795d6e93a..4b9d630a9b844714e9d9b2355a72d5cb7e7d6f03 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -28,6 +28,7 @@ import java.util.function.Predicate;
Expand Down Expand Up @@ -38,8 +38,8 @@ index e7f83ed096257ad8906b3398a7bcb80a787dfa5a..7c8e9c3c00d7941f2a87b7175ffe2281
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason
}

- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & Add API for quit reason
+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), getQuitMsg(net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.getBukkitEntity()), entityplayer.quitReason); // Paper - Adventure & Add API for quit reason // Leaf - Configurable connection message - quit message
- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), leaveMessage, entityplayer.quitReason); // Paper - Adventure & Add API for quit reason
+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), getQuitMsg(leaveMessage, entityplayer.getBukkitEntity()), entityplayer.quitReason); // Paper - Adventure & Add API for quit reason // Leaf - Configurable connection message - quit message
this.cserver.getPluginManager().callEvent(playerQuitEvent);
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());

Expand Down

0 comments on commit becd099

Please sign in to comment.