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 Apr 11, 2022
1 parent 2a067cc commit 915a54e
Show file tree
Hide file tree
Showing 36 changed files with 4,358 additions and 821 deletions.
261 changes: 205 additions & 56 deletions src/main/java/cally72jhb/addon/Main.java
Original file line number Diff line number Diff line change
@@ -1,74 +1,223 @@
package cally72jhb.addon;

import javax.swing.*;
import cally72jhb.addon.utils.window.ExternalPanel;
import cally72jhb.addon.utils.window.Text;
import cally72jhb.addon.utils.window.theme.LightTheme;

import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;

public class Main {
private static boolean nogui = false;
private static boolean debug = false;

public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
}
System.out.println();
System.out.println("arguments: -nogui -bettergui -debug");
System.out.println("arguments: /nogui /bettergui /debug");
System.out.println();
System.out.println("used arguments: " + Arrays.toString(args));
System.out.println("validating arguments:");

int option = JOptionPane.showOptionDialog(
null,
"To install Vector Addon you need to put it in your mods folder and run it with Meteor Client and Fabric for latest Minecraft version.",
"Vector Addon Install Guide",
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
new String[] { "Open Fabric link", "Open mods folder" },
null
);

if (option == 0) {
openUrl("http://fabricmc.net");
} else if (option == 1) {
String os = System.getProperty("os.name").toLowerCase();

try {
if (os.contains("win")) {
if (Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {
String path = System.getenv("AppData") + "/.minecraft/mods";
new File(path).mkdirs();
Desktop.getDesktop().open(new File(path));
}
} else if (os.contains("mac")) {
String path = System.getProperty("user.home") + "/Library/Application Support/minecraft/mods";
new File(path).mkdirs();
ProcessBuilder pb = new ProcessBuilder("open", path);
Process process = pb.start();
} else if (os.contains("nix") || os.contains("nux")) {
String path = System.getProperty("user.home") + "/.minecraft";
new File(path).mkdirs();
Runtime.getRuntime().exec("xdg-open \"" + path + "\"");
for (String string : args) {
if ((string.startsWith("-") || string.startsWith("/"))) {
if (string.contains("nogui") || string.contains("bettergui")) {
nogui = true;
System.out.println("Better GUI disabled!");
break;
} else if (string.contains("debug")) {
debug = true;
print("entering debug mode");
break;
}
} catch (IOException e) {
e.printStackTrace();
}
}

System.out.println("Done validating arguments!");
System.out.println("Creating main Window...");
System.out.println();

ExternalPanel panel = new ExternalPanel(600, 320, 600, 320, new LightTheme(), "Vector Addon", !nogui);

System.out.println("width: 600 | min-width: 600 | height: 320 | min-height: 320 | title: Vector Addon | Custom GUI: " + !nogui);
System.out.println("Created window");
print("now obtaining home path...");

ArrayList<ArrayList<Text>> content = new ArrayList<>();

String path = switch (getOperatingSystem()) {
case WINDOWS -> System.getenv("AppData") + "/.minecraft/mods";
case OSX -> System.getProperty("user.home") + "/Library/Application Support/minecraft/mods";
default -> System.getProperty("user.home") + "/.minecraft";
};

File mods = new File(path);
if (!mods.exists()) {
print("Creating mods folder here: " + mods.getAbsolutePath());

if (mods.mkdirs()) {
print("Successfully created mods folder!");
} else {
print("Failed to create mods folder!");
}
} else {
print("Mods folder found: " + mods.getAbsolutePath());
}

print("Setting up content...");

content.add(getSpace());
content.add(getLine("Vector Addon", new Color(75, 125, 85), 1));
content.add(getSpace());
content.add(getLines(
new Text("Vector is a free open-source Addon for ", new Color(0, 0, 0), 0),
new Text("Meteor Client", new Color(145,61,226), 0),
new Text(".", new Color(0, 0, 0), 0)));
content.add(getLine("It provides many utility and strong combat modules.", new Color(0, 0, 0), 0));
content.add(getLine("To install Vector correctly put it along side with Meteor Client in your", new Color(0, 0, 0), 0));
content.add(getLine("mods folder which can be found here: ", new Color(0, 0, 0), 0));
content.add(getSpace());
content.add(getLine(mods.getAbsolutePath(), new Color(33, 67, 122), 0));
content.add(getSpace());

// Modules

content.add(getLine("Modules:", new Color(75, 75, 75), 1));

content.add(getLine("- ActionRenderer", new Color(0, 0, 0), 0));
content.add(getLine("- AntiPistonPush", new Color(0, 0, 0), 0));
content.add(getLine("- AntiProne", new Color(0, 0, 0), 0));
content.add(getLine("- AutoCope", new Color(0, 0, 0), 0));
content.add(getLine("- AutoCraft", new Color(0, 0, 0), 0));
content.add(getLine("- AutoEz", new Color(0, 0, 0), 0));
content.add(getLine("- AutoInteract", new Color(0, 0, 0), 0));
content.add(getLine("- BedBomb", new Color(0, 0, 0), 0));
content.add(getLine("- BlinkPlus", new Color(0, 0, 0), 0));
content.add(getLine("- BorderBypass", new Color(0, 0, 0), 0));
content.add(getLine("- BowBomb", new Color(0, 0, 0), 0));
content.add(getLine("- ChatEncryption", new Color(0, 0, 0), 0));
content.add(getLine("- ChorusPredict", new Color(0, 0, 0), 0));
content.add(getLine("- DeathAnimations", new Color(0, 0, 0), 0));
content.add(getLine("- EntityFly", new Color(0, 0, 0), 0));
content.add(getLine("- InstaMinePlus", new Color(0, 0, 0), 0));
content.add(getLine("- InventoryScroll", new Color(0, 0, 0), 0));
content.add(getLine("- ItemRelease", new Color(0, 0, 0), 0));
content.add(getLine("- MultiTask", new Color(0, 0, 0), 0));
content.add(getLine("- NoFluid", new Color(0, 0, 0), 0));
content.add(getLine("- PacketConsume", new Color(0, 0, 0), 0));
content.add(getLine("- PacketFly", new Color(0, 0, 0), 0));
content.add(getLine("- PacketLogger", new Color(0, 0, 0), 0));
content.add(getLine("- PacketPlace", new Color(0, 0, 0), 0));
content.add(getLine("- PingSpoof", new Color(0, 0, 0), 0));
content.add(getLine("- Placeholders", new Color(0, 0, 0), 0));
content.add(getLine("- PopRenderer", new Color(0, 0, 0), 0));
content.add(getLine("- PortalGodMode", new Color(0, 0, 0), 0));
content.add(getLine("- SkeletonESP", new Color(0, 0, 0), 0));
content.add(getLine("- SpeedBypass", new Color(0, 0, 0), 0));
content.add(getLine("- StepPlus", new Color(0, 0, 0), 0));
content.add(getLine("- StorageViewer", new Color(0, 0, 0), 0));
content.add(getLine("- TickShift", new Color(0, 0, 0), 0));
content.add(getLine("- Tower", new Color(0, 0, 0), 0));
content.add(getLine("- VectorPresence", new Color(0, 0, 0), 0));
content.add(getLine("- VectorSurround", new Color(0, 0, 0), 0));
content.add(getLine("- Welcomer", new Color(0, 0, 0), 0));

content.add(getSpace());
content.add(getSpace());

// Commands

content.add(getLine("Commands:", new Color(75, 75, 75), 1));

content.add(getLine("- ItemCommand", new Color(0, 0, 0), 0));
content.add(getLine("- MuteCommand", new Color(0, 0, 0), 0));
content.add(getLine("- StatsCommand", new Color(0, 0, 0), 0));
content.add(getLine("- TargetCommand", new Color(0, 0, 0), 0));
content.add(getLine("- TrashCommand", new Color(0, 0, 0), 0));
content.add(getLine("- UUIDCommand", new Color(0, 0, 0), 0));

print();
print("Refreshing content & making window visible");
print();

panel.setContent(content);
panel.setVisible(true);

print("Window successfully created!");
}

public static void openUrl(String url) {
String os = System.getProperty("os.name").toLowerCase();
// Debug Logger

try {
if (os.contains("win")) {
if (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
Desktop.getDesktop().browse(new URI(url));
}
} else if (os.contains("mac")) {
Runtime.getRuntime().exec("open " + url);
} else if (os.contains("nix") || os.contains("nux")) {
Runtime.getRuntime().exec("xdg-open " + url);
private static void print() {
print("");
}

private static void print(String string) {
if (debug) {
if (string.isEmpty()) {
System.out.println();
} else {
System.out.println(string);
}
}
}

// Text Utils

private static ArrayList<Text> getSpace() {
print();

return new ArrayList<>() {{
add(new Text("", new Color(0, 0, 0), 0));
}};
}

private static ArrayList<Text> getLine(String string, Color color, int type) {
print(string);

return new ArrayList<>() {{
add(new Text(string, color, type));
}};
}

private static ArrayList<Text> getLines(Text... message) {
return new ArrayList<>() {{
for (Text text : message) {
add(text);

print(text.getText());
}
} catch (URISyntaxException | IOException e) {
e.printStackTrace();
}};
}

// Operating System

private static OperatingSystem getOperatingSystem() {
String os = System.getProperty("os.name").toLowerCase(Locale.ROOT);

if (os.contains("win")) {
return OperatingSystem.WINDOWS;
} else if (os.contains("mac")) {
return OperatingSystem.OSX;
} else if (os.contains("solaris")) {
return OperatingSystem.SOLARIS;
} else if (os.contains("sunos")) {
return OperatingSystem.SOLARIS;
} else if (os.contains("linux")) {
return OperatingSystem.LINUX;
} else {
return os.contains("unix") ? OperatingSystem.LINUX : OperatingSystem.UNKNOWN;
}
}

private enum OperatingSystem {
OSX,
LINUX,
SOLARIS,
WINDOWS,
UNKNOWN
}
}
2 changes: 0 additions & 2 deletions src/main/java/cally72jhb/addon/gui/tabs/VectorConfigTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import meteordevelopment.meteorclient.gui.tabs.Tab;
import meteordevelopment.meteorclient.gui.tabs.TabScreen;
import meteordevelopment.meteorclient.gui.tabs.WindowTabScreen;
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
import meteordevelopment.meteorclient.gui.widgets.pressable.WButton;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.utils.misc.NbtUtils;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
Expand Down
17 changes: 6 additions & 11 deletions src/main/java/cally72jhb/addon/system/Systems.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cally72jhb.addon.system;

import cally72jhb.addon.gui.tabs.PlayersTab;
import cally72jhb.addon.gui.tabs.TitleScreenTab;
import cally72jhb.addon.gui.tabs.VectorConfigTab;
import cally72jhb.addon.system.commands.*;
import cally72jhb.addon.system.hud.CustomChatHud;
Expand All @@ -10,14 +9,15 @@
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.*;
import cally72jhb.addon.system.modules.player.*;
import cally72jhb.addon.system.modules.render.*;
import cally72jhb.addon.system.modules.render.ActionRenderer;
import cally72jhb.addon.system.modules.render.PopRenderer;
import cally72jhb.addon.system.modules.render.SkeletonESP;
import cally72jhb.addon.system.modules.render.StorageViewer;
import cally72jhb.addon.system.players.Players;
import cally72jhb.addon.system.titlescreen.TitleScreenManager;
import cally72jhb.addon.utils.config.VectorConfig;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.events.game.GameLeftEvent;
Expand Down Expand Up @@ -58,8 +58,8 @@ public static void init() {
add(new AutoCope());
add(new AutoCraft());
add(new AutoEz());
add(new AutoInteract());
add(new BedBomb());
add(new BlinkPlus());
add(new BorderBypass());
add(new BowBomb());
//add(new CevBreaker());
Expand All @@ -70,9 +70,7 @@ public static void init() {
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,8 +79,8 @@ public static void init() {
add(new Placeholders());
add(new PopRenderer());
add(new PortalGodMode());
add(new RubberbandFly());
add(new SkeletonESP());
add(new SpeedBypass());
add(new StepPlus());
add(new StorageViewer());
add(new TickShift());
Expand All @@ -99,15 +97,12 @@ public static void init() {
add(new TrashCommand());
add(new UUIDCommand());

add(new TitleScreenManager());
add(new Players());
add(new VectorConfig());

TitleScreenManager.get().init();
Players.get().init();
VectorConfig.get().init();

Tabs.get().add(new TitleScreenTab());
Tabs.get().add(new VectorConfigTab());
Tabs.get().add(new PlayersTab());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void clickSlot(int slot){
}

private void clickSlot(int syncId, int id, int button, SlotActionType action) {
if (id > 0) {
if (id > 0 && button > 0) {
ScreenHandler handler = mc.player.currentScreenHandler;

DefaultedList<Slot> slots = handler.slots;
Expand Down
Loading

0 comments on commit 915a54e

Please sign in to comment.