[+] Improved API
[+] Added new Events


Please update all Addons because of API changes!

Java:
import net.llamadevelopment.bansystem.BanSystem;
import net.llamadevelopment.bansystem.components.api.BanSystemAPI;

public class Test {

    private Provider api = BanSystem.getApi().getProvider();

    public void test() {
        this.api.getBan("testuser", ban -> {
            System.out.println("Player is banned for: " + ban.getReason());
        });

        this.api.unbanPlayer("testuser", "byME");
    }

}
Java:
import cn.nukkit.event.EventHandler;
import cn.nukkit.event.Listener;
import net.llamadevelopment.bansystem.components.event.PlayerBanEvent;
import net.llamadevelopment.bansystem.components.event.PlayerUnbanEvent;

public class Test implements Listener {

    @EventHandler
    public void on(PlayerBanEvent event) {
        System.out.println("Player " + event.getBan().getPlayer() + " was banned for " + event.getBan().getReason() + "!");
    }

    @EventHandler
    public void on(PlayerUnbanEvent event) {
        System.out.println("Player " + event.getTarget() + " was unbanned by " + event.getExecutor() + "!");
    }

}
[+] DAP compatibility
[+] Events clean up
[+] 3 new commands: /deleteban, /deletemute, /deletewarn
[+] Performance optimizations
[+] Events for developers
[+] More possibilities to customize commands
[-] Waterdog support is stopped for the time being


NOTICE:
For people who already use and want to update the system!

Please replace the old commands from config.yml to the new lines:

YAML:
Commands:
  Ban:
    Name: "ban"
    Description: "Ban a player"
    Permission: "bansystem.command.ban"
    Aliases: [ "pban" ]
  Tempban:
    Name: "tempban"
    Description: "Ban a player temporary"
    Permission: "bansystem.command.tempban"
    Aliases: [ "tban" ]
  Banlog:
    Name: "banlog"
    Description: "Get the ban history of a player"
    Permission: "bansystem.command.banlog"
    Aliases: [ "blog", "banhistory" ]
  Checkban:
    Name: "checkban"
    Description: "Check if a player is banned"
    Permission: "bansystem.command.checkban"
    Aliases: [ "cban" ]
  Clearbanlog:
    Name: "clearbanlog"
    Description: "Clear all ban entries of a player"
    Permission: "bansystem.command.clearbanlog"
    Aliases: [ "cblog" ]
  Editban:
    Name: "editban"
    Description: "Edit the ban of a player"
    Permission: "bansystem.command.editban"
    Aliases: [ "eban" ]
  Unban:
    Name: "unban"
    Description: "Cancel an active ban"
    Permission: "bansystem.command.unban"
    Aliases: [ "uban", "cancelban" ]
  Mute:
    Name: "mute"
    Description: "Mute a player from the chat"
    Permission: "bansystem.command.mute"
    Aliases: [ "pmute" ]
  Tempmute:
    Name: "tempmute"
    Description: "Mute a player temporary from the chat"
    Permission: "bansystem.command.tempmute"
    Aliases: [ "tmute" ]
  Mutelog:
    Name: "mutelog"
    Description: "Get the mute history of a player"
    Permission: "bansystem.command.mutelog"
    Aliases: [ "mlog", "mutehistory" ]
  Checkmute:
    Name: "checkmute"
    Description: "Check if a player is muted"
    Permission: "bansystem.command.checkmute"
    Aliases: [ "cmute" ]
  Clearmutelog:
    Name: "clearmutelog"
    Description: "Clear all mute entries of a player"
    Permission: "bansystem.command.clearmutelog"
    Aliases: [ "cmlog" ]
  Editmute:
    Name: "editmute"
    Description: "Edit the mute of a player"
    Permission: "bansystem.command.editmute"
    Aliases: [ "emute" ]
  Unmute:
    Name: "unmute"
    Description: "Cancel an active mute"
    Permission: "bansystem.command.unmute"
    Aliases: [ "umute", "cancelmute" ]
  Warn:
    Name: "warn"
    Description: "Warn a player"
    Permission: "bansystem.command.warn"
    Aliases: [ "pwarn" ]
  Warnlog:
    Name: "warnlog"
    Description: "Get the warn history of a player"
    Permission: "bansystem.command.warnlog"
    Aliases: [ "wlog", "warnhistory" ]
  Clearwarnings:
    Name: "clearwarnings"
    Description: "Clear all warn entries of a player"
    Permission: "bansystem.command.clearwarnings"
    Aliases: [ "cwlog" ]
  Kick:
    Name: "kick"
    Description: "Kick a player"
    Permission: "bansystem.command.kick"
    Aliases: [ "pkick" ]
  Deleteban:
    Name: "deleteban"
    Description: "Delete a ban entry"
    Permission: "bansystem.command.deleteban"
    Aliases: [ "dban", "removeban" ]
  Deletemute:
    Name: "deletemute"
    Description: "Delete a mute entry"
    Permission: "bansystem.command.deletemute"
    Aliases: [ "dmute", "removemute" ]
  Deletewarn:
    Name: "deletewarn"
    Description: "Delete a warn entry"
    Permission: "bansystem.command.deletewarn"
    Aliases: [ "dwarn", "removewarn" ]

Please add this lines to messages.yml:

YAML:
IdNotFound: "&cID &e[0] &ccould not be found."
BanDeleted: "&aYou successfully deleted ban &e[0]&a."
MuteDeleted: "&aYou successfully deleted mute &e[0]&a."
WarnDeleted: "&aYou successfully deleted warn &e[0]&a."

CheckbanIdInfo: "&aInformation about &e[0]&a:"
CheckbanIdPlayer: "&ePlayer: &7[0]"
CheckbanIdReason: "&eReason: &7[0]"
CheckbanIdBanner: "&eBanned by: &7[0]"
CheckbanIdDate: "&eDate: &7[0]"
CheckbanIdTime: "&eRemaining time: &7[0]"

CheckmuteIdInfo: "&aInformation about &e[0]&a:"
CheckmuteIdPlayer: "&ePlayer: &7[0]"
CheckmuteIdReason: "&eReason: &7[0]"
CheckmuteIdMuter: "&eMuted by: &7[0]"
CheckmuteIdDate: "&eDate: &7[0]"
CheckmuteIdTime: "&eRemaining time: &7[0]"

DeletebanCommandUsage: "/[0] <ID>"
DeletemuteCommandUsage: "/[0] <ID>"
DeletewarnCommandUsage: "/[0] <ID>"
[+] Fixed MySql time zone error.
[+] LanguageAPI improvements
[+] Code clean up
[+] MongoDB logger turned off
[+] Permanent banned players can not join now.
  • Like
Reactions: Justin
[+] Fixed remaining time display in Yaml provider.
  • Like
Reactions: Justin
The files of this plugin will be saved in a new folder, but some data, like messages, you can copy to the new plugin.

[+] Code improvements
[+] Clear banlogs, mutelogs and warnings
[+] Edit reason and time of a ban or mute
[+] Addons
[+] API for developers


If you find bugs, feel free to send them to me via Discord or Github!
  • Like
Reactions: Justin
[+] You can now specify a Join Delay in the Config. This is set to '60' by default. One second corresponds to the value '20'. If the delay is set to 60 or higher, the join error will be removed.
  • Like
Reactions: Justin
[+] You can warn now offline players.
  • Like
Reactions: Justin
Top