forked from SteamWar/SteamWar
Improve softreload
This commit is contained in:
@@ -45,6 +45,7 @@ import de.steamwar.velocitycore.commands.ServerSwitchCommand;
|
||||
import de.steamwar.velocitycore.commands.TeamCommand;
|
||||
import de.steamwar.velocitycore.discord.DiscordBot;
|
||||
import de.steamwar.velocitycore.discord.DiscordConfig;
|
||||
import de.steamwar.velocitycore.listeners.BasicListener;
|
||||
import de.steamwar.velocitycore.listeners.PollSystem;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
@@ -171,6 +172,16 @@ public class VelocityCore implements ReloadablePlugin {
|
||||
((PacketHandler) any).register();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void unlinkObject(Object any) {
|
||||
if (any instanceof PacketHandler) {
|
||||
((PacketHandler) any).unregister();
|
||||
}
|
||||
if (any instanceof BasicListener) {
|
||||
VelocityCore.getProxy().getEventManager().unregisterListener(instance, any);
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
linker.link();
|
||||
|
||||
Reference in New Issue
Block a user