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:
Ursprung
52282f513d
Commit
adfea4bbc8
@ -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) {
|
private void process(Player player, byte[] message) {
|
||||||
if (!this.plugin.hasAxiomPermission(player)) {
|
if (!this.plugin.hasAxiomPermission(player)) {
|
||||||
return;
|
return;
|
||||||
@ -60,7 +67,7 @@ public class HelloPacketListener implements PluginMessageListener {
|
|||||||
// note - skipping NBT here. friendlyByteBuf.readNBT();
|
// note - skipping NBT here. friendlyByteBuf.readNBT();
|
||||||
|
|
||||||
int serverDataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
|
int serverDataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
|
||||||
if (dataVersion != serverDataVersion) {
|
if (normalizeDataVersion(dataVersion) != normalizeDataVersion(serverDataVersion)) {
|
||||||
String incompatibleDataVersion = plugin.configuration.getString("incompatible-data-version");
|
String incompatibleDataVersion = plugin.configuration.getString("incompatible-data-version");
|
||||||
if (incompatibleDataVersion == null) incompatibleDataVersion = "warn";
|
if (incompatibleDataVersion == null) incompatibleDataVersion = "warn";
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren