Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Asintotoo authored Jul 18, 2024
1 parent 8daa389 commit 75a56c6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.asintoto</groupId>
<artifactId>Basic</artifactId>
<version>1.2.4</version>
<version>1.2.5</version>
<packaging>jar</packaging>

<name>Basic</name>
Expand Down
26 changes: 23 additions & 3 deletions src/main/java/com/asintoto/basic/players/BasicPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class BasicPlayer {
private Player player;

private static String banKickMessage = ColorLib.setColors("&c" + BasicChar.CROSS + "You are banned from this server. Reason {reason}");
private static String banKickMessage = ColorLib.setColors("&c" + BasicChar.CROSS + " You are banned from this server. Reason {reason}");

public BasicPlayer(Player player) {
this.player = player;
Expand Down Expand Up @@ -117,8 +117,8 @@ public void ban(String reason, long duration, boolean ip, String source) {

BanList.Type bantype = ip ? BanList.Type.IP : BanList.Type.PROFILE;

player.getServer().getBanList(bantype).addBan(ip ? getIP() : player.getName(), reason, banExpire, ColorLib.setColors(source));
player.kickPlayer(banKickMessage.replace("{reason}", reason));
player.getServer().getBanList(bantype).addBan(ip ? getIP() : player.getName(), ColorLib.setColors(reason), banExpire, ColorLib.setColors(source));
player.kickPlayer(banKickMessage.replace("{reason}", ColorLib.setColors(reason)));
}

/**
Expand All @@ -130,6 +130,16 @@ public void ban(String reason) {
ban(reason, -1, false, null);
}

/**
* Temp-Ban a player
*
* @param reason
* @param duration
*/
public void ban(String reason, long duration) {
ban(reason, duration, false, null);
}


/**
* Perma-IP-Ban a player
Expand All @@ -140,6 +150,16 @@ public void banIP(String reason) {
ban(reason, -1, true, null);
}

/**
* Temp-IP-Ban a player
*
* @param reason
* @param duration
*/
public void banIP(String reason, long duration) {
ban(reason, duration, true, null);
}

/**
* Get the player's UUID
*
Expand Down

0 comments on commit 75a56c6

Please sign in to comment.