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 7bf2e0e4cf
Commit 257f30b868

Datei anzeigen

@ -51,6 +51,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;
@ -62,7 +69,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";