Skip to content

Commit

Permalink
Merge pull request #81 from csskroubledev/feat/evenDistributionFor118
Browse files Browse the repository at this point in the history
feat: add config for even distrubition
  • Loading branch information
Edivad99 authored May 2, 2024
2 parents f6b40e1 + 1db133b commit bb2a6c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public int getUpdateInterval()
public int getMaximumSuccessfulCraftingUpdates()
{
int speed = getTierSpeed();
if(hasConnectedInventory())
if(Config.AdvancedCrafter.UNIFORMLY_DISTRIBUTE_PROCESSING.get() && hasConnectedInventory())
return Math.min(speed, getConnectedInventory().getSlots());
return speed;
}
Expand All @@ -305,7 +305,7 @@ public int getTierSpeed() {
int upgradesCount = upgrades.getUpgradeCount(UpgradeItem.Type.SPEED);
if(tier.equals(CrafterTier.IRON))
return upgradesCount + tier.getCraftingSpeed();
return (upgradesCount * (tier.getCraftingSpeed() / 5)) + tier.getCraftingSpeed();//PREV Min:1 Max:5
return (upgradesCount * (tier.getCraftingSpeed() / 5)) + tier.getCraftingSpeed();
}

@Nullable
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/edivad/extrastorage/setup/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static void init() {
public static class AdvancedCrafter {
public static ForgeConfigSpec.IntValue BASE_ENERGY;
public static ForgeConfigSpec.BooleanValue INCLUDE_PATTERN_ENERGY;
public static ForgeConfigSpec.BooleanValue UNIFORMLY_DISTRIBUTE_PROCESSING;

public static void registerServerConfig(ForgeConfigSpec.Builder SERVER_BUILDER) {
SERVER_BUILDER.push("crafters");
Expand All @@ -30,6 +31,11 @@ public static void registerServerConfig(ForgeConfigSpec.Builder SERVER_BUILDER)
.comment("Include the amount of patterns in the crafter in your power consumption")
.define("include_pattern_energy", true);

UNIFORMLY_DISTRIBUTE_PROCESSING = SERVER_BUILDER
.comment("The crafter's speed is limited to the number of available slots in the inventory it is connected to.",
"https://github.com/Edivad99/ExtraStorage/issues/55")
.define("uniformly_distribute_processing", false);

SERVER_BUILDER.pop();
}
}
Expand Down

0 comments on commit bb2a6c1

Please sign in to comment.