Merge branch 'master' into dev

This commit is contained in:
KennyTV 2020-12-09 21:39:13 +01:00
commit f35c48bed2
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 5 additions and 1 deletions

View File

@ -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");

View File

@ -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);
}