Skip to content

Commit

Permalink
Make the calculation depth configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Dec 10, 2024
1 parent 06ab45f commit 75835af
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .idea/runConfigurations/client.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/runConfigurations/data.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/server.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static void init(IEventBus modEventBus) {

public static class ClientConfig {

public ForgeConfigSpec.IntValue CALCULATION_DEPTH;
public ForgeConfigSpec.BooleanValue CRAFT_QUEUE_OVERLAY_HIDE_EMPTY;
public ForgeConfigSpec.IntValue CRAFT_QUEUE_OVERLAY_X;
public ForgeConfigSpec.IntValue CRAFT_QUEUE_OVERLAY_Y;
Expand All @@ -45,6 +46,8 @@ public ClientConfig(ForgeConfigSpec.Builder builder) {
{
builder.push("General");

CALCULATION_DEPTH = builder.comment("").translation(Constants.TRANSLATION_KEY_CONFIG_CLIENT_CALC_DEPTH).defineInRange("calculation_depth", 3, 1, 5);

builder.pop();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class Constants {
public static final String TRANSLATION_KEY_GUI_MSG_SLIST_OVERLAY_MODE_SHOW = "crafttracker.msg.shopping_list_overlay_mode.show";
public static final String TRANSLATION_KEY_GUI_MSG_SLIST_OVERLAY_MODE_DYNAMIC = "crafttracker.msg.shopping_list_overlay_mode.dynamic";

public static final String TRANSLATION_KEY_CONFIG_CLIENT_CALC_DEPTH = "crafttracker.config.client.calculation_depth";
public static final String TRANSLATION_KEY_CONFIG_CLIENT_CRAFT_QUEUE_X = "crafttracker.config.client.craft_queue_x";
public static final String TRANSLATION_KEY_CONFIG_CLIENT_CRAFT_QUEUE_Y = "crafttracker.config.client.craft_queue_y";
public static final String TRANSLATION_KEY_CONFIG_CLIENT_CRAFT_QUEUE_WIDTH = "crafttracker.config.client.craft_queue_width";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sweetrpg.crafttracker.common.manager;

import com.sweetrpg.crafttracker.CraftTracker;
import com.sweetrpg.crafttracker.common.config.ConfigHandler;
import com.sweetrpg.crafttracker.common.model.CraftingQueueItem;
import com.sweetrpg.crafttracker.common.model.CraftingQueueProduct;
import com.sweetrpg.crafttracker.common.storage.CraftingQueueStorage;
Expand Down Expand Up @@ -41,7 +42,7 @@ public class CraftingQueueManager {

public static CraftingQueueManager INSTANCE = new CraftingQueueManager();

private static final int MAX_PROCESSING_LEVEL = 3;
private static final int MAX_PROCESSING_LEVEL = ConfigHandler.CLIENT.CALCULATION_DEPTH.get();

private Map<ResourceLocation, CraftingQueueProduct> endProducts = new HashMap<>();
private Map<ResourceLocation, CraftingQueueItem> intermediateProducts = new HashMap<>();
Expand Down

0 comments on commit 75835af

Please sign in to comment.