mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-25 12:45:35 +01:00
Support Folia (leaf's region threaded Minecraft server)
This commit is contained in:
parent
f7acb7ce91
commit
4293289468
@ -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()) {
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user