3
0
Mirror von https://github.com/Moulberry/AxiomPaperPlugin.git synchronisiert 2024-11-17 05:40:06 +01:00

Normalize compatible data versions

Dieser Commit ist enthalten in:
Moulberry 2024-08-16 03:38:46 +08:00
Ursprung bd63bb6e41
Commit e8179d7647

Datei anzeigen

@ -49,6 +49,13 @@ public class HelloPacketListener implements PluginMessageListener {
}
}
private static int normalizeDataVersion(int dataVersion) {
if (dataVersion == 3955) { // 1.21.1
return 3953; // 1.21
}
return dataVersion;
}
private void process(Player player, byte[] message) {
if (!this.plugin.hasAxiomPermission(player)) {
return;
@ -60,7 +67,7 @@ public class HelloPacketListener implements PluginMessageListener {
// note - skipping NBT here. friendlyByteBuf.readNBT();
int serverDataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
if (dataVersion != serverDataVersion) {
if (normalizeDataVersion(dataVersion) != normalizeDataVersion(serverDataVersion)) {
String incompatibleDataVersion = plugin.configuration.getString("incompatible-data-version");
if (incompatibleDataVersion == null) incompatibleDataVersion = "warn";