Added ban type to join message of banned player
This commit is contained in:
parent
8382eb432d
commit
ecc4b6d999
@ -13,9 +13,11 @@ import net.md_5.bungee.event.EventHandler;
|
|||||||
import net.md_5.bungee.event.EventPriority;
|
import net.md_5.bungee.event.EventPriority;
|
||||||
|
|
||||||
public class BanJoinListener<T extends Ban> implements Listener {
|
public class BanJoinListener<T extends Ban> implements Listener {
|
||||||
|
private String name;
|
||||||
private BanManager<T> bm;
|
private BanManager<T> bm;
|
||||||
|
|
||||||
public BanJoinListener(BanManager<T> bm) {
|
public BanJoinListener(String name, BanManager<T> bm) {
|
||||||
|
this.name = name;
|
||||||
this.bm = bm;
|
this.bm = bm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +44,7 @@ public class BanJoinListener<T extends Ban> implements Listener {
|
|||||||
|
|
||||||
if (ban != null) {
|
if (ban != null) {
|
||||||
event.setCancelReason(
|
event.setCancelReason(
|
||||||
new ComponentBuilder(ChatColor.RED + "You were banned by ")
|
new ComponentBuilder(ChatColor.RED + "You were " + name + " banned by ")
|
||||||
.append(ChatColor.AQUA + ban.getSource())
|
.append(ChatColor.AQUA + ban.getSource())
|
||||||
.append(ChatColor.RED + " for ")
|
.append(ChatColor.RED + " for ")
|
||||||
.append(ChatColor.AQUA + ban.getReason())
|
.append(ChatColor.AQUA + ban.getReason())
|
||||||
|
Reference in New Issue
Block a user