1
0
Fork 0
NativeBot/src/main/java/ren/taske/nativebot/bot/listener/ServerLoadEventListener.java

32 lines
866 B
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package ren.taske.nativebot.bot.listener;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerLoadEvent;
import org.bukkit.event.server.ServerLoadEvent.LoadType;
import ren.taske.nativebot.NativeBotPlugin;
public class ServerLoadEventListener implements Listener {
@EventHandler
public void onServerLoad(ServerLoadEvent evt) {
LoadType type = evt.getType();
if(type == LoadType.STARTUP) {
NativeBotPlugin.nativebotJavaPlugin.getBot().start();
}
if(type == LoadType.RELOAD) {
Bukkit.getServer().shutdown();
System.err.println("Don't try to reload NativeBot");
System.err.println("NativeBot CANNOT support reloading.");
System.err.println("不要尝试重载NativeBot这个插件不能重载");
}
}
}