some stuff when chipmunk was on vacation

too lazy to list the stuff
just check the diff,..,.,
This commit is contained in:
ChomeNS
2023-06-01 18:14:21 +07:00
parent 7c522b222d
commit 7b93762e70
5 changed files with 10 additions and 7 deletions

View File

@@ -119,6 +119,8 @@ public class Bot {
}
private void reconnect () {
if (session != null) session = null; // does this do nothing?
for (Listener listener : listeners) {
listener.connecting();
}

View File

@@ -38,10 +38,10 @@ public class FilterPlugin extends PlayersPlugin.Listener {
if (_filteredPlayer.regex) {
Pattern pattern = null;
if (_filteredPlayer.ignoreCase) {
pattern = Pattern.compile("\\b" + _filteredPlayer.playerName + "\\b", Pattern.CASE_INSENSITIVE);
pattern = Pattern.compile(_filteredPlayer.playerName, Pattern.CASE_INSENSITIVE);
} else {
try {
pattern = Pattern.compile("\\b" + _filteredPlayer.playerName + "\\b");
pattern = Pattern.compile(_filteredPlayer.playerName);
} catch (Exception e) {
bot.chat().tellraw(Component.text(e.toString()).color(NamedTextColor.RED));
}

View File

@@ -1,7 +1,7 @@
package land.chipmunk.chayapak.chomens_bot.plugins;
import land.chipmunk.chayapak.chomens_bot.Bot;
import land.chipmunk.chayapak.chomens_bot.Logger;
import land.chipmunk.chayapak.chomens_bot.util.Logger;
import land.chipmunk.chayapak.chomens_bot.util.ColorUtilities;
import lombok.Getter;
import lombok.Setter;

View File

@@ -3,7 +3,7 @@ package land.chipmunk.chayapak.chomens_bot.plugins;
import com.github.steveice10.packetlib.event.session.ConnectedEvent;
import com.github.steveice10.packetlib.event.session.DisconnectedEvent;
import land.chipmunk.chayapak.chomens_bot.Bot;
import land.chipmunk.chayapak.chomens_bot.Logger;
import land.chipmunk.chayapak.chomens_bot.util.Logger;
import land.chipmunk.chayapak.chomens_bot.util.ComponentUtilities;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;

View File

@@ -1,4 +1,6 @@
package land.chipmunk.chayapak.chomens_bot;
package land.chipmunk.chayapak.chomens_bot.util;
import land.chipmunk.chayapak.chomens_bot.Main;
import java.io.*;
import java.nio.charset.StandardCharsets;
@@ -6,7 +8,6 @@ import java.nio.file.Files;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPInputStream;
@@ -24,7 +25,7 @@ public class Logger {
public static String prevEntry = "";
public static int duplicateCounter = 1;
public static ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);
public static ScheduledExecutorService executor = Main.executor;
public static int spamLevel = 0;
public static long freezeTime = 0;