Skip to content

Commit

Permalink
fix formatting and remaining issues, fix StartsWithTerminalSolver
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamKracker committed Dec 24, 2024
1 parent 55e2886 commit 9e826b3
Show file tree
Hide file tree
Showing 6 changed files with 350 additions and 374 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.3 2024-12-23T13:05:01.4950796 cookies-mod/Language (en_us)
// 1.21.3 2024-12-24T02:43:54.214095 cookies-mod/Language (en_us)
221fcc1e2c7a96aab55552e72cd228815baa08ea assets\cookies-mod\lang\en_us.json
80 changes: 42 additions & 38 deletions src/main/java/codes/cookies/mod/CookiesMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
import codes.cookies.mod.utils.dev.DevUtils;
import codes.cookies.mod.utils.skyblock.LocationUtils;
import codes.cookies.mod.utils.skyblock.MayorUtils;
import codes.cookies.mod.utils.skyblock.PartyUtils;
import codes.cookies.mod.utils.skyblock.playerlist.PlayerListUtils;
import lombok.Getter;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
Expand All @@ -55,51 +57,53 @@ public class CookiesMod implements ClientModInitializer {
private static KeyBinding useGardenKeybinds;
public static KeyBinding pasteCommandFromClipboard;
@Getter
private static final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(4);

/**
* Opens the config screen.
*/
public static void openConfig() {
openScreen(new ConfigScreen(ConfigManager.getConfigReader()));
}

/**
* Opens the provided screen.
*
* @param screen The screen to open.
*/
public static void openScreen(Screen screen) {
MinecraftClient.getInstance().send(() -> MinecraftClient.getInstance().setScreen(screen));
}
private static final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(4);

/**
* Opens the config screen.
*/
public static void openConfig() {
openScreen(new ConfigScreen(ConfigManager.getConfigReader()));
}

/**
* Opens the provided screen.
*
* @param screen The screen to open.
*/
public static void openScreen(Screen screen) {
MinecraftClient.getInstance().send(() -> MinecraftClient.getInstance().setScreen(screen));
}

@Override
public void onInitializeClient() {
CommandManager.initialize();
public void onInitializeClient() {
CommandManager.initialize();
CookieDataManager.load();
ProfileStorage.register();
Repository.loadRepository();
ProfileStorage.register();
Repository.loadRepository();
HypixelModAPI.getInstance().subscribeToEventPacket(ClientboundLocationPacket.class);
MayorUtils.load();
EventLoader.load();
EventLoader.load();
ApiManager.initialize();
Features.load();
CommandManager.addCommands(new OpenConfigCommand(), new DevCommand(), new CookieCommand(), new ViewForgeRecipeCommand());
CommandManager.addCommands(RepositoryConstants.warps.getWarps().entrySet().stream().map(WarpCommand::new).toArray(WarpCommand[]::new));
Features.load();
CommandManager.addCommands(new OpenConfigCommand(), new DevCommand(), new CookieCommand(), new ViewForgeRecipeCommand());
CommandManager.addCommands(RepositoryConstants.warps.getWarps().entrySet().stream().map(WarpCommand::new).toArray(WarpCommand[]::new));

UpdateChecker.init();
PlayerListUtils.init();
HudManager.load();
CrystalStatusService.register();
this.registerKeyBindings();
this.registerKeyBindings();
DevUtils.registerDebugs();
}

private void registerKeyBindings() {

}

private void registerKeyBindings() {
chestSearch = KeyBindingHelper.registerKeyBinding(new KeyBinding("cookies.mod.search",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_O,
"cookies.mod.keybinds"));
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_O,
"cookies.mod.keybinds"));
useGardenKeybinds = KeyBindingHelper.registerKeyBinding(new KeyBinding("cookies.mod.garden.keybind_switch",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_K,
Expand All @@ -109,11 +113,11 @@ private void registerKeyBindings() {
GLFW.GLFW_KEY_UNKNOWN,
"cookies.mod.keybinds"));

ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (chestSearch.isPressed()) {
openScreen(new ItemSearchScreen());
}
while(useGardenKeybinds.wasPressed() && LocationUtils.Island.GARDEN.isActive()) {
ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (chestSearch.isPressed()) {
openScreen(new ItemSearchScreen());
}
while (useGardenKeybinds.wasPressed() && LocationUtils.Island.GARDEN.isActive()) {
GardenKeybindPredicate.keyBindToggle = !GardenKeybindPredicate.keyBindToggle;
for (var keybind : KeyBinding.KEYS_BY_ID.values()) {
keybind.setPressed(false);
Expand All @@ -128,8 +132,8 @@ private void registerKeyBindings() {
CookiesUtils.getPlayer().map(player -> player.networkHandler.sendCommand(message.substring(1)));
}
}
});
}
});
}

public static void openHudScreen() {
openScreen(new HudEditScreen());
Expand Down
Loading

0 comments on commit 9e826b3

Please sign in to comment.