diff --git a/pom.xml b/pom.xml
index 6df77d5..eca6e32 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
me.victorgamer15
BrandBlocker
- 1.6
+ 1.7
jar
BrandBlocker
@@ -69,7 +69,7 @@
org.spigotmc
spigot-api
- 1.14.3-R0.1-SNAPSHOT
+ 1.20.4-R0.1-SNAPSHOT
provided
diff --git a/src/main/java/me/victorgamer15/brandblocker/BrandBlocker.java b/src/main/java/me/victorgamer15/brandblocker/BrandBlocker.java
index 2079d41..b037496 100644
--- a/src/main/java/me/victorgamer15/brandblocker/BrandBlocker.java
+++ b/src/main/java/me/victorgamer15/brandblocker/BrandBlocker.java
@@ -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;
@@ -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;
}
@@ -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;
}