diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java index c3347be1f..c67803c40 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java @@ -1,6 +1,5 @@ package com.refinedmods.refinedstorage.common; -import com.refinedmods.refinedstorage.api.autocrafting.PatternRepositoryImpl; import com.refinedmods.refinedstorage.api.network.autocrafting.AutocraftingNetworkComponent; import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; import com.refinedmods.refinedstorage.api.network.impl.autocrafting.AutocraftingNetworkComponentImpl; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java index 4954b9077..3daa6a815 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Config.java @@ -73,7 +73,7 @@ public interface Config { RelayEntry getRelay(); - SimpleEnergyUsageEntry getAutocrafter(); + AutocrafterEntry getAutocrafter(); interface SimpleEnergyUsageEntry { long getEnergyUsage(); @@ -208,4 +208,8 @@ interface RelayEntry { long getOutputNetworkEnergyUsage(); } + + interface AutocrafterEntry extends SimpleEnergyUsageEntry { + long getEnergyUsagePerPattern(); + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlockEntity.java index 37faee307..2bc3d18c5 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AutocrafterBlockEntity.java @@ -40,7 +40,6 @@ import static com.refinedmods.refinedstorage.common.support.AbstractDirectionalBlock.tryExtractDirection; -// TODO: More energy usage for more patterns. public class AutocrafterBlockEntity extends AbstractBaseNetworkNodeContainerBlockEntity implements ExtendedMenuProvider, BlockEntityWithDrops, PatternInventory.Listener { static final int PATTERNS = 9; @@ -65,11 +64,18 @@ public AutocrafterBlockEntity(final BlockPos pos, final BlockState state) { ); this.upgradeContainer = new UpgradeContainer(UpgradeDestinations.AUTOCRAFTER, upgradeEnergyUsage -> { final long baseEnergyUsage = Platform.INSTANCE.getConfig().getAutocrafter().getEnergyUsage(); - mainNetworkNode.setEnergyUsage(baseEnergyUsage + upgradeEnergyUsage); + final long patternEnergyUsage = patternContainer.getEnergyUsage(); + mainNetworkNode.setEnergyUsage(baseEnergyUsage + patternEnergyUsage + upgradeEnergyUsage); setChanged(); }); - patternContainer.addListener(container -> setChanged()); - patternContainer.setListener(this); + this.patternContainer.addListener(container -> { + final long upgradeEnergyUsage = upgradeContainer.getEnergyUsage(); + final long baseEnergyUsage = Platform.INSTANCE.getConfig().getAutocrafter().getEnergyUsage(); + final long patternEnergyUsage = patternContainer.getEnergyUsage(); + mainNetworkNode.setEnergyUsage(baseEnergyUsage + patternEnergyUsage + upgradeEnergyUsage); + setChanged(); + }); + this.patternContainer.setListener(this); } @Override @@ -91,7 +97,7 @@ private boolean isPartOfChain() { return getChainingRoot() != this; } - // if there is another autocrafter next to us, that is pointing in our direction, + // If there is another autocrafter next to us, that is pointing in our direction, // and we are not part of a chain, we are the head of the chain private boolean isHeadOfChain() { if (level == null || isPartOfChain()) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java index d094ad103..cbb2cfcc7 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternInventory.java @@ -1,6 +1,7 @@ package com.refinedmods.refinedstorage.common.autocrafting; import com.refinedmods.refinedstorage.api.core.NullableType; +import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.support.FilteredContainer; import java.util.Optional; @@ -44,6 +45,17 @@ public void setItem(final int slot, final ItemStack stack) { } } + long getEnergyUsage() { + long patterns = 0; + for (int i = 0; i < getContainerSize(); i++) { + final ItemStack stack = getItem(i); + if (!stack.isEmpty()) { + patterns++; + } + } + return patterns * Platform.INSTANCE.getConfig().getAutocrafter().getEnergyUsagePerPattern(); + } + interface Listener { void patternChanged(int slot); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java index 594b16f5b..300aa23a8 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DefaultEnergyUsage.java @@ -23,6 +23,7 @@ public final class DefaultEnergyUsage { public static final long RELAY_INPUT_NETWORK = 8; public static final long RELAY_OUTPUT_NETWORK = 8; public static final long AUTOCRAFTER = 4; + public static final long AUTOCRAFTER_PER_PATTERN = 2; public static final long CONTROLLER_CAPACITY = 1000; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java index 72b5ef8ca..0473d87b6 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridContainerMenu.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage.api.grid.view.GridView; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.resource.list.MutableResourceList; -import com.refinedmods.refinedstorage.api.resource.list.ResourceList; import com.refinedmods.refinedstorage.common.content.Menus; import com.refinedmods.refinedstorage.common.grid.view.ItemGridResource; import com.refinedmods.refinedstorage.common.support.RedstoneMode; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java index 4b84e266c..24a84c0ef 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java @@ -258,8 +258,8 @@ public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider mainNetworkNode.setPriority(priority); } - private Set getComponentTypes(final CompoundTag tag) { - final Set types = new HashSet<>(); + private Set> getComponentTypes(final CompoundTag tag) { + final Set> types = new HashSet<>(); if (tag.getBoolean(TAG_PASS_ENERGY)) { types.add(RelayComponentType.ENERGY); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayScreen.java index 918e9e804..848997dca 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayScreen.java @@ -107,13 +107,13 @@ private void addFilterButtons(final boolean visible) { ); fuzzyModeButton.visible = visible; addSideButton(fuzzyModeButton); + } + private void addStorageButtons(final boolean visible) { accessModeButton = new AccessModeSideButtonWidget(getMenu().getProperty(StoragePropertyTypes.ACCESS_MODE)); accessModeButton.visible = visible; addSideButton(accessModeButton); - } - private void addStorageButtons(final boolean visible) { priorityButton = PrioritySideButtonWidget.forStorage( getMenu().getProperty(StoragePropertyTypes.PRIORITY), playerInventory, @@ -154,12 +154,12 @@ private void updateFilterButtons(final boolean visible) { if (fuzzyModeButton != null) { fuzzyModeButton.visible = visible; } - if (accessModeButton != null) { - accessModeButton.visible = visible; - } } private void updateStorageButtons(final boolean visible) { + if (accessModeButton != null) { + accessModeButton.visible = visible; + } if (priorityButton != null) { priorityButton.visible = visible; } diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json index 6797e19e1..df57807b1 100644 --- a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -595,6 +595,8 @@ "text.autoconfig.refinedstorage.option.autocrafter.tooltip": "Configuration for the Autocrafter.", "text.autoconfig.refinedstorage.option.autocrafter.energyUsage": "Energy usage", "text.autoconfig.refinedstorage.option.autocrafter.energyUsage.tooltip": "The energy used by the Autocrafter.", + "text.autoconfig.refinedstorage.option.autocrafter.energyUsagePerPattern": "Energy usage per pattern", + "text.autoconfig.refinedstorage.option.autocrafter.energyUsagePerPattern.tooltip": "The additional energy used per pattern.", "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage.connecting": "Connecting", "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java index ed77c12bf..91d5d7024 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ConfigImpl.java @@ -120,9 +120,7 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage.co private RelayEntryImpl relay = new RelayEntryImpl(); @ConfigEntry.Gui.CollapsibleObject - private SimpleEnergyUsageEntryImpl autocrafter = new SimpleEnergyUsageEntryImpl( - DefaultEnergyUsage.AUTOCRAFTER - ); + private AutocrafterEntryImpl autocrafter = new AutocrafterEntryImpl(); public static ConfigImpl get() { return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); @@ -285,7 +283,7 @@ public RelayEntry getRelay() { } @Override - public SimpleEnergyUsageEntry getAutocrafter() { + public AutocrafterEntry getAutocrafter() { return autocrafter; } @@ -725,4 +723,20 @@ public long getOutputNetworkEnergyUsage() { return outputNetworkEnergyUsage; } } + + private static class AutocrafterEntryImpl implements AutocrafterEntry { + private long energyUsage = DefaultEnergyUsage.AUTOCRAFTER; + + private long energyUsagePerPattern = DefaultEnergyUsage.AUTOCRAFTER_PER_PATTERN; + + @Override + public long getEnergyUsagePerPattern() { + return energyUsagePerPattern; + } + + @Override + public long getEnergyUsage() { + return energyUsage; + } + } } diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java index ec2a356bc..96fa0e471 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java @@ -52,7 +52,7 @@ public class ConfigImpl implements Config { private final SimpleEnergyUsageEntry fallbackSecurityCard; private final SimpleEnergyUsageEntry securityManager; private final RelayEntry relay; - private final SimpleEnergyUsageEntry autocrafter; + private final AutocrafterEntryImpl autocrafter; public ConfigImpl() { screenSize = builder @@ -97,7 +97,7 @@ public ConfigImpl() { ); securityManager = new SimpleEnergyUsageEntryImpl("securityManager", DefaultEnergyUsage.SECURITY_MANAGER); relay = new RelayEntryImpl(); - autocrafter = new SimpleEnergyUsageEntryImpl("autocrafter", DefaultEnergyUsage.AUTOCRAFTER); + autocrafter = new AutocrafterEntryImpl(); spec = builder.build(); } @@ -264,7 +264,7 @@ public RelayEntry getRelay() { } @Override - public SimpleEnergyUsageEntry getAutocrafter() { + public AutocrafterEntryImpl getAutocrafter() { return autocrafter; } @@ -925,4 +925,30 @@ public long getOutputNetworkEnergyUsage() { return outputNetworkEnergyUsage.get(); } } + + private class AutocrafterEntryImpl implements AutocrafterEntry { + private final ModConfigSpec.LongValue energyUsage; + private final ModConfigSpec.LongValue energyUsagePerPattern; + + AutocrafterEntryImpl() { + builder.translation(translationKey("autocrafter")).push("autocrafter"); + energyUsage = builder + .translation(translationKey("autocrafter." + ENERGY_USAGE)) + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.AUTOCRAFTER, 0, Long.MAX_VALUE); + energyUsagePerPattern = builder + .translation(translationKey("autocrafter.energyUsagePerPattern")) + .defineInRange("energyUsagePerPattern", DefaultEnergyUsage.AUTOCRAFTER_PER_PATTERN, 0, Long.MAX_VALUE); + builder.pop(); + } + + @Override + public long getEnergyUsagePerPattern() { + return energyUsagePerPattern.get(); + } + + @Override + public long getEnergyUsage() { + return energyUsage.get(); + } + } } diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/patternprovider/PatternProviderNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/patternprovider/PatternProviderNetworkNode.java index 83664a049..ef2f103db 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/patternprovider/PatternProviderNetworkNode.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/patternprovider/PatternProviderNetworkNode.java @@ -5,11 +5,8 @@ import com.refinedmods.refinedstorage.api.network.autocrafting.PatternProvider; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import java.util.Arrays; import java.util.HashSet; -import java.util.Objects; import java.util.Set; -import java.util.stream.Collectors; import javax.annotation.Nullable; public class PatternProviderNetworkNode extends SimpleNetworkNode implements PatternProvider { diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayComponentType.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayComponentType.java index 508b3fb97..4e6751d22 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayComponentType.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayComponentType.java @@ -1,8 +1,50 @@ package com.refinedmods.refinedstorage.api.network.impl.node.relay; -public enum RelayComponentType { - ENERGY, - SECURITY, - STORAGE, - AUTOCRAFTING +import com.refinedmods.refinedstorage.api.core.NullableType; +import com.refinedmods.refinedstorage.api.network.Network; +import com.refinedmods.refinedstorage.api.network.autocrafting.AutocraftingNetworkComponent; +import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; +import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; + +import java.util.Set; +import java.util.function.Consumer; +import java.util.function.Function; + +public class RelayComponentType { + public static final RelayComponentType ENERGY = new RelayComponentType<>( + network -> network.getComponent(EnergyNetworkComponent.class), + output -> output::setEnergyDelegate + ); + public static final RelayComponentType SECURITY = new RelayComponentType<>( + network -> network.getComponent(SecurityNetworkComponent.class), + output -> output::setSecurityDelegate + ); + public static final RelayComponentType STORAGE = new RelayComponentType<>( + network -> network.getComponent(StorageNetworkComponent.class), + output -> output::setStorageDelegate + ); + public static final RelayComponentType AUTOCRAFTING = new RelayComponentType<>( + network -> network.getComponent(AutocraftingNetworkComponent.class), + output -> output::setAutocraftingDelegate + ); + public static final Set> ALL = Set.of(ENERGY, SECURITY, STORAGE, AUTOCRAFTING); + + private final Function componentProvider; + private final Function> componentApplier; + + private RelayComponentType(final Function componentProvider, + final Function> componentApplier) { + this.componentProvider = componentProvider; + this.componentApplier = componentApplier; + } + + void apply(final Network network, final RelayOutputNetworkNode output) { + final T component = componentProvider.apply(network); + componentApplier.apply(output).accept(component); + } + + void remove(final RelayOutputNetworkNode output) { + componentApplier.apply(output).accept(null); + } } diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayInputNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayInputNetworkNode.java index 5d1d8b248..734b82bff 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayInputNetworkNode.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayInputNetworkNode.java @@ -1,11 +1,7 @@ package com.refinedmods.refinedstorage.api.network.impl.node.relay; import com.refinedmods.refinedstorage.api.network.Network; -import com.refinedmods.refinedstorage.api.network.autocrafting.AutocraftingNetworkComponent; -import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent; -import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; @@ -17,7 +13,7 @@ public class RelayInputNetworkNode extends AbstractNetworkNode { private final long energyUsage; - private final Set componentTypes = new HashSet<>(); + private final Set> componentTypes = new HashSet<>(); @Nullable private RelayOutputNetworkNode outputNode; @@ -42,13 +38,13 @@ public void setOutputNode(@Nullable final RelayOutputNetworkNode outputNode) { this.outputNode = outputNode; } - public void setComponentTypes(final Set componentTypes) { + public void setComponentTypes(final Set> componentTypes) { this.componentTypes.clear(); this.componentTypes.addAll(componentTypes); updateComponents(); } - public void updateComponentType(final RelayComponentType componentType, final boolean enabled) { + public void updateComponentType(final RelayComponentType componentType, final boolean enabled) { if (enabled) { componentTypes.add(componentType); } else { @@ -62,22 +58,13 @@ private void updateComponents() { return; } final boolean valid = network != null && isActive(); - final boolean hasEnergy = componentTypes.contains(RelayComponentType.ENERGY); - outputNode.setEnergyDelegate(valid && hasEnergy - ? network.getComponent(EnergyNetworkComponent.class) - : null); - final boolean hasSecurity = componentTypes.contains(RelayComponentType.SECURITY); - outputNode.setSecurityDelegate(valid && hasSecurity - ? network.getComponent(SecurityNetworkComponent.class) - : null); - final boolean hasStorage = componentTypes.contains(RelayComponentType.STORAGE); - outputNode.setStorageDelegate(valid && hasStorage - ? network.getComponent(StorageNetworkComponent.class) - : null); - final boolean hasAutocrafting = componentTypes.contains(RelayComponentType.AUTOCRAFTING); - outputNode.setAutocraftingDelegate(valid && hasAutocrafting - ? network.getComponent(AutocraftingNetworkComponent.class) - : null); + for (final RelayComponentType componentType : RelayComponentType.ALL) { + if (!componentTypes.contains(componentType) || !valid) { + componentType.remove(outputNode); + } else { + componentType.apply(network, outputNode); + } + } } public void setAccessMode(final AccessMode accessMode) { @@ -110,7 +97,7 @@ public void setFilterNormalizer(final UnaryOperator normalizer) { } } - public boolean hasComponentType(final RelayComponentType componentType) { + public boolean hasComponentType(final RelayComponentType componentType) { return componentTypes.contains(componentType); } diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java index c2cfaa6a9..133a1c205 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java @@ -29,10 +29,11 @@ import com.refinedmods.refinedstorage.network.test.fixtures.SecurityActorFixtures; import java.util.Set; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.MethodSource; import static com.refinedmods.refinedstorage.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode.activeSecurityDecisionProvider; import static com.refinedmods.refinedstorage.network.test.fixtures.ResourceFixtures.A; @@ -438,9 +439,13 @@ void shouldResetComponentsWhenComponentTypeIsDisabled( assertThat(output.getEnergyUsage()).isEqualTo(OUTPUT_ENERGY_USAGE); } + private static Stream> provideComponentTypes() { + return RelayComponentType.ALL.stream(); + } + @ParameterizedTest - @EnumSource(RelayComponentType.class) - void shouldUseEnergyWhenAtLeastOneComponentIsActive(final RelayComponentType type) { + @MethodSource("provideComponentTypes") + void shouldUseEnergyWhenAtLeastOneComponentIsActive(final RelayComponentType type) { // Arrange input.setActive(true); input.setOutputNode(output);