Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +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
|
// Init platform
|
||||||
BukkitViaInjector injector = new BukkitViaInjector();
|
BukkitViaInjector injector = new BukkitViaInjector();
|
||||||
injector.setProtocolLib(Bukkit.getPluginManager().getPlugin("ProtocolLib") != null);
|
|
||||||
|
|
||||||
Via.init(ViaManager.builder()
|
Via.init(ViaManager.builder()
|
||||||
.platform(this)
|
.platform(this)
|
||||||
@ -78,6 +77,10 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
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
|
// Spigot detector
|
||||||
try {
|
try {
|
||||||
Class.forName("org.spigotmc.SpigotConfig");
|
Class.forName("org.spigotmc.SpigotConfig");
|
||||||
|
@ -11,6 +11,7 @@ public class ProtocolLibEnableListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPluginEnable(PluginEnableEvent e) {
|
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")) {
|
if (e.getPlugin().getName().equals("ProtocolLib")) {
|
||||||
((BukkitViaInjector) Via.getManager().getInjector()).setProtocolLib(true);
|
((BukkitViaInjector) Via.getManager().getInjector()).setProtocolLib(true);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren