mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-25 11:35:18 +01:00
Merge branch 'master' into dev
This commit is contained in:
commit
f35c48bed2
@ -52,7 +52,6 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
|
||||
|
||||
// Init platform
|
||||
BukkitViaInjector injector = new BukkitViaInjector();
|
||||
injector.setProtocolLib(Bukkit.getPluginManager().getPlugin("ProtocolLib") != null);
|
||||
|
||||
Via.init(ViaManager.builder()
|
||||
.platform(this)
|
||||
@ -78,6 +77,10 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Via should load before PL, so we can't check for it in the constructor
|
||||
boolean hasProtocolLib = Bukkit.getPluginManager().getPlugin("ProtocolLib") != null;
|
||||
((BukkitViaInjector) Via.getManager().getInjector()).setProtocolLib(hasProtocolLib);
|
||||
|
||||
// Spigot detector
|
||||
try {
|
||||
Class.forName("org.spigotmc.SpigotConfig");
|
||||
|
@ -11,6 +11,7 @@ public class ProtocolLibEnableListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPluginEnable(PluginEnableEvent e) {
|
||||
// Will likely never happen, but try to account for hacky plugin loading systems anyways
|
||||
if (e.getPlugin().getName().equals("ProtocolLib")) {
|
||||
((BukkitViaInjector) Via.getManager().getInjector()).setProtocolLib(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user