Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
cally72jhb authored Mar 30, 2022
1 parent 6c487ec commit 9184262
Show file tree
Hide file tree
Showing 23 changed files with 1,195 additions and 417 deletions.
69 changes: 0 additions & 69 deletions src/main/java/cally72jhb/addon/VectorAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,17 @@

import cally72jhb.addon.system.Systems;
import cally72jhb.addon.system.categories.Categories;
import cally72jhb.addon.system.players.Player;
import cally72jhb.addon.system.players.Players;
import cally72jhb.addon.utils.VectorUtils;
import cally72jhb.addon.utils.config.VectorConfig;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.addons.GithubRepo;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.events.game.GameJoinedEvent;
import meteordevelopment.meteorclient.events.game.ReceiveMessageEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.utils.misc.text.ColoredText;
import meteordevelopment.meteorclient.utils.misc.text.TextUtils;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.ArrayList;

public class VectorAddon extends MeteorAddon {
public static final Logger LOG = LogManager.getLogger();

Expand All @@ -38,7 +25,6 @@ public void onInitialize() {

MeteorClient.EVENT_BUS.subscribe(this);

VectorUtils.members();
VectorUtils.changeIcon();

VectorUtils.postInit();
Expand All @@ -56,16 +42,6 @@ public void onRegisterCategories() {
Modules.registerCategory(Categories.Combat);
}

@Override
public GithubRepo getRepo() {
return new GithubRepo("cally72jhb", "vector-addon");
}

@Override
public String getWebsite() {
return "https://cally72jhb.github.io/website";
}

@EventHandler
private void onPreTick(TickEvent.Pre event) {
if (VectorUtils.screen != null) {
Expand All @@ -76,51 +52,6 @@ private void onPreTick(TickEvent.Pre event) {

@EventHandler
private void onGameJoin(GameJoinedEvent event) {
VectorUtils.members();

ChatUtils.registerCustomPrefix("cally72jhb.addon", VectorUtils::getPrefix);
}

@EventHandler
private void onMessageReceive(ReceiveMessageEvent event) {
LiteralText finalText = new LiteralText("");
Text message = event.getMessage();

boolean replace = false;

ArrayList<String> strings = new ArrayList<>();
if (VectorConfig.get() != null && VectorConfig.get().highlightMembers && VectorUtils.members != null && !VectorUtils.members.isEmpty()) strings.addAll(VectorUtils.members);

for (String string : strings) {
for (ColoredText text : TextUtils.toColoredTextList(message)) {
if (text.getText().contains(string)) {
replace = true;

String first = text.getText().substring(0, text.getText().indexOf(string));
String middle = text.getText().substring(text.getText().indexOf(string), text.getText().indexOf(string) + string.length());
String last = text.getText().substring(text.getText().indexOf(string) + string.length());

finalText.append(new LiteralText(first).setStyle(Style.EMPTY.withColor(text.getColor().getPacked())));
finalText.append(new LiteralText(middle).formatted(Formatting.GOLD));
finalText.append(new LiteralText(last).setStyle(Style.EMPTY.withColor(text.getColor().getPacked())));
} else {
finalText.append(new LiteralText(text.getText()).setStyle(Style.EMPTY.withColor(text.getColor().getPacked())));
}
}

message = finalText;
finalText = new LiteralText("");
}

if (replace) event.setMessage(message);

if (Players.get() != null) {
for (Player player : Players.get()) {
if (!event.getMessage().getString().contains("muted " + player.name) && player.muted && event.getMessage().getString().contains(player.name)) {
System.out.println(event.getMessage().getString());
event.cancel();
}
}
}
}
}
29 changes: 0 additions & 29 deletions src/main/java/cally72jhb/addon/gui/tabs/VectorConfigTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,6 @@ public class VectorConfigTab extends Tab {
}).build()
);

public static final Setting<Boolean> highlightMembers = sgMisc.add(new BoolSetting.Builder()
.name("highlight-members")
.description("Highlights Vector Users for you.")
.defaultValue(true)
.onChanged(bool -> VectorConfig.get().highlightMembers = bool)
.onModuleActivated(bool -> {
bool.set(VectorConfig.get().highlightMembers);
VectorUtils.members();
}).build()
);

public static final Setting<SettingColor> memberColor = sgMisc.add(new ColorSetting.Builder()
.name("member-color")
.description("The color the Vector Users will be highlighted with.")
.defaultValue(new SettingColor(255, 255, 145))
.onChanged(color -> VectorConfig.get().memberColor = color)
.onModuleActivated(color -> color.set(VectorConfig.get().memberColor))
.visible(highlightMembers::get)
.build()
);

public static ConfigScreen currentScreen;

public VectorConfigTab() {
Expand All @@ -140,14 +119,6 @@ public ConfigScreen(GuiTheme theme, Tab tab) {
@Override
public void initWidgets() {
add(theme.settings(settings)).expandX();

WTable table = add(theme.table()).expandX().minWidth(300).widget();

WButton reload = table.add(theme.button("Reload")).widget();

reload.action = VectorUtils::members;

table.row();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cally72jhb/addon/mixin/EntityMixin.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cally72jhb.addon.mixin;

import cally72jhb.addon.system.modules.movement.AntiPistonPush;
import cally72jhb.addon.system.modules.movement.NoFluid;
import cally72jhb.addon.system.modules.movement.AntiProne;
import cally72jhb.addon.system.modules.movement.NoFluid;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.block.piston.PistonBehavior;
import net.minecraft.entity.Entity;
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/cally72jhb/addon/mixin/MinecraftClientMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cally72jhb.addon.mixin;

import cally72jhb.addon.system.events.InteractEvent;
import cally72jhb.addon.system.modules.player.MultiTask;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(MinecraftClient.class)
public class MinecraftClientMixin {
@Redirect(method = "handleBlockBreaking", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isUsingItem()Z"))
public boolean onHandleBlockBreaking(ClientPlayerEntity player) {
return !Modules.get().isActive(MultiTask.class) && MeteorClient.EVENT_BUS.post(InteractEvent.get(player.isUsingItem())).usingItem;
}

@Redirect(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;isBreakingBlock()Z"))
public boolean onDoItemUse(ClientPlayerInteractionManager manager) {
return !Modules.get().isActive(MultiTask.class) && MeteorClient.EVENT_BUS.post(InteractEvent.get(manager.isBreakingBlock())).usingItem;
}
}
5 changes: 5 additions & 0 deletions src/main/java/cally72jhb/addon/system/Systems.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import cally72jhb.addon.system.hud.StatsHud;
import cally72jhb.addon.system.modules.combat.BedBomb;
import cally72jhb.addon.system.modules.combat.BowBomb;
import cally72jhb.addon.system.modules.combat.PacketBurrow;
import cally72jhb.addon.system.modules.combat.VectorSurround;
import cally72jhb.addon.system.modules.misc.*;
import cally72jhb.addon.system.modules.movement.*;
Expand Down Expand Up @@ -62,13 +63,16 @@ public static void init() {
add(new BorderBypass());
add(new BowBomb());
//add(new CevBreaker());
add(new ChatEncryption());
add(new ChorusPredict());
add(new DeathAnimations());
add(new EntityFly());
add(new InstaMinePlus());
add(new InventoryScroll());
add(new ItemRelease());
add(new MultiTask());
add(new NoFluid());
add(new PacketBurrow());
add(new PacketConsume());
add(new PacketFly());
add(new PacketLogger());
Expand All @@ -81,6 +85,7 @@ public static void init() {
add(new SpeedBypass());
add(new StepPlus());
add(new StorageViewer());
add(new TickShift());
add(new Tower());
add(new VectorPresence());
add(new VectorSurround());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cally72jhb.addon.system.commands;

import com.google.common.collect.Lists;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/cally72jhb/addon/system/events/InteractEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package cally72jhb.addon.system.events;

public class InteractEvent {
private static final InteractEvent INSTANCE = new InteractEvent();
public boolean usingItem;

public static InteractEvent get(boolean usingItem) {
INSTANCE.usingItem = usingItem;
return INSTANCE;
}
}
Loading

0 comments on commit 9184262

Please sign in to comment.