Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BoomEaro/BanManager
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0
Choose a base ref
...
head repository: BoomEaro/BanManager
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: custom
Choose a head ref
  • 18 commits
  • 65 files changed
  • 1 contributor

Commits on Jan 23, 2024

  1. Copy the full SHA
    a40eff2 View commit details
  2. Copy the full SHA
    121464d View commit details

Commits on Mar 22, 2024

  1. Use different date format

    BoomEaro committed Mar 22, 2024
    Copy the full SHA
    fc1c97c View commit details

Commits on Mar 23, 2024

  1. Add 'custom' ban commands

    BoomEaro committed Mar 23, 2024
    Copy the full SHA
    d7e4d42 View commit details

Commits on Mar 24, 2024

  1. Add another ban type - aban

    BoomEaro committed Mar 24, 2024
    Copy the full SHA
    d6df1e8 View commit details
  2. Fix date utils

    BoomEaro committed Mar 24, 2024
    Copy the full SHA
    f597688 View commit details

Commits on Mar 25, 2024

  1. Attempt to fix aban notify

    BoomEaro committed Mar 25, 2024
    Copy the full SHA
    7a53c39 View commit details
  2. Add translations

    BoomEaro committed Mar 25, 2024
    Copy the full SHA
    0cf6c45 View commit details

Commits on Mar 31, 2024

  1. Copy the full SHA
    228878c View commit details

Commits on Apr 1, 2024

  1. Copy the full SHA
    666236b View commit details
  2. Copy the full SHA
    1bda7c9 View commit details

Commits on Apr 29, 2024

  1. Copy the full SHA
    182455c View commit details
  2. Copy the full SHA
    e7f5dc1 View commit details
  3. Disable unused modules

    BoomEaro committed Apr 29, 2024
    Copy the full SHA
    75a3635 View commit details

Commits on May 2, 2024

  1. Fix paid unban

    BoomEaro committed May 2, 2024
    Copy the full SHA
    df35afd View commit details

Commits on Jun 30, 2024

  1. Copy the full SHA
    d7ed16a View commit details

Commits on Aug 17, 2024

  1. Copy the full SHA
    305ef00 View commit details
  2. Copy the full SHA
    0e8e69a View commit details
Showing with 3,223 additions and 1,086 deletions.
  1. +9 −1 bukkit/src/main/java/me/confuser/banmanager/bukkit/BukkitServer.java
  2. +17 −0 bukkit/src/main/java/me/confuser/banmanager/bukkit/api/events/PlayerABanEvent.java
  3. +17 −0 bukkit/src/main/java/me/confuser/banmanager/bukkit/api/events/PlayerABannedEvent.java
  4. +25 −0 bukkit/src/main/java/me/confuser/banmanager/bukkit/api/events/PlayerAUnbanEvent.java
  5. +6 −13 bukkit/src/main/java/me/confuser/banmanager/bukkit/listeners/BanListener.java
  6. +14 −1 bukkit/src/main/java/me/confuser/banmanager/bukkit/listeners/HookListener.java
  7. +1 −0 bukkit/src/main/java/me/confuser/banmanager/bukkit/listeners/JoinListener.java
  8. +18 −2 bukkit/src/main/resources/config.yml
  9. +24 −0 bukkit/src/main/resources/messages.yml
  10. +59 −47 bukkit/src/main/resources/plugin.yml
  11. +2 −2 bungee/build.gradle.kts
  12. +9 −1 bungee/src/main/java/me/confuser/banmanager/bungee/BungeeServer.java
  13. +17 −0 bungee/src/main/java/me/confuser/banmanager/bungee/api/events/PlayerABanEvent.java
  14. +17 −0 bungee/src/main/java/me/confuser/banmanager/bungee/api/events/PlayerABannedEvent.java
  15. +25 −0 bungee/src/main/java/me/confuser/banmanager/bungee/api/events/PlayerAUnbanEvent.java
  16. +6 −4 bungee/src/main/java/me/confuser/banmanager/bungee/listeners/BanListener.java
  17. +73 −50 bungee/src/main/java/me/confuser/banmanager/bungee/listeners/JoinListener.java
  18. +17 −1 bungee/src/main/resources/config.yml
  19. +24 −0 bungee/src/main/resources/messages.yml
  20. +54 −39 bungee/src/main/resources/plugin.yml
  21. +2 −0 common/build.gradle.kts
  22. +12 −0 common/src/main/java/me/confuser/banmanager/common/BanManagerPlugin.java
  23. +1 −1 common/src/main/java/me/confuser/banmanager/common/api/BmAPI.java
  24. +188 −0 common/src/main/java/me/confuser/banmanager/common/commands/ABanCommand.java
  25. +119 −0 common/src/main/java/me/confuser/banmanager/common/commands/AUnbanCommand.java
  26. +7 −1 common/src/main/java/me/confuser/banmanager/common/commands/BanCommand.java
  27. +12 −3 common/src/main/java/me/confuser/banmanager/common/commands/CommonCommand.java
  28. +1 −1 common/src/main/java/me/confuser/banmanager/common/commands/FindAltsCommand.java
  29. +2 −2 common/src/main/java/me/confuser/banmanager/common/commands/InfoCommand.java
  30. +11 −8 common/src/main/java/me/confuser/banmanager/common/commands/MuteCommand.java
  31. +1 −1 common/src/main/java/me/confuser/banmanager/common/commands/SyncCommand.java
  32. +11 −8 common/src/main/java/me/confuser/banmanager/common/commands/TempMuteCommand.java
  33. +118 −0 common/src/main/java/me/confuser/banmanager/common/commands/UnbanPaidCommand.java
  34. +2 −0 common/src/main/java/me/confuser/banmanager/common/commands/UtilsCommand.java
  35. +2 −4 common/src/main/java/me/confuser/banmanager/common/commands/utils/DuplicatesSubCommand.java
  36. +53 −0 common/src/main/java/me/confuser/banmanager/common/commands/utils/FixDuplicatesSubCommand.java
  37. +1 −0 common/src/main/java/me/confuser/banmanager/common/commands/utils/MissingPlayersSubCommand.java
  38. +50 −0 common/src/main/java/me/confuser/banmanager/common/configs/AdvancedCooldownsConfig.java
  39. +200 −190 common/src/main/java/me/confuser/banmanager/common/configs/DefaultConfig.java
  40. +2 −0 common/src/main/java/me/confuser/banmanager/common/configs/GlobalDatabaseConfig.java
  41. +4 −0 common/src/main/java/me/confuser/banmanager/common/configs/LocalDatabaseConfig.java
  42. +78 −0 common/src/main/java/me/confuser/banmanager/common/data/DuplicatePlayerData.java
  43. +85 −0 common/src/main/java/me/confuser/banmanager/common/data/PlayerABanData.java
  44. +86 −0 common/src/main/java/me/confuser/banmanager/common/data/PlayerABanRecord.java
  45. +3 −2 common/src/main/java/me/confuser/banmanager/common/data/PlayerData.java
  46. +82 −1 common/src/main/java/me/confuser/banmanager/common/listeners/CommonBanListener.java
  47. +1 −1 common/src/main/java/me/confuser/banmanager/common/listeners/CommonDiscordListener.java
  48. +37 −0 common/src/main/java/me/confuser/banmanager/common/listeners/CommonHooksListener.java
  49. +621 −475 common/src/main/java/me/confuser/banmanager/common/listeners/CommonJoinListener.java
  50. +1 −1 common/src/main/java/me/confuser/banmanager/common/listeners/CommonMuteListener.java
  51. +91 −0 common/src/main/java/me/confuser/banmanager/common/storage/DuplicatePlayerStorage.java
  52. +100 −0 common/src/main/java/me/confuser/banmanager/common/storage/PlayerABanRecordStorage.java
  53. +328 −0 common/src/main/java/me/confuser/banmanager/common/storage/PlayerABanStorage.java
  54. +87 −28 common/src/main/java/me/confuser/banmanager/common/storage/PlayerBanStorage.java
  55. +63 −0 common/src/main/java/me/confuser/banmanager/common/storage/PlayerMuteStorage.java
  56. +4 −0 common/src/main/java/me/confuser/banmanager/common/storage/conversion/AdvancedBan.java
  57. +48 −0 common/src/main/java/me/confuser/banmanager/common/storage/conversion/H2.java
  58. +2 −0 common/src/main/java/me/confuser/banmanager/common/storage/conversion/IConverter.java
  59. +4 −0 common/src/main/java/me/confuser/banmanager/common/storage/conversion/SimpleWarnings.java
  60. +153 −154 common/src/main/java/me/confuser/banmanager/common/util/DateUtils.java
  61. +22 −0 common/src/main/java/me/confuser/banmanager/common/util/LuckPermsUtils.java
  62. +13 −1 common/src/main/resources/config.yml
  63. +24 −0 common/src/main/resources/messages.yml
  64. +53 −38 common/src/main/resources/plugin.yml
  65. +4 −5 settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -128,13 +128,21 @@ public CommonEvent callEvent(String name, Object... args) {
case "PlayerBanEvent":
event = new PlayerBanEvent((PlayerBanData) args[0], (boolean) args[1]);
break;
case "PlayerABanEvent":
event = new PlayerABanEvent((PlayerABanData) args[0], (boolean) args[1]);
break;
case "PlayerBannedEvent":
event = new PlayerBannedEvent((PlayerBanData) args[0], (boolean) args[1]);
break;
case "PlayerABannedEvent":
event = new PlayerABannedEvent((PlayerABanData) args[0], (boolean) args[1]);
break;
case "PlayerUnbanEvent":
event = new PlayerUnbanEvent((PlayerBanData) args[0], (PlayerData) args[1], (String) args[2]);
break;

case "PlayerAUnbanEvent":
event = new PlayerAUnbanEvent((PlayerABanData) args[0], (PlayerData) args[1], (String) args[2]);
break;
case "IpBanEvent":
event = new IpBanEvent((IpBanData) args[0], (boolean) args[1]);
break;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.confuser.banmanager.bukkit.api.events;

import lombok.Getter;
import me.confuser.banmanager.common.data.PlayerABanData;


public class PlayerABanEvent extends SilentCancellableEvent {

@Getter
private PlayerABanData ban;

public PlayerABanEvent(PlayerABanData ban, boolean isSilent) {
super(isSilent, true);
this.ban = ban;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.confuser.banmanager.bukkit.api.events;

import lombok.Getter;
import me.confuser.banmanager.common.data.PlayerABanData;


public class PlayerABannedEvent extends SilentEvent {

@Getter
private PlayerABanData ban;

public PlayerABannedEvent(PlayerABanData ban, boolean isSilent) {
super(isSilent, true);
this.ban = ban;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package me.confuser.banmanager.bukkit.api.events;

import lombok.Getter;
import me.confuser.banmanager.common.data.PlayerABanData;
import me.confuser.banmanager.common.data.PlayerData;


public class PlayerAUnbanEvent extends CustomCancellableEvent {

@Getter
private PlayerABanData ban;
@Getter
private PlayerData actor;
@Getter
private String reason;

public PlayerAUnbanEvent(PlayerABanData ban, PlayerData actor, String reason) {
super(true);

this.ban = ban;
this.actor = actor;
this.reason = reason;
}

}
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
package me.confuser.banmanager.bukkit.listeners;


import me.confuser.banmanager.bukkit.api.events.IpBannedEvent;
import me.confuser.banmanager.bukkit.api.events.IpRangeBannedEvent;
import me.confuser.banmanager.bukkit.api.events.NameBannedEvent;
import me.confuser.banmanager.bukkit.api.events.PlayerBannedEvent;
import me.confuser.banmanager.bukkit.api.events.*;
import me.confuser.banmanager.common.BanManagerPlugin;
import me.confuser.banmanager.common.CommonPlayer;
import me.confuser.banmanager.common.commands.CommonSender;
import me.confuser.banmanager.common.data.*;
import me.confuser.banmanager.common.listeners.CommonBanListener;
import me.confuser.banmanager.common.util.DateUtils;
import me.confuser.banmanager.common.util.IPUtils;
import me.confuser.banmanager.common.util.Message;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;

import java.util.List;

public class BanListener implements Listener {

private final CommonBanListener listener;
@@ -32,6 +20,11 @@ public void notifyOnBan(PlayerBannedEvent event) {
listener.notifyOnBan(event.getBan(), event.isSilent());
}

@EventHandler(priority = EventPriority.MONITOR)
public void notifyOnABan(PlayerABannedEvent event) {
listener.notifyOnABan(event.getBan(), event.isSilent());
}

@EventHandler(priority = EventPriority.MONITOR)
public void notifyOnIpBan(IpBannedEvent event) {
listener.notifyOnBan(event.getBan(), event.isSilent());
Original file line number Diff line number Diff line change
@@ -24,11 +24,24 @@ public void onBan(final PlayerBannedEvent event) {
listener.onBan(event.getBan(), false);
}

@EventHandler(priority = EventPriority.MONITOR)
public void onABan(final PlayerABanEvent event) {
listener.onBan(event.getBan(), true);
}

@EventHandler(priority = EventPriority.MONITOR)
public void onABan(final PlayerABannedEvent event) {
listener.onBan(event.getBan(), false);
}

@EventHandler(priority = EventPriority.MONITOR)
public void onUnban(final PlayerUnbanEvent event) {
listener.onUnban(event.getBan(), event.getActor(), event.getReason());
}

@EventHandler(priority = EventPriority.MONITOR)
public void onAUnban(final PlayerAUnbanEvent event) {
listener.onUnban(event.getBan(), event.getActor(), event.getReason());
}
@EventHandler(priority = EventPriority.MONITOR)
public void onMute(final PlayerMuteEvent event) {
listener.onMute(event.getMute(), true);
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import me.confuser.banmanager.bukkit.BukkitServer;
import me.confuser.banmanager.common.BanManagerPlugin;
import me.confuser.banmanager.common.data.PlayerData;
import me.confuser.banmanager.common.ipaddr.IPAddress;
import me.confuser.banmanager.common.listeners.CommonJoinHandler;
import me.confuser.banmanager.common.listeners.CommonJoinListener;
import me.confuser.banmanager.common.util.*;
20 changes: 18 additions & 2 deletions bukkit/src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -16,8 +16,11 @@ databases:
connectionTimeout: 30000
tables:
players: bm_players
duplicatePlayers: bm_duplicate_players
playerBans: bm_player_bans
playerABans: bm_player_abans
playerBanRecords: bm_player_ban_records
playerABanRecords: bm_player_aban_records
playerMutes: bm_player_mutes
playerMuteRecords: bm_player_mute_records
playerKicks: bm_player_kicks
@@ -125,7 +128,20 @@ cooldowns:
warn: 10
tempwarn: 10
report: 10

advancedCooldowns:
mute:
default:
threshold: 3
time: 120000
cooldown: 120000
admin:
threshold: 3
time: 120000
cooldown: 120000

detectServerJoin:
- "lobby"
-
# Commands to execute when a player reaches a certain number of warning points
warningActions:
enabled: false
@@ -229,4 +245,4 @@ uuidFetcher:
key: id

# Allows supporting Bedrock names (via GeyserMC)
geyserPrefix: '.'
geyserPrefix: '.'
24 changes: 24 additions & 0 deletions bukkit/src/main/resources/messages.yml
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ messages:
exempt: '&c[player] is exempt from that action'
noPermission: '&cYou do not have permission to perform that action'
invalidReason: '&c[reason] is no valid reason.'
paidUnbanned: '&c[player] is paid unbanned!'
# Commands
alts:
header: 'Possible alts found:'
@@ -140,6 +141,16 @@ messages:
exists: '&c[player] is already banned'
cooldown: '&cThis player was banned too recently, try again later'

aban:
player:
disallowed: '&6You have been abanned from this server for &4[reason]'
kick: '&6You have been abanned permanently for &4[reason]'
dateTimeFormat: 'yyyy-MM-dd HH:mm:ss'
notify: '&6[player] has been permanently abanned by [actor] for &4[reason]'
error:
exists: '&c[player] is already abanned'
cooldown: '&cThis player was abanned too recently, try again later'

banall:
notify: '&6[player] will be permanently banned by [actor] for &4[reason]'

@@ -159,6 +170,18 @@ messages:
noExists: '&c[player] is not banned'
notOwn: '&c[player] was not banned by you, unable to unban'

aunban:
notify: '&6[player] has been aunbanned by [actor]'
error:
noExists: '&c[player] is not abanned'
notOwn: '&c[player] was not abanned by you, unable to unban'

unbanpaid:
notify: '&6[player] has been paid unbanned by [actor]'
error:
noExists: '&c[player] is not banned'
notOwn: '&c[player] was not banned by you, unable to paid unban'

unbanall:
notify: '&6[player] will be unbanned by [actor]'

@@ -171,6 +194,7 @@ messages:
error:
exists: '&c[player] is already muted'
cooldown: '&cThis player was muted too recently, try again later'
advancedCooldown: '&cYou will be able to mute a player after [time] seconds'

muteip:
ip:
Loading