--- a/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
@@ -22,6 +_,21 @@
         ClientboundContainerSetContentPacket::new
     );
 
+    // Paper start - Handle large packets disconnecting client
+    @Override
+    public boolean hasLargePacketFallback() {
+        return true;
+    }
+
+    @Override
+    public boolean packetTooLarge(net.minecraft.network.Connection manager) {
+        for (int i = 0 ; i < this.items.size() ; i++) {
+            manager.send(new ClientboundContainerSetSlotPacket(this.containerId, this.stateId, i, this.items.get(i)));
+        }
+        return true;
+    }
+    // Paper end - Handle large packets disconnecting client
+
     @Override
     public PacketType<ClientboundContainerSetContentPacket> type() {
         return GamePacketTypes.CLIENTBOUND_CONTAINER_SET_CONTENT;
