// Patch jsp-raknet to use RakNet protocol version 11 // Newer BDS servers (1.26+) require protocol 11 instead of 10 const fs = require('fs'); const path = require('path'); const clientFile = path.join(__dirname, '..', 'node_modules', 'jsp-raknet', 'js', 'Client.js'); if (fs.existsSync(clientFile)) { let content = fs.readFileSync(clientFile, 'utf8'); if (content.includes('RAKNET_PROTOCOL = 10')) { content = content.replace('RAKNET_PROTOCOL = 10', 'RAKNET_PROTOCOL = 11'); fs.writeFileSync(clientFile, content); console.log('Patched jsp-raknet to RakNet protocol 11'); } else { console.log('jsp-raknet already patched'); } }