Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Fix precise assembler not overclocking with amperage and Precise mode…
Browse files Browse the repository at this point in the history
… having parallels (#207)

* fix precise assembler not overclocking with amperage

* fix precise mode having parallels

* address review
  • Loading branch information
BlueWeabo authored Aug 30, 2023
1 parent 8e6ddec commit c72337b
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import javax.annotation.Nullable;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -49,11 +51,13 @@
import gregtech.api.metatileentity.implementations.*;
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.recipe.check.CheckRecipeResultRegistry;
import gregtech.api.recipe.check.FindRecipeResult;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_HatchElementBuilder;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_OverclockCalculator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.IDualInputHatch;

Expand Down Expand Up @@ -219,20 +223,34 @@ protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) {
return CheckRecipeResultRegistry.SUCCESSFUL;
}

@NotNull
@Override
protected FindRecipeResult findRecipe(@Nullable GT_Recipe_Map map) {
if (map == null) return FindRecipeResult.NOT_FOUND;
return map.findRecipeWithResult(
lastRecipe,
false,
false,
availableVoltage,
inputFluids,
specialSlotItem,
inputItems);
}

@NotNull
@Override
protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) {
return super.createOverclockCalculator(recipe).setSpeedBoost(mode == 0 ? 1 : 0.5F);
}
}.setMaxParallelSupplier(() -> (int) Math.pow(2, 4 + (casingTier + 1)));
}.setMaxParallelSupplier(() -> mode == 0 ? 1 : (int) Math.pow(2, 4 + (casingTier + 1)));
}

@Override
protected void setProcessingLogicPower(ProcessingLogic logic) {
boolean useSingleAmp = mEnergyHatches.size() == 1 && mExoticEnergyHatches.size() == 0;
logic.setAvailableVoltage(getMachineVoltageLimit());
logic.setAvailableAmperage(useSingleAmp ? 1 : getMaxInputAmps());
logic.setAmperageOC(false);
logic.setAmperageOC(true);
}

@Override
Expand Down

0 comments on commit c72337b

Please sign in to comment.