Skip to content

Commit

Permalink
Updated Upstream (Paper/Gale)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@aebbdc9 Add proper async player disconnections

Gale Changes:
Dreeam-qwq/Gale@de0aa14 Updated Upstream (Paper)
  • Loading branch information
Dreeam-qwq committed Oct 17, 2024
1 parent 9df5b5f commit 1fb19fc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 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.21.1
version = 1.21.1-R0.1-SNAPSHOT

galeCommit = a235416736a0171984aacffcf646921cac5f2092
galeCommit = de0aa14db86e17ee7c621a5b236c88522cc13425

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
10 changes: 5 additions & 5 deletions patches/server/0011-Purpur-Server-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ index 44b79a7c2f8b95a484d1999fa2167ce588f7985b..68632372c8704058f35f12e0ae6cdd98
// Paper end - Add drops to shear events
continue;
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index ee4172ab8a0df871f509aeaee8d32f325c148fee..9691bba7715e8fca6be69f883b4940c5447d4df5 100644
index 71bcc4c69ea4bf12eed7b3238c7703b9cdbc159e..652c25272832cf80fbd05eb7ac1090246e8cc638 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -617,11 +617,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
Expand Down Expand Up @@ -1505,7 +1505,7 @@ index ee9e4521079137d7b72194e8789810e7a89b8e75..28731f0c5b0ba63fa8d5ce3ee580bf31
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 8847873e5fc1fdf272d3acb84289a54efaa62b64..51c8d265f6c40b872efd7e03dccd162a52edff09 100644
index c8d4d1591628f3ea337a853148e172667cc5c744..c595e2011a00e5344dfdce231b5fd50c084cd9e4 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -92,6 +92,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
Expand All @@ -1516,7 +1516,7 @@ index 8847873e5fc1fdf272d3acb84289a54efaa62b64..51c8d265f6c40b872efd7e03dccd162a

public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
this.server = minecraftserver;
@@ -195,6 +196,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -191,6 +192,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
this.disconnect(Component.literal("Invalid payload REGISTER!"), PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
}
Expand All @@ -1531,7 +1531,7 @@ index 8847873e5fc1fdf272d3acb84289a54efaa62b64..51c8d265f6c40b872efd7e03dccd162a
try {
String channels = payload.toString(com.google.common.base.Charsets.UTF_8);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index fb8d5235c261c6128091e55141971e7e3e6ba671..d0710590478b8e8036eb2710ce7a976d2d96f3a5 100644
index 184b4d7e8badf8a3bd99f8884ebef2af5bea3bfa..f4ef13d69347896fe797f5a5bf1749ce9b0c5726 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -337,6 +337,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down Expand Up @@ -1603,7 +1603,7 @@ index fb8d5235c261c6128091e55141971e7e3e6ba671..d0710590478b8e8036eb2710ce7a976d
- ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
+ ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send too large of a book. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
+ org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent event = new org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), itemstack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
return;
}
@@ -1224,10 +1252,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down
13 changes: 13 additions & 0 deletions patches/server/0012-Fix-Pufferfish-and-Purpur-patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ index fd285a768218ec56f4fdf58e17c7dbafa6426470..d2cbf34389a1b56c442c6ce08f55f117
// CraftBukkit start
j = this.levelData.getDayTime() + 24000L;
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime());
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f4ef13d69347896fe797f5a5bf1749ce9b0c5726..a101ac0710731e3070799b96f13c7e216cc52e93 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1226,7 +1226,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}

if (byteTotal > byteAllowed) {
- ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send too large of a book. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
+ ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent event = new org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), itemstack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
return;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b652bfd4aea7eca7eebc0265a518956eac8b7e73..39be345524b621e6ae2eec9af9d46da3291c671b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0030-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ index 59797b01bf0f8dd38b0b57179a7bec0e39f17d6f..7adc85c53991f7b144c44b77431d83ea
((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 51c8d265f6c40b872efd7e03dccd162a52edff09..648a342c309c12dedf7d70b88163f80fb72150cf 100644
index c595e2011a00e5344dfdce231b5fd50c084cd9e4..2e2caf1c92cd3616fe40a0cadd5e91f1ebae382d 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -174,6 +174,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -170,6 +170,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
Expand All @@ -77,7 +77,7 @@ index 51c8d265f6c40b872efd7e03dccd162a52edff09..648a342c309c12dedf7d70b88163f80f
// Paper start - Brand support
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload brandPayload) {
this.player.clientBrandName = brandPayload.brand();
@@ -191,6 +196,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -187,6 +192,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
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ index 9fab5cb1ea35766d12a826569b900245695ee597..f7489e3f606e564c757f395201230f88

// Paper start - Add setting for proxy online mode status
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 648a342c309c12dedf7d70b88163f80fb72150cf..b8b2914543f4bfe71a9734e3d848fba0acd707fc 100644
index 2e2caf1c92cd3616fe40a0cadd5e91f1ebae382d..cf02a980f0110ec9e1277bda846c67b9c6b67f8a 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -342,10 +342,29 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -338,10 +338,29 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}

public void send(Packet<?> packet) {
Expand Down

0 comments on commit 1fb19fc

Please sign in to comment.