Add ISeeYou

This commit is contained in:
Jess H 2024-05-27 08:04:11 +01:00
parent e8cd16b5b0
commit 31364a6d0a
3 changed files with 53 additions and 5 deletions

View file

@ -79,7 +79,6 @@ public class BaseBand {
}
for (Updater updater : updaters) {
GlobalUtil.LOGGER.info("populating updater {}", updater);
updater.populate();
}

View file

@ -1,10 +1,7 @@
package com.baseband.client;
import com.baseband.client.module.Feature;
import com.baseband.client.module.chat.ChatAppend;
import com.baseband.client.module.chat.ChatCrypt;
import com.baseband.client.module.chat.ChatFilter;
import com.baseband.client.module.chat.ExtraChat;
import com.baseband.client.module.chat.*;
import com.baseband.client.module.client.*;
import com.baseband.client.module.combat.AutoTotem;
import com.baseband.client.module.command.Set;
@ -59,6 +56,7 @@ public class Setup {
new Baritone(),
new AutoEat(),
new AutoReconnect(),
new ISeeYou(),
};

View file

@ -0,0 +1,51 @@
package com.baseband.client.module.chat;
import com.baseband.client.module.Feature;
import com.baseband.client.module.category.Chat;
import com.baseband.client.util.ingame.ChatUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import java.util.ArrayList;
@Chat
public class ISeeYou extends Feature {
private final ArrayList<String> names = new ArrayList<>();
private final ArrayList<String> newnames = new ArrayList<>();
@Override
public String toString() {
return "ISeeYou";
}
@Override
public void onTick() {
if(!notIngame()) {
localPlayerCheck();
text = "ISeeYou" + (enabled ? " §7[" + names.size() + "/" +"]" : "");
}
}
public void localPlayerCheck() {
newnames.clear();
try {
for (final Entity entity : mc.world.loadedEntityList) if (entity instanceof EntityPlayer && !entity.getName().equalsIgnoreCase(mc.player.getName())) newnames.add(entity.getName());
if (!names.equals(newnames)) {
for (final String name : newnames) if (!names.contains(name)) ChatUtil.print("[ISeeYou] I locally see "+name);
for (final String name : names) if (!newnames.contains(name)) ChatUtil.print("[ISeeYou] I no longer locally see "+name);
names.clear();
names.addAll(newnames);
}
} catch (Exception ignored) {}
}
@Override
public void onDisable() {
text = "ISeeYou";
names.clear();
newnames.clear();
}
}