Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Fix ProtocolLib check (again)
#BlameGerry (again)
Dieser Commit ist enthalten in:
Ursprung
f08db2d234
Commit
965814d833
@ -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);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren