Add ProxyReloadEvent
This commit is contained in:
parent
924dcaab38
commit
9cd7c1ac03
@ -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;
|
||||||
|
}
|
@ -4,6 +4,7 @@ import net.md_5.bungee.BungeeCord;
|
|||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
import net.md_5.bungee.api.plugin.Command;
|
||||||
|
import net.md_5.bungee.api.event.ProxyReloadEvent;
|
||||||
|
|
||||||
public class CommandReload extends Command
|
public class CommandReload extends Command
|
||||||
{
|
{
|
||||||
@ -19,6 +20,8 @@ public class CommandReload extends Command
|
|||||||
BungeeCord.getInstance().config.load();
|
BungeeCord.getInstance().config.load();
|
||||||
BungeeCord.getInstance().stopListeners();
|
BungeeCord.getInstance().stopListeners();
|
||||||
BungeeCord.getInstance().startListeners();
|
BungeeCord.getInstance().startListeners();
|
||||||
|
BungeeCord.getInstance().getPluginManager().callEvent(new ProxyReloadEvent(sender));
|
||||||
|
|
||||||
sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "BungeeCord has been reloaded."
|
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." );
|
+ " This is NOT advisable and you will not be supported with any issues that arise! Please restart BungeeCord ASAP." );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user