Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix black hole circuits #3845

Merged
merged 6 commits into from
Jan 21, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -3260,7 +3260,7 @@ public MetaGeneratedItem01() {
addItem(
Black_Hole_Stabilizer.ID,
"Superstable Black Hole Seed",
"Opens a superstable black hole/nBlack hole will never destabilize and will operate at maximum efficiency",
"Opens a superstable black hole/n Black hole will never destabilize and will operate at maximum efficiency",
new TCAspects.TC_AspectStack(TCAspects.ALIENIS, 32),
new TCAspects.TC_AspectStack(TCAspects.ORDO, 128)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ private int getModeFromCircuit(ItemStack[] t) {
}
}
}
return 0;
return -1;
}

private void searchAndDecrementCatalysts() {
Expand Down Expand Up @@ -549,10 +549,22 @@ protected void setupProcessingLogic(ProcessingLogic logic) {
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic() {

private int lastMode = -1;

@NotNull
@Override
protected Stream<GTRecipe> findRecipeMatches(@Nullable RecipeMap<?> map) {
switch (getModeFromCircuit(inputItems)) {
int mode = getModeFromCircuit(inputItems);

if (mode == -1) {
lastMode = -1;
return Stream.empty();
}
if (!(mode == lastMode)) {
lastRecipe = null;
lastMode = mode;
}
switch (mode) {
case MACHINEMODE_COMPRESSOR -> {
return super.findRecipeMatches(RecipeMaps.compressorRecipes);
}
Expand Down Expand Up @@ -597,6 +609,11 @@ protected void setProcessingLogicPower(ProcessingLogic logic) {
} else super.setProcessingLogicPower(logic);
}

@Override
public boolean isInputSeparationEnabled() {
return true;
}

@Override
public boolean onRunningTick(ItemStack aStack) {
// Void contents of active recipe without crashing machine if it becomes unstable
Expand Down Expand Up @@ -734,11 +751,6 @@ public boolean supportsBatchMode() {
return true;
}

@Override
public boolean supportsInputSeparation() {
return true;
}

@Override
public boolean supportsSingleRecipeLocking() {
return true;
Expand Down
Loading