fix: i forgot the previous commit will actually make all filter systems useless. i ended up doing something else lazy instead to fix this
This commit is contained in:
@@ -7,6 +7,7 @@ import me.chayapak1.chomens_bot.util.ComponentUtilities;
|
||||
import me.chayapak1.chomens_bot.util.UUIDUtilities;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.geysermc.mcprotocollib.network.event.session.DisconnectedEvent;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -24,6 +25,13 @@ public class FilterManagerPlugin extends PlayersPlugin.Listener {
|
||||
|
||||
bot.players.addListener(this);
|
||||
|
||||
bot.addListener(new Bot.Listener() {
|
||||
@Override
|
||||
public void disconnected(DisconnectedEvent event) {
|
||||
list.clear();
|
||||
}
|
||||
});
|
||||
|
||||
bot.chat.addListener(new ChatPlugin.Listener() {
|
||||
@Override
|
||||
public boolean playerMessageReceived(PlayerMessage message) {
|
||||
|
||||
@@ -143,11 +143,6 @@ public class IPFilterPlugin extends PlayersPlugin.Listener {
|
||||
}
|
||||
|
||||
private void handleFilterManager (String ip, PlayerEntry entry) {
|
||||
// this can break other filters for this player (if they are filtered)
|
||||
// but for now it will fix a case when someone removes an ip and that
|
||||
// player will still get filtered
|
||||
if (!localList.contains(ip)) bot.filterManager.remove(entry.profile.getName());
|
||||
|
||||
for (String eachIP : localList) {
|
||||
if (!eachIP.equals(ip)) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user