Spigot CustomBanMessage 1.0.3

Set a custom message that players will receive when they are banned from your server.

  1. Dev_Richard submitted a new resource:

    CustomBanMessage - Set a custom message that players will receive when they are banned from your server.

    Read more about this resource...
     
    • Optimistic Optimistic x 1
  2. Error code: [Set priority ban]

    [08:41:45 ERROR]: Could not pass event PlayerKickEvent to CustomBanMessage v1.0.
    1
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:305) ~[Survival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[Survival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:502) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:487) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at net.minecraft.server.v1_8_R1.PlayerConnection.disconnect(PlayerConnec
    tion.java:161) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer.kickPlayer(CraftPla
    yer.java:220) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at com.earth2me.essentials.commands.Commandban.run(Commandban.java:70) [
    Essentials-2.x-SNAPSHOT.jar:?]
    at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsComm
    and.java:192) [Essentials-2.x-SNAPSHOT.jar:?]
    at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.jav
    a:523) [Essentials-2.x-SNAPSHOT.jar:?]
    at com.earth2me.essentials.Essentials.onCommand(Essentials.java:402) [Es
    sentials-2.x-SNAPSHOT.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [Surv
    ival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServe
    r.java:643) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(Craf
    tServer.java:629) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:
    353) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:3
    17) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:6
    23) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
    :526) [Survival.jar:git-Spigot-da32fe1-2ba7357]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_21]
    Caused by: java.lang.NoClassDefFoundError: net/md_5/bungee/api/ChatColor
    at net.richardsprojects.customban.Utils.colorCodes(Utils.java:34) ~[?:?]

    at net.richardsprojects.customban.Utils.banMessage(Utils.java:17) ~[?:?]

    at net.richardsprojects.customban.PlayerListener.kickedEvent(PlayerListe
    ner.java:75) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
    _21]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
    _21]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .7.0_21]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_21]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:301) ~[Survival.jar:git-Spigot-da32fe1-2ba7357]
    ... 18 more
    Caused by: java.lang.ClassNotFoundException: net.md_5.bungee.api.ChatColor
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_21]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_21]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_
    21]
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_21]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:101) ~[Survival.jar:git-Spigot-da32fe1-2ba7357]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:86) ~[Survival.jar:git-Spigot-da32fe1-2ba7357]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_21]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_21]
    at net.richardsprojects.customban.Utils.colorCodes(Utils.java:34) ~[?:?]

    at net.richardsprojects.customban.Utils.banMessage(Utils.java:17) ~[?:?]

    at net.richardsprojects.customban.PlayerListener.kickedEvent(PlayerListe
    ner.java:75) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
    _21]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
    _21]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .7.0_21]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_21]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:301) ~[Survival.jar:git-Spigot-da32fe1-2ba7357]
    ... 18 more
     
  3. I believe you need to update to the latest version of Spigot.
     
  4. Is a conflict caused by plugin essentials.
     
  5. Code (Java):
    public static String colorCodes(String msg) {
    msg = msg.replace("&0", ChatColor.BLACK + "");
    msg = msg.replace("&1", ChatColor.DARK_BLUE + "");
    msg = msg.replace("&2", ChatColor.DARK_GREEN + "");
    msg = msg.replace("&3", ChatColor.DARK_AQUA + "");
    msg = msg.replace("&4", ChatColor.DARK_RED + "");
    msg = msg.replace("&5", ChatColor.DARK_PURPLE + "");
    msg = msg.replace("&6", ChatColor.GOLD + "");
    msg = msg.replace("&7", ChatColor.GRAY + "");
    msg = msg.replace("&8", ChatColor.DARK_GRAY + "");
    msg = msg.replace("&9", ChatColor.BLUE + "");
    msg = msg.replace("&a", ChatColor.GREEN + "");
    msg = msg.replace("&b", ChatColor.AQUA + "");
    msg = msg.replace("&c", ChatColor.RED + "");
    msg = msg.replace("&d", ChatColor.LIGHT_PURPLE + "");
    msg = msg.replace("&e", ChatColor.YELLOW + "");
    msg = msg.replace("&f", ChatColor.WHITE + "");
    msg = msg.replace("&l", ChatColor.BOLD + "");
    msg = msg.replace("&m", ChatColor.STRIKETHROUGH + "");
    msg = msg.replace("&n", ChatColor.UNDERLINE + "");
    msg = msg.replace("&o", ChatColor.ITALIC + "");
    msg = msg.replace("&r", ChatColor.RESET + "");
    return msg;
    }
    Rly. bro?
    Replace it all with return ChatColor.translateAlternateColors('&',msg);

    Code (Java):
    public static String banMessage(String expiry, String reason) {
    String line1 = colorCodes(CustomBan.bannedLine1);
    String line2 = colorCodes(CustomBan.bannedLine2);
    String line3 = colorCodes(CustomBan.bannedLine3);
    String line4 = colorCodes(CustomBan.bannedLine4);
    line1 = line1.replace("BAN_TIME", expiry);
    line2 = line2.replace("BAN_TIME", expiry);
    line3 = line3.replace("BAN_TIME", expiry);
    line4 = line4.replace("BAN_TIME", expiry);
    line1 = line1.replace("REASON", reason);
    line2 = line2.replace("REASON", reason);
    line3 = line3.replace("REASON", reason);
    line4 = line4.replace("REASON", reason);
    String result = line1 + "\n" + line2 + "\n" + line3 + "\n" + line4;
    return result;
    }
    Replace all the line1 = etc with:
    Code (Java):
    // In String line1 = banFormat(CustomBan.bannedLine1);
    public void banFormat(String line, String expiry, String reason) {
        return ChatColor.translateAlternateColors('&',line).replaceAll("$BAN_TIME", expiry).replaceAll("$REASON",reason);
    }
    Code (Java):
    log = Logger.getLogger("Minecraft");
    This is just.. wow

    Code (Java):
    public static Logger log;
    public FileConfiguration config;
    public static String bannedLine1 = "&4&lBanned:";
    public static String bannedLine2 = "&d&lReason: &b&l REASON";
    public static String bannedLine3 = "&d&lBan Length: &b&l BAN_TIME";
    public static String bannedLine4 = "&d&lAppeal Here: &b&l [Fill in Website Address]";
    What about.. letting them fill the web address in a config?
    also, static much?

    Code (Java):
    if(e.getUniqueId().equals((UUID.fromString("0b8e6bba-c5e7-4010-b87d-55be79587778")))) {
    e.disallow(Result.KICK_BANNED, "$7.50");
    }
    erm.. why? rip this dude: https://namemc.com/s?0b8e6bba-c5e7-4010-b87d-55be79587778