Update AntiNukerListener.java

This commit is contained in:
Deauthorized 2024-05-02 17:29:24 -04:00 committed by GitHub
parent 0c7b280aef
commit 6e5f0d7beb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
package dev.plex.listener.impl;
import dev.plex.listener.PlexListener;
import dev.plex.util.PlexUtils;
import dev.plex.services.impl.TimingService;
import net.kyori.adventure.text.Component;
import org.bukkit.event.EventHandler;
@ -19,7 +20,7 @@ public class AntiNukerListener extends PlexListener
if (getCount(event.getPlayer().getUniqueId()) > 200L)
{
TimingService.strikes.merge(event.getPlayer().getUniqueId(), 1L, Long::sum);
event.getPlayer().kick(Component.text("Please turn off your nuker!"));
event.getPlayer().kick(PlexUtils.messageComponent("nukerKickMessage"));
event.setCancelled(true);
}
}
@ -31,7 +32,7 @@ public class AntiNukerListener extends PlexListener
if (getCount(event.getPlayer().getUniqueId()) > 200L)
{
TimingService.strikes.merge(event.getPlayer().getUniqueId(), 1L, Long::sum);
event.getPlayer().kick(Component.text("Please turn off your nuker!"));
event.getPlayer().kick(PlexUtils.messageComponent("nukerKickMessage"));
event.setCancelled(true);
}
}