Skip to content

Commit 78ffb14

Browse files
authored
Merge pull request #528 from Nxer/fix
fix Core Element consumption method
2 parents dc5b2bd + ec9bfed commit 78ffb14

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

src/main/java/com/Nxer/TwistSpaceTechnology/loader/RecipeLoader.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public static void loadRecipes() {
6161
new CokingFactoryRecipePool(), new StellarForgeRecipePool(), new LanthanidesRecipePool(),
6262
new HyperSpacetimeTransformerRecipePool(), new TSTBufferedEnergyHatchRecipe(), new CentrifugeRecipePool(),
6363
new ShapedCraftRecipePool(), new MixerRecipePool(), new QFTRecipePool(), new NanoForgeRecipePool(),
64-
new FluidHeaterRecipePool(), new ParticleColliderRecipePool(), new IndustrialMagicMatrixRecipePool(),
65-
new DragonBloodRecipe(), new FusionReactorRecipePool(), new ModularHatchesRecipePool(),
66-
new MassFabricatorGenesisRecipePool(), new SpaceAssemblerRecipePool() };
64+
new FluidHeaterRecipePool(), new ParticleColliderRecipePool(), new DragonBloodRecipe(),
65+
new FusionReactorRecipePool(), new ModularHatchesRecipePool(), new MassFabricatorGenesisRecipePool(),
66+
new SpaceAssemblerRecipePool() };
6767

6868
new SimpleFurnaceFuelPool().loadRecipes();
6969
new TCResearches().loadResearches();
@@ -93,6 +93,7 @@ public static void loadRecipes() {
9393

9494
public static void loadRecipesPostInit() {
9595
new IntensifyChemicalDistorterRecipePool().loadRecipePostInit();
96+
new IndustrialMagicMatrixRecipePool().loadRecipes();
9697
}
9798

9899
public static void loadRecipesServerStarted() {

src/main/java/com/Nxer/TwistSpaceTechnology/system/DysonSphereProgram/machines/TST_StrangeMatterAggregator.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -588,21 +588,10 @@ public CheckRecipeResult checkProcessingMM() {
588588
byproductAmount *= 2;
589589

590590
// calculate Core Element
591+
long toConsume = 0;
591592
if (coreElementAmount >= consumeAnnihilationConstrainer) {
592593
// all output is advanced production
593594

594-
// consume Core Element items
595-
long toConsume = consumeAnnihilationConstrainer;
596-
for (ItemStack i : coreElementStacks) {
597-
if (i.stackSize >= toConsume) {
598-
i.stackSize -= (int) toConsume;
599-
break;
600-
} else {
601-
toConsume -= i.stackSize;
602-
i.stackSize = 0;
603-
}
604-
}
605-
606595
// output strange annihilation fuel rods
607596
if (outputRodAmount > Integer.MAX_VALUE) {
608597
int stack = (int) (outputRodAmount / Integer.MAX_VALUE);
@@ -620,6 +609,8 @@ public CheckRecipeResult checkProcessingMM() {
620609
long strangeRod = coreElementAmount * constrainerFactor;
621610
long antiMatterRod = outputRodAmount - strangeRod;
622611

612+
toConsume = coreElementAmount;
613+
623614
// output strange annihilation fuel rods
624615
if (strangeRod > Integer.MAX_VALUE) {
625616
int stack = (int) (strangeRod / Integer.MAX_VALUE);
@@ -646,6 +637,19 @@ public CheckRecipeResult checkProcessingMM() {
646637

647638
}
648639

640+
// consume Core Element items
641+
if (0 < toConsume) {
642+
for (ItemStack i : coreElementStacks) {
643+
if (i.stackSize >= toConsume) {
644+
i.stackSize -= (int) toConsume;
645+
break;
646+
} else {
647+
toConsume -= i.stackSize;
648+
i.stackSize = 0;
649+
}
650+
}
651+
}
652+
649653
} else {
650654

651655
// output anti matter fuel rods

0 commit comments

Comments
 (0)