Add ProxyReloadEvent

This commit is contained in:
kamcio96 2014-02-28 22:44:48 +01:00 committed by md_5
parent 924dcaab38
commit 9cd7c1ac03
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package net.md_5.bungee.api.event;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.EqualsAndHashCode;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Event;
/**
* Called when somebody reloads BungeeCord
*/
@Getter
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class ProxyReloadEvent extends Event
{
/**
* Creator of the action.
*/
private final CommandSender sender;
}

View File

@ -4,6 +4,7 @@ import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Command;
import net.md_5.bungee.api.event.ProxyReloadEvent;
public class CommandReload extends Command
{
@ -19,6 +20,8 @@ public class CommandReload extends Command
BungeeCord.getInstance().config.load();
BungeeCord.getInstance().stopListeners();
BungeeCord.getInstance().startListeners();
BungeeCord.getInstance().getPluginManager().callEvent(new ProxyReloadEvent(sender));
sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "BungeeCord has been reloaded."
+ " This is NOT advisable and you will not be supported with any issues that arise! Please restart BungeeCord ASAP." );
}