Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/gregtech/api/GTValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,7 @@ public static boolean isDeobfEnvironment() {
return ConfigHolder.misc.specialEvents && yearMonthDay[1].equals("12") &&
(yearMonthDay[2].equals("24") || yearMonthDay[2].equals("25"));
};

// todo temp
public static double LOG_4 = Math.log(4);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/
public class HeatingCoilRecipeLogic extends MultiblockRecipeLogic {

public HeatingCoilRecipeLogic(RecipeMapMultiblockController metaTileEntity) {
super(metaTileEntity);
public HeatingCoilRecipeLogic(RecipeMapMultiblockController metaTileEntity, int tierskipLimit_) {
super(metaTileEntity, tierskipLimit_);
if (!(metaTileEntity instanceof IHeatingCoil)) {
throw new IllegalArgumentException("MetaTileEntity must be instanceof IHeatingCoil");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,26 @@ public class MultiblockRecipeLogic extends AbstractRecipeLogic {
protected IItemHandlerModifiable currentDistinctInputBus;
protected List<IItemHandlerModifiable> invalidatedInputList = new ArrayList<>();

protected int tierskipLimit;

public MultiblockRecipeLogic(RecipeMapMultiblockController tileEntity) {
super(tileEntity, tileEntity.recipeMap);
this.tierskipLimit = 0;
}

public MultiblockRecipeLogic(RecipeMapMultiblockController tileEntity, int tierskipLimit_) {
super(tileEntity, tileEntity.recipeMap);
this.tierskipLimit = tierskipLimit_;
}

public MultiblockRecipeLogic(RecipeMapMultiblockController tileEntity, boolean hasPerfectOC) {
super(tileEntity, tileEntity.recipeMap, hasPerfectOC);
this.tierskipLimit = 0;
}

public MultiblockRecipeLogic(RecipeMapMultiblockController tileEntity, int tierskipLimit_, boolean hasPerfectOC) {
super(tileEntity, tileEntity.recipeMap, hasPerfectOC);
this.tierskipLimit = tierskipLimit_;
}

@Override
Expand Down Expand Up @@ -103,7 +117,7 @@ protected IMultipleTankHandler getInputTank() {
/**
* Overload of {@link #getInputTank()} to gather extra fluid tanks
* that could exist in a distinct item handler (such as a {@link DualHandler})
*
*
* @param items Handler to gather fluid tanks from
* @return a new FluidTankList with extra fluid tanks on top of the existing fluid tanks
*/
Expand Down Expand Up @@ -400,13 +414,14 @@ public long getMaxVoltage() {
// Machine Multiblocks
if (energyContainer instanceof EnergyContainerList energyList) {
long highestVoltage = energyList.getHighestInputVoltage();
if (energyList.getNumHighestInputContainers() > 1) {
// allow tier + 1 if there are multiple hatches present at the highest tier
int tier = GTUtility.getTierByVoltage(highestVoltage);
return GTValues.V[Math.min(tier + 1, GTValues.MAX)];
} else {
return highestVoltage;
}
int tier = GTUtility.getTierByVoltage(highestVoltage);

// todo fix (always returns 1)
long amps = energyList.getInputAmperage();

// todo log call can be replaced with something less intensive
int tierskip = (int) Math.min((Math.log(amps) / GTValues.LOG_4), tierskipLimit);
return GTValues.V[Math.min(tier + tierskip, GTValues.MAX)];
} else {
return energyContainer.getInputVoltage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ public TraceabilityPredicate autoAbilities(boolean checkEnergyIn,

if (checkEnergyIn) {
predicate = predicate.or(abilities(MultiblockAbility.INPUT_ENERGY).setMinGlobalLimited(1)
.setMaxGlobalLimited(2)
.setPreviewCount(1));
.setMaxGlobalLimited(1).setPreviewCount(1));
}

if (checkItemIn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,9 @@ private static void multiblockParts() {
for (int i = 0; i < endPos; i++) {
String voltageName = GTValues.VN[i].toLowerCase();
MetaTileEntities.ENERGY_INPUT_HATCH[i] = MetaTileEntities.registerMetaTileEntity(11120 + i,
new MetaTileEntityEnergyHatch(gregtechId("energy_hatch.input." + voltageName), i, 2, false));
new MetaTileEntityEnergyHatch(gregtechId("energy_hatch.input." + voltageName), i, 1, false));
MetaTileEntities.ENERGY_OUTPUT_HATCH[i] = MetaTileEntities.registerMetaTileEntity(11135 + i,
new MetaTileEntityEnergyHatch(gregtechId("energy_hatch.output." + voltageName), i, 2, true));
new MetaTileEntityEnergyHatch(gregtechId("energy_hatch.output." + voltageName), i, 1, true));

MetaTileEntities.ENERGY_INPUT_HATCH_4A[i] = MetaTileEntities.registerMetaTileEntity(11150 + i,
new MetaTileEntityEnergyHatch(gregtechId("energy_hatch.input_4a." + voltageName), i, 4, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected BlockPattern createStructurePattern() {
.where('Y', states(getCasingState())
.or(abilities(MultiblockAbility.INPUT_ENERGY)
.setMinGlobalLimited(1)
.setMaxGlobalLimited(3)))
.setMaxGlobalLimited(1)))
.where('I', metaTileEntities(MetaTileEntities.ITEM_IMPORT_BUS[GTValues.ULV]))
.where('G', states(getGrateState()))
.where('A',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class MetaTileEntityElectricBlastFurnace extends RecipeMapMultiblockContr

public MetaTileEntityElectricBlastFurnace(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, RecipeMaps.BLAST_RECIPES);
this.recipeMapWorkable = new HeatingCoilRecipeLogic(this);
this.recipeMapWorkable = new HeatingCoilRecipeLogic(this, 1);
}

@Override
Expand Down
Loading