3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-17 05:20:10 +01:00

Support Folia (leaf's region threaded Minecraft server)

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-03-10 12:19:22 +01:00
Ursprung f7acb7ce91
Commit 4293289468
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
2 geänderte Dateien mit 3 neuen und 21 gelöschten Zeilen

Datei anzeigen

@ -19,13 +19,11 @@
package com.viaversion.viabackwards;
import com.viaversion.viabackwards.api.ViaBackwardsPlatform;
import com.viaversion.viabackwards.listener.PlayerItemDropListener;
import com.viaversion.viabackwards.listener.FireDamageListener;
import com.viaversion.viabackwards.listener.FireExtinguishListener;
import com.viaversion.viabackwards.listener.LecternInteractListener;
import com.viaversion.viaversion.ViaVersionPlugin;
import com.viaversion.viabackwards.listener.PlayerItemDropListener;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.bukkit.platform.BukkitViaLoader;
import org.bukkit.plugin.java.JavaPlugin;
@ -33,28 +31,11 @@ import org.bukkit.plugin.java.JavaPlugin;
public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform {
public BukkitPlugin() {
}
@Override
public void onLoad() {
if (!ViaVersionPlugin.getInstance().isLateBind()) {
init();
}
Via.getManager().addEnableListener(() -> init(getDataFolder()));
}
@Override
public void onEnable() {
if (ViaVersionPlugin.getInstance().isLateBind()) {
init();
}
}
private void init() {
init(getDataFolder());
Via.getPlatform().runSync(this::onServerLoaded);
}
private void onServerLoaded() {
BukkitViaLoader loader = (BukkitViaLoader) Via.getManager().getLoader();
int protocolVersion = Via.getAPI().getServerVersion().highestSupportedVersion();
if (protocolVersion >= ProtocolVersion.v1_17.getVersion()) {

Datei anzeigen

@ -3,6 +3,7 @@ version: ${version}
description: Allow older Minecraft versions to connect to a newer server version.
main: com.viaversion.viabackwards.BukkitPlugin
api-version: 1.13
folia-supported: true
authors: [Matsv, kennytv, Gerrygames, creeper123123321, ForceUpdate1]
website: ${url}