4.6.1 Release

This commit is contained in:
Nassim Jahnke 2023-03-16 20:45:16 +01:00
parent 11e71b1307
commit efded25594
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 5 additions and 7 deletions

View File

@ -5,7 +5,7 @@ plugins {
allprojects {
group = "com.viaversion"
version = "4.6.1-SNAPSHOT"
version = "4.6.1"
description = "Allow older clients to join newer server versions."
}

View File

@ -25,7 +25,6 @@ import com.viaversion.viabackwards.listener.LecternInteractListener;
import com.viaversion.viabackwards.listener.PlayerItemDropListener;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.bukkit.platform.BukkitViaLoader;
import org.bukkit.plugin.java.JavaPlugin;
public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform {
@ -45,19 +44,18 @@ public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform {
}
private void enable() {
BukkitViaLoader loader = (BukkitViaLoader) Via.getManager().getLoader();
int protocolVersion = Via.getAPI().getServerVersion().highestSupportedVersion();
if (protocolVersion >= ProtocolVersion.v1_17.getVersion()) {
loader.storeListener(new PlayerItemDropListener(this)).register();
new PlayerItemDropListener(this).register();
}
if (protocolVersion >= ProtocolVersion.v1_16.getVersion()) {
loader.storeListener(new FireExtinguishListener(this)).register();
new FireExtinguishListener(this).register();
}
if (protocolVersion >= ProtocolVersion.v1_14.getVersion()) {
loader.storeListener(new LecternInteractListener(this)).register();
new LecternInteractListener(this).register();
}
if (protocolVersion >= ProtocolVersion.v1_12.getVersion()) {
loader.storeListener(new FireDamageListener(this)).register();
new FireDamageListener(this).register();
}
}