Class BungeecordDispatcher
- java.lang.Object
-
- com.alessiodp.core.common.messaging.bungee.BungeecordDispatcher
-
public abstract class BungeecordDispatcher extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ADPPluginpluginprotected booleanregisteredprotected booleansendToBungeeCordprotected booleansendToMainprotected booleansendToSub
-
Constructor Summary
Constructors Constructor Description BungeecordDispatcher(@NotNull ADPPlugin plugin, boolean sendToMain, boolean sendToSub, boolean sendToBungeeCord)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidregister()Register dispatcherprotected abstract voidregisterChannel(@NotNull MessageChannel channel)Register a messaging channelbooleansendForwardPacket(@NotNull ADPPacket packet)Send a forward packet that will be dispatched to every server.abstract booleansendForwardPacket(@NotNull ADPPacket packet, boolean log)Send a forward packet that will be dispatched to every server.booleansendPacket(@NotNull ADPPacket packet, @NotNull MessageChannel channel)Send a packetabstract booleansendPacket(@NotNull ADPPacket packet, @NotNull MessageChannel channel, boolean log)Send a packetbooleansendPacketToUser(@NotNull ADPPacket packet, @NotNull User user, @NotNull MessageChannel channel)Send a packetabstract booleansendPacketToUser(@NotNull ADPPacket packet, @NotNull User user, @NotNull MessageChannel channel, boolean log)Send a packetvoidunregister()Unregister dispatcherprotected abstract voidunregisterChannel(@NotNull MessageChannel channel)Unregister a messaging channel
-
-
-
Field Detail
-
plugin
protected final ADPPlugin plugin
-
sendToMain
protected final boolean sendToMain
-
sendToSub
protected final boolean sendToSub
-
sendToBungeeCord
protected final boolean sendToBungeeCord
-
registered
protected boolean registered
-
-
Constructor Detail
-
BungeecordDispatcher
public BungeecordDispatcher(@NotNull @NotNull ADPPlugin plugin, boolean sendToMain, boolean sendToSub, boolean sendToBungeeCord)
-
-
Method Detail
-
register
public void register()
Register dispatcher
-
unregister
public void unregister()
Unregister dispatcher
-
registerChannel
protected abstract void registerChannel(@NotNull @NotNull MessageChannel channel)Register a messaging channel- Parameters:
channel- the channel to register
-
unregisterChannel
protected abstract void unregisterChannel(@NotNull @NotNull MessageChannel channel)Unregister a messaging channel- Parameters:
channel- the channel to unregister
-
sendPacket
public boolean sendPacket(@NotNull @NotNull ADPPacket packet, @NotNull @NotNull MessageChannel channel)Send a packet- Parameters:
packet- the packet to sendchannel- the channel to use- Returns:
- true if sent successfully
-
sendPacket
public abstract boolean sendPacket(@NotNull @NotNull ADPPacket packet, @NotNull @NotNull MessageChannel channel, boolean log)Send a packet- Parameters:
packet- the packet to sendchannel- the channel to uselog- enable debug logs- Returns:
- true if sent successfully
-
sendPacketToUser
public boolean sendPacketToUser(@NotNull @NotNull ADPPacket packet, @NotNull @NotNull User user, @NotNull @NotNull MessageChannel channel)Send a packet- Parameters:
packet- the packet to senduser- the user where to send the packetchannel- the channel to use- Returns:
- true if sent successfully
-
sendPacketToUser
public abstract boolean sendPacketToUser(@NotNull @NotNull ADPPacket packet, @NotNull @NotNull User user, @NotNull @NotNull MessageChannel channel, boolean log)Send a packet- Parameters:
packet- the packet to senduser- the user where to send the packetchannel- the channel to uselog- enable debug logs- Returns:
- true if sent successfully
-
sendForwardPacket
public boolean sendForwardPacket(@NotNull @NotNull ADPPacket packet)Send a forward packet that will be dispatched to every server. This is supported by BungeeCord channel only.- Parameters:
packet- the packet to send- Returns:
- true if sent successfully
-
sendForwardPacket
public abstract boolean sendForwardPacket(@NotNull @NotNull ADPPacket packet, boolean log)Send a forward packet that will be dispatched to every server. This is supported by BungeeCord channel only.- Parameters:
packet- the packet to sendlog- enable debug logs- Returns:
- true if sent successfully
-
-