Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

Commit

Permalink
Improve backend and remove unneeded printing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kopamed committed Jun 7, 2022
1 parent b6c8fa3 commit 9c962ac
Show file tree
Hide file tree
Showing 93 changed files with 266 additions and 672 deletions.
Binary file modified build/libs/[1.8.9] BetterKeystrokes V-1.2.jar
Binary file not shown.
24 changes: 0 additions & 24 deletions src/main/java/keystrokesmod/client/NotificationRenderer.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public void setModuleStartAt(int n) {


public void mouseDown(int x, int y, int b) {
System.out.println(i(x,y) + " " + this.x + " " + this.y + " " + x + " " + y);
if(i(x, y))
this.mode.nextMode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ public void mouseDown(int x, int y, int b) {
this.mouseDown = true;
}

// Put breakpoints instead of doing that:
//System.out.println("Clicked");
}

public void mouseReleased(int x, int y, int m) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void onCall(String[] args) {
try {
url = new URL(Raven.sourceLocation);
Utils.Client.openWebpage(url);
Utils.Client.openWebpage(new URL(Raven.downloadLocation));
CommandLine.print("&aOpened page successfully!", 0);
} catch (MalformedURLException e) {
e.printStackTrace();
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/keystrokesmod/client/config/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
Expand Down Expand Up @@ -82,7 +83,6 @@ public Config getConfig(){
}

public void save(){
System.out.println("Saving");
JsonObject data = new JsonObject();
data.addProperty("version", Raven.versionManager.getClientVersion().getVersion());
data.addProperty("author", "Unknown");
Expand All @@ -92,7 +92,7 @@ public void save(){
data.addProperty("lastEditTime", System.currentTimeMillis());

JsonObject modules = new JsonObject();
for(Module module : ModuleManager.getModules()){
for(Module module : Raven.moduleManager.getModules()){
modules.add(module.getName(), module.getConfigAsJson());
}
data.add("modules", modules);
Expand All @@ -103,7 +103,8 @@ public void save(){
public void setConfig(Config config){
this.config = config;
JsonObject data = config.getData().get("modules").getAsJsonObject();
for(Module module : ModuleManager.getModules()){
List<Module> knownModules = new ArrayList<>(Raven.moduleManager.getModules());
for(Module module : knownModules){
if(data.has(module.getName())){
module.applyConfigFromJson(
data.get(module.getName()).getAsJsonObject()
Expand Down Expand Up @@ -132,7 +133,7 @@ public void copyConfig(Config config, String s) {
}

public void resetConfig() {
for(Module module : ModuleManager.getModules())
for(Module module : Raven.moduleManager.getModules())
module.resetToDefaults();
save();
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions src/main/java/keystrokesmod/client/main/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ public void applyConfig(){
Raven.getExecutor().execute(() -> {
if (!Utils.URLS.isHypixelKeyValid(Utils.URLS.hypixelApiKey)) {
Utils.URLS.hypixelApiKey = "";
////System.out.println("Invalid key!");
} else{
////System.out.println("Valid key!");
}

});
Expand Down Expand Up @@ -168,9 +166,6 @@ private List<String> parseConfigFile() {
}

private void loadClickGuiCoords(String decryptedString) {
//clickgui config
// categoryname:x:y:opened
////System.out.println(decryptedString);
for (String what : decryptedString.split("/")){
for (CategoryComponent cat : Raven.clickGui.getCategoryList()) {
if(what.startsWith(cat.categoryName.name())){
Expand Down
14 changes: 4 additions & 10 deletions src/main/java/keystrokesmod/client/main/Raven.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import keystrokesmod.client.utils.version.VersionManager;
import keystrokesmod.keystroke.KeyStrokeRenderer;
import keystrokesmod.client.NotificationRenderer;
import keystrokesmod.client.clickgui.raven.ClickGui;
import keystrokesmod.client.command.CommandManager;
import keystrokesmod.client.config.ConfigManager;
Expand All @@ -16,7 +15,6 @@
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;

Expand All @@ -33,12 +31,13 @@ public class Raven {
public static final VersionManager versionManager = new VersionManager();
public static CommandManager commandManager;
public static final String sourceLocation = "https://github.com/Kopamed/Raven-bPLUS";
public static final String downloadLocation = "https://github.com/Kopamed/Raven-bPLUS/raw/main/build/libs/%5B1.8.9%5D%20BetterKeystrokes%20V-1.2.jar";
public static final String discord = "https://discord.gg/QQMQfCRyNP";
public static String[] updateText = {"Your version of Raven B+ (" + versionManager.getClientVersion().toString() + ") is outdated!", "Enter the command update into client CommandLine to open the download page", "or just enable the update module to get a message in chat.", "", "Newest version: " + versionManager.getLatestVersion().toString()};
public static ConfigManager configManager;
public static ClientConfig clientConfig;

public static final ModuleManager moduleManager;
public static final ModuleManager moduleManager = new ModuleManager();

public static ClickGui clickGui;
//public static TabGui tabGui;
Expand All @@ -53,9 +52,6 @@ public class Raven {
static {
osName = System.getProperty("os.name").toLowerCase();
osArch = System.getProperty("os.arch").toLowerCase();

moduleManager = new ModuleManager();
moduleManager.init();
}

public static void init() {
Expand All @@ -79,8 +75,6 @@ public static void init() {
mResourceLocation = null;
}

moduleManager.init();

ClientConfig.applyKeyStrokeSettingsFromConfigFile();
commandManager = new CommandManager();
clickGui = new ClickGui();
Expand All @@ -101,8 +95,8 @@ public static void init() {
public void onTick(ClientTickEvent event) {
if (event.phase == Phase.END) {
if (Utils.Player.isPlayerInGame()) {
for (int i = 0; i < ModuleManager.modListSize(); i++) {
Module module = ModuleManager.modsList.get(i);
for (int i = 0; i < moduleManager.numberOfModules(); i++) {
Module module = moduleManager.getModules().get(i);
if (Minecraft.getMinecraft().currentScreen == null) {
module.keybind();
} else if (Minecraft.getMinecraft().currentScreen instanceof ClickGui) {
Expand Down
Loading

0 comments on commit 9c962ac

Please sign in to comment.