formatting for visualrange

This commit is contained in:
Bella 2020-03-12 21:59:33 -04:00 committed by S-B99
parent de3cd97c68
commit b68b563788
No known key found for this signature in database
GPG Key ID: 03B01AC937D1C89C
1 changed files with 7 additions and 25 deletions

View File

@ -17,39 +17,30 @@ import java.util.List;
/**
* Created on 26 October 2019 by hub
* Updated 12 January 2020 by hub
* Updated by polymer on 23/02/20
*/
@Module.Info(name = "VisualRange", description = "Shows players who enter and leave range in chat", category = Module.Category.COMBAT)
public class VisualRange extends Module {
private Setting<Boolean> leaving = register(Settings.b("Leaving", false));
private Setting<Boolean> uwuAura = register(Settings.b("uwu Aura", false));
private Setting<Boolean> uwuAura = register(Settings.b("UwU Aura", false));
private List<String> knownPlayers;
@Override
public void onUpdate() {
if (mc.player == null) {
return;
}
if (mc.player == null) return;
List<String> tickPlayerList = new ArrayList<>();
for (Entity entity : mc.world.getLoadedEntityList()) {
if (entity instanceof EntityPlayer) {
tickPlayerList.add(entity.getName());
}
if (entity instanceof EntityPlayer) tickPlayerList.add(entity.getName());
}
if (tickPlayerList.size() > 0) {
for (String playerName : tickPlayerList) {
if (playerName.equals(mc.player.getName())) {
continue;
}
if (playerName.equals(mc.player.getName())) continue;
if (!knownPlayers.contains(playerName)) {
knownPlayers.add(playerName);
if (Friends.isFriend(playerName)) {
@ -57,22 +48,16 @@ public class VisualRange extends Module {
} else {
sendNotification(ChatFormatting.RED.toString() + playerName + ChatFormatting.RESET.toString() + " entered the Battlefield!");
}
if (uwuAura.getValue()) {
Minecraft.getMinecraft().playerController.connection.sendPacket(new CPacketChatMessage("/w "+ playerName + " hi uwu"));
}
if (uwuAura.getValue()) Minecraft.getMinecraft().playerController.connection.sendPacket(new CPacketChatMessage("/w "+ playerName + " hi uwu"));
return;
}
}
}
if (knownPlayers.size() > 0) {
for (String playerName : knownPlayers) {
if (!tickPlayerList.contains(playerName)) {
knownPlayers.remove(playerName);
if (leaving.getValue()) {
@ -81,13 +66,10 @@ public class VisualRange extends Module {
} else {
sendNotification(ChatFormatting.RED.toString() + playerName + ChatFormatting.RESET.toString() + " left the Battlefield!");
}
if (uwuAura.getValue()) {
Minecraft.getMinecraft().playerController.connection.sendPacket(new CPacketChatMessage("/w "+ playerName + " bye uwu"));
}
if (uwuAura.getValue()) Minecraft.getMinecraft().playerController.connection.sendPacket(new CPacketChatMessage("/w "+ playerName + " bye uwu"));
}
return;
}
}
}