mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Merge pull request #715 from Smart123s/fix/bukkit/noplibload
Fix plugin start without ProtocolLib installed
This commit is contained in:
@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bukkit;
|
package com.github.games647.fastlogin.bukkit;
|
||||||
|
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
|
||||||
import com.github.games647.fastlogin.bukkit.command.CrackedCommand;
|
import com.github.games647.fastlogin.bukkit.command.CrackedCommand;
|
||||||
import com.github.games647.fastlogin.bukkit.command.PremiumCommand;
|
import com.github.games647.fastlogin.bukkit.command.PremiumCommand;
|
||||||
import com.github.games647.fastlogin.bukkit.listener.ConnectionListener;
|
import com.github.games647.fastlogin.bukkit.listener.ConnectionListener;
|
||||||
@ -121,7 +120,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
|
|
||||||
if (isPluginInstalled("floodgate")) {
|
if (isPluginInstalled("floodgate")) {
|
||||||
if (getConfig().getBoolean("floodgatePrefixWorkaround")){
|
if (getConfig().getBoolean("floodgatePrefixWorkaround")){
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(new ManualNameChange(this, floodgateService));
|
ManualNameChange.register(this, floodgateService);
|
||||||
logger.info("Floodgate prefix injection workaround has been enabled.");
|
logger.info("Floodgate prefix injection workaround has been enabled.");
|
||||||
logger.info("If you have problems joining the server, try disabling it in the configuration.");
|
logger.info("If you have problems joining the server, try disabling it in the configuration.");
|
||||||
} else {
|
} else {
|
||||||
|
@ -36,6 +36,8 @@ import org.geysermc.floodgate.api.FloodgateApi;
|
|||||||
|
|
||||||
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
||||||
|
|
||||||
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manually inject Floodgate player name prefixes.
|
* Manually inject Floodgate player name prefixes.
|
||||||
* <br>
|
* <br>
|
||||||
@ -57,6 +59,14 @@ public class ManualNameChange extends PacketAdapter {
|
|||||||
this.floodgate = floodgate;
|
this.floodgate = floodgate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void register(FastLoginBukkit plugin, FloodgateService floodgate) {
|
||||||
|
// they will be created with a static builder, because otherwise it will throw a NoClassDefFoundError
|
||||||
|
ProtocolLibrary.getProtocolManager()
|
||||||
|
.getAsynchronousManager()
|
||||||
|
.registerAsyncHandler(new ManualNameChange(plugin, floodgate))
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPacketReceiving(PacketEvent packetEvent) {
|
public void onPacketReceiving(PacketEvent packetEvent) {
|
||||||
PacketContainer packet = packetEvent.getPacket();
|
PacketContainer packet = packetEvent.getPacket();
|
||||||
|
Reference in New Issue
Block a user