Skip to content

Commit

Permalink
Merge branch 'Menacho15:master' into upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
mercurialmusic authored May 6, 2024
2 parents d678007 + f68d869 commit 496d7fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.victorgamer15</groupId>
<artifactId>BrandBlocker</artifactId>
<version>1.6</version>
<version>1.7</version>
<packaging>jar</packaging>

<name>BrandBlocker</name>
Expand Down Expand Up @@ -69,7 +69,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.3-R0.1-SNAPSHOT</version>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/me/victorgamer15/brandblocker/BrandBlocker.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.messaging.PluginMessageListener;
import org.bukkit.scheduler.BukkitRunnable;

import java.nio.charset.StandardCharsets;
import java.util.HashMap;
Expand Down Expand Up @@ -102,7 +103,11 @@ public void onPluginMessageReceived(String channel, Player p, byte[] msg) {
if (str.equalsIgnoreCase(brand)) {
if(p.hasPermission("brandblocker.bypass")) return;
String kickMsg = getConfig().getString("kick-message");
p.kickPlayer(ChatColor.translateAlternateColorCodes('&', kickMsg));
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
p.kickPlayer(ChatColor.translateAlternateColorCodes('&', kickMsg));
}
}, 5L);
getLogger().info(getConfig().getString("console-log").replace("%player%", p.getName()).replace("%brand%", brand));
return;
}
Expand All @@ -116,7 +121,11 @@ public void onPluginMessageReceived(String channel, Player p, byte[] msg) {
}
if(p.hasPermission("brandblocker.bypass")) return;
String kickMsg = getConfig().getString("kick-message");
p.kickPlayer(ChatColor.translateAlternateColorCodes('&', kickMsg));
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
p.kickPlayer(ChatColor.translateAlternateColorCodes('&', kickMsg));
}
}, 5L);
getLogger().info(getConfig().getString("console-log").replace("%player%", p.getName()).replace("%brand%", brand));
break;
}
Expand Down

0 comments on commit 496d7fa

Please sign in to comment.