Skip to content

Commit

Permalink
Amend 1M component recipe to use new 256k component
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed May 15, 2022
1 parent 85e84f7 commit 7277d5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minecraft_version=1.18.2
forge_version=40.0.44
ae2_version=11.0.0-alpha.6
ae2_version=11.0.0
jei_version=9.7.0.180
mekanism_version=10.2.0.459
appmek_fileid=3778047
Expand Down
25 changes: 14 additions & 11 deletions src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import ninety.megacells.integration.appmek.AppMekIntegration;
import ninety.megacells.integration.appmek.ChemicalCellType;
import ninety.megacells.item.MEGAItems;
import ninety.megacells.item.MEGAPortableCell;
import ninety.megacells.item.MEGAStorageCell;
import ninety.megacells.item.util.IMEGACellType;
import ninety.megacells.item.util.MEGACellTier;
import ninety.megacells.item.util.MEGACellType;
import ninety.megacells.util.MEGACellsUtil;

Expand All @@ -32,11 +32,11 @@ public MEGARecipeProvider(DataGenerator generator) {
@Override
protected void buildCraftingRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
// spotless:off
component(consumer, AEItems.CELL_COMPONENT_64K.asItem(), MEGAItems.CELL_COMPONENT_1M.get(), AEItems.SKY_DUST.asItem());
component(consumer, MEGAItems.CELL_COMPONENT_1M.get(), MEGAItems.CELL_COMPONENT_4M.get(), AEItems.MATTER_BALL.asItem());
component(consumer, MEGAItems.CELL_COMPONENT_4M.get(), MEGAItems.CELL_COMPONENT_16M.get(), AEItems.MATTER_BALL.asItem());
component(consumer, MEGAItems.CELL_COMPONENT_16M.get(), MEGAItems.CELL_COMPONENT_64M.get(), AEItems.SINGULARITY.asItem());
component(consumer, MEGAItems.CELL_COMPONENT_64M.get(), MEGAItems.CELL_COMPONENT_256M.get(), AEItems.SINGULARITY.asItem());
component(consumer, MEGACellTier._1M, AEItems.SKY_DUST.asItem());
component(consumer, MEGACellTier._4M, AEItems.MATTER_BALL.asItem());
component(consumer, MEGACellTier._16M, AEItems.MATTER_BALL.asItem());
component(consumer, MEGACellTier._64M, AEItems.SINGULARITY.asItem());
component(consumer, MEGACellTier._256M, AEItems.SINGULARITY.asItem());

housing(consumer, MEGACellType.ITEM);
housing(consumer, MEGACellType.FLUID);
Expand All @@ -48,7 +48,7 @@ protected void buildCraftingRecipes(@NotNull Consumer<FinishedRecipe> consumer)
portable(consumer, portable);
}

if (AppMekIntegration.isAppMekLoaded()) {
if (AppMekIntegration.isAppMekLoaded()) { // this check doesn't actually do shit lol
housing(consumer, ChemicalCellType.TYPE);
for (var chemStorage : ChemicalCellType.TYPE.getCells()) {
cell(consumer, chemStorage);
Expand All @@ -60,17 +60,20 @@ protected void buildCraftingRecipes(@NotNull Consumer<FinishedRecipe> consumer)
// spotless:on
}

private void component(Consumer<FinishedRecipe> consumer, Item preceding, Item output, Item substrate) {
ShapedRecipeBuilder.shaped(output)
private void component(Consumer<FinishedRecipe> consumer, MEGACellTier tier, Item binder) {
var preceding = tier == MEGACellTier._1M ? AEItems.CELL_COMPONENT_256K.asItem()
: MEGACellTier.values()[tier.index - 2].getComponent();

ShapedRecipeBuilder.shaped(tier.getComponent())
.pattern("aba")
.pattern("cdc")
.pattern("aca")
.define('a', substrate)
.define('a', binder)
.define('b', AEItems.CALCULATION_PROCESSOR)
.define('c', preceding)
.define('d', AEBlocks.QUARTZ_VIBRANT_GLASS)
.unlockedBy("has_" + MEGACellsUtil.getItemPath(preceding), has(preceding))
.save(consumer, MEGACellsUtil.makeId("cells/" + MEGACellsUtil.getItemPath(output)));
.save(consumer, MEGACellsUtil.makeId("cells/" + MEGACellsUtil.getItemPath(tier.getComponent())));
}

private void cell(Consumer<FinishedRecipe> consumer, Item cellItem) {
Expand Down

0 comments on commit 7277d5b

Please sign in to comment.