Skip to content

Commit

Permalink
Add Ars Énergistique integration
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Jan 27, 2024
1 parent e2350c4 commit 59715db
Show file tree
Hide file tree
Showing 23 changed files with 294 additions and 43 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
ae2(required){curseforge:223794}{modrinth:XxWD5pD3}
appmek(optional){curseforge:574300}{modrinth:IiATswDj}
appbot(optional){curseforge:610632}{modrinth:545hUrw9}
arseng(optional){curseforge:905641}{modrinth:IJI3QuK8}
ae2wtlib(optional){curseforge:459929}{modrinth:pNabrMMw}
cloth_config(required){curseforge:348521}{modrinth:9s6osm5g}
Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/gripe/_90/megacells/core/Addons.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public enum Addons {
APPMEK("appmek"),
APPBOT("appbot"),
ARSENG("arseng"),
AE2WTLIB("ae2wtlib");

private final String modId;
Expand Down
18 changes: 18 additions & 0 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ repositories {
includeGroup("top.theillusivec4.curios")
}
}

maven {
name = "BlameJared"
url = uri("https://maven.blamejared.com")
content {
includeGroup("com.hollingsworth.ars_nouveau")
}
}

maven {
name = "GeckoLib"
url = uri("https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/")
}
}

dependencies {
Expand All @@ -75,6 +88,11 @@ dependencies {
modRuntimeOnly(libs.botania.forge)
modRuntimeOnly(libs.patchouli.forge)

modImplementation(libs.arseng)
modRuntimeOnly(libs.arsnouveau)
modRuntimeOnly(libs.geckolib)
runtimeOnly(libs.mixinextras)

modImplementation(libs.ae2wtlib.forge)
modRuntimeOnly(libs.architectury.forge)
modRuntimeOnly(libs.curios)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import gripe._90.megacells.MEGACells;
import gripe._90.megacells.core.Addons;
import gripe._90.megacells.integration.appmek.AppMekItems;
import gripe._90.megacells.integration.arseng.ArsEngItems;

class ForgeModelProvider extends ItemModelProvider {
private static final ResourceLocation STORAGE_CELL_LED = AppEng.makeId("item/storage_cell_led");
Expand Down Expand Up @@ -39,6 +40,15 @@ protected void registerModels() {
driveCell("mega_chemical_cell");
driveCell("radioactive_chemical_cell");
}

if (MEGACells.PLATFORM.isAddonLoaded(Addons.ARSENG)) {
basicItem(ArsEngItems.MEGA_SOURCE_CELL_HOUSING.asItem());

ArsEngItems.getCells().forEach(c -> cell(c, "standard", STORAGE_CELL_LED));
ArsEngItems.getPortables().forEach(c -> cell(c, "portable", PORTABLE_CELL_LED));

driveCell("mega_source_cell");
}
}

private void cell(ItemDefinition<?> cell, String type, ResourceLocation led) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeBuilder;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.data.recipes.ShapedRecipeBuilder;
Expand All @@ -28,6 +27,7 @@
import gripe._90.megacells.core.Addons;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.integration.appmek.AppMekItems;
import gripe._90.megacells.integration.arseng.ArsEngItems;

public class ForgeRecipeProvider extends RecipeProvider {
private static final TagKey<Item> OSMIUM = ItemTags.create(new ResourceLocation("forge", "ingots/osmium"));
Expand All @@ -37,35 +37,35 @@ public ForgeRecipeProvider(PackOutput output) {
}

@Override
protected void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
protected void buildRecipes(@NotNull Consumer<FinishedRecipe> writer) {
if (MEGACells.PLATFORM.isAddonLoaded(Addons.APPMEK)) {
appmekRecipe(
consumer,
MEGACells.makeId("cells/mega_chemical_cell_housing"),
MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, AppMekItems.MEGA_CHEMICAL_CELL_HOUSING)
.pattern("aba")
.pattern("b b")
.pattern("ddd")
.define('a', AEBlocks.QUARTZ_VIBRANT_GLASS)
.define('b', AEItems.SKY_DUST)
.define('d', OSMIUM)
.unlockedBy("has_dusts/sky_stone", has(AEItems.SKY_DUST)));

chemCell(consumer, AppMekItems.CHEMICAL_CELL_1M, MEGAItems.CELL_COMPONENT_1M);
chemCell(consumer, AppMekItems.CHEMICAL_CELL_4M, MEGAItems.CELL_COMPONENT_4M);
chemCell(consumer, AppMekItems.CHEMICAL_CELL_16M, MEGAItems.CELL_COMPONENT_16M);
chemCell(consumer, AppMekItems.CHEMICAL_CELL_64M, MEGAItems.CELL_COMPONENT_64M);
chemCell(consumer, AppMekItems.CHEMICAL_CELL_256M, MEGAItems.CELL_COMPONENT_256M);

chemPortable(consumer, AppMekItems.PORTABLE_CHEMICAL_CELL_1M, MEGAItems.CELL_COMPONENT_1M);
chemPortable(consumer, AppMekItems.PORTABLE_CHEMICAL_CELL_4M, MEGAItems.CELL_COMPONENT_4M);
chemPortable(consumer, AppMekItems.PORTABLE_CHEMICAL_CELL_16M, MEGAItems.CELL_COMPONENT_16M);
chemPortable(consumer, AppMekItems.PORTABLE_CHEMICAL_CELL_64M, MEGAItems.CELL_COMPONENT_64M);
chemPortable(consumer, AppMekItems.PORTABLE_CHEMICAL_CELL_256M, MEGAItems.CELL_COMPONENT_256M);

appmekRecipe(
consumer,
MEGACells.makeId("crafting/radioactive_cell_component"),
.unlockedBy("has_dusts/sky_stone", has(AEItems.SKY_DUST)),
Addons.APPMEK,
MEGACells.makeId("cells/mega_chemical_cell_housing"));

chemCell(writer, AppMekItems.CHEMICAL_CELL_1M, MEGAItems.CELL_COMPONENT_1M);
chemCell(writer, AppMekItems.CHEMICAL_CELL_4M, MEGAItems.CELL_COMPONENT_4M);
chemCell(writer, AppMekItems.CHEMICAL_CELL_16M, MEGAItems.CELL_COMPONENT_16M);
chemCell(writer, AppMekItems.CHEMICAL_CELL_64M, MEGAItems.CELL_COMPONENT_64M);
chemCell(writer, AppMekItems.CHEMICAL_CELL_256M, MEGAItems.CELL_COMPONENT_256M);

chemPortable(writer, AppMekItems.PORTABLE_CHEMICAL_CELL_1M, MEGAItems.CELL_COMPONENT_1M);
chemPortable(writer, AppMekItems.PORTABLE_CHEMICAL_CELL_4M, MEGAItems.CELL_COMPONENT_4M);
chemPortable(writer, AppMekItems.PORTABLE_CHEMICAL_CELL_16M, MEGAItems.CELL_COMPONENT_16M);
chemPortable(writer, AppMekItems.PORTABLE_CHEMICAL_CELL_64M, MEGAItems.CELL_COMPONENT_64M);
chemPortable(writer, AppMekItems.PORTABLE_CHEMICAL_CELL_256M, MEGAItems.CELL_COMPONENT_256M);

MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, AppMekItems.RADIOACTIVE_CELL_COMPONENT)
.pattern("aba")
.pattern("cdc")
Expand All @@ -76,10 +76,11 @@ protected void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
.define('d', AEBlocks.QUARTZ_VIBRANT_GLASS)
.define('e', AEItems.CELL_COMPONENT_256K)
.unlockedBy("has_cell_component_256k", has(AEItems.CELL_COMPONENT_256K))
.unlockedBy("has_waste_barrel", has(MekanismBlocks.RADIOACTIVE_WASTE_BARREL)));
appmekRecipe(
consumer,
MEGACells.makeId("cells/standard/radioactive_chemical_cell"),
.unlockedBy("has_waste_barrel", has(MekanismBlocks.RADIOACTIVE_WASTE_BARREL)),
Addons.APPMEK,
MEGACells.makeId("crafting/radioactive_cell_component"));
MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, AppMekItems.RADIOACTIVE_CHEMICAL_CELL)
.pattern("aba")
.pattern("bcb")
Expand All @@ -89,14 +90,29 @@ protected void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
.define('c', AppMekItems.RADIOACTIVE_CELL_COMPONENT)
.define('d', MekanismItems.HDPE_SHEET)
.define('e', MekanismItems.POLONIUM_PELLET)
.unlockedBy("has_radioactive_cell_component", has(AppMekItems.RADIOACTIVE_CELL_COMPONENT)));
.unlockedBy("has_radioactive_cell_component", has(AppMekItems.RADIOACTIVE_CELL_COMPONENT)),
Addons.APPMEK,
MEGACells.makeId("cells/standard/radioactive_chemical_cell"));
}

if (MEGACells.PLATFORM.isAddonLoaded(Addons.ARSENG)) {
sourceCell(writer, ArsEngItems.SOURCE_CELL_1M, MEGAItems.CELL_COMPONENT_1M);
sourceCell(writer, ArsEngItems.SOURCE_CELL_4M, MEGAItems.CELL_COMPONENT_4M);
sourceCell(writer, ArsEngItems.SOURCE_CELL_16M, MEGAItems.CELL_COMPONENT_16M);
sourceCell(writer, ArsEngItems.SOURCE_CELL_64M, MEGAItems.CELL_COMPONENT_64M);
sourceCell(writer, ArsEngItems.SOURCE_CELL_256M, MEGAItems.CELL_COMPONENT_256M);

sourcePortable(writer, ArsEngItems.PORTABLE_SOURCE_CELL_1M, MEGAItems.CELL_COMPONENT_1M);
sourcePortable(writer, ArsEngItems.PORTABLE_SOURCE_CELL_4M, MEGAItems.CELL_COMPONENT_4M);
sourcePortable(writer, ArsEngItems.PORTABLE_SOURCE_CELL_16M, MEGAItems.CELL_COMPONENT_16M);
sourcePortable(writer, ArsEngItems.PORTABLE_SOURCE_CELL_64M, MEGAItems.CELL_COMPONENT_64M);
sourcePortable(writer, ArsEngItems.PORTABLE_SOURCE_CELL_256M, MEGAItems.CELL_COMPONENT_256M);
}
}

private void chemCell(Consumer<FinishedRecipe> consumer, ItemDefinition<?> cell, ItemDefinition<?> component) {
appmekRecipe(
consumer,
MEGACells.makeId("cells/standard/" + cell.id().getPath()),
private void chemCell(Consumer<FinishedRecipe> writer, ItemDefinition<?> cell, ItemDefinition<?> component) {
MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, cell)
.pattern("aba")
.pattern("bcb")
Expand All @@ -105,32 +121,59 @@ private void chemCell(Consumer<FinishedRecipe> consumer, ItemDefinition<?> cell,
.define('b', AEItems.SKY_DUST)
.define('c', component)
.define('d', OSMIUM)
.unlockedBy("has_" + component.id().getPath(), has(component)));
appmekRecipe(
consumer,
MEGACells.makeId("cells/standard/" + cell.id().getPath() + "_with_housing"),
.unlockedBy("has_" + component.id().getPath(), has(component)),
Addons.APPMEK,
MEGACells.makeId("cells/standard/" + cell.id().getPath()));
MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, cell)
.requires(AppMekItems.MEGA_CHEMICAL_CELL_HOUSING)
.requires(component)
.unlockedBy("has_" + component.id().getPath(), has(component))
.unlockedBy("has_mega_chemical_cell_housing", has(AppMekItems.MEGA_CHEMICAL_CELL_HOUSING)));
.unlockedBy("has_mega_chemical_cell_housing", has(AppMekItems.MEGA_CHEMICAL_CELL_HOUSING)),
Addons.APPMEK,
MEGACells.makeId("cells/standard/" + cell.id().getPath() + "_with_housing"));
}

private void chemPortable(Consumer<FinishedRecipe> consumer, ItemDefinition<?> cell, ItemDefinition<?> component) {
appmekRecipe(
consumer,
MEGACells.makeId("cells/portable/" + cell.id().getPath()),
private void chemPortable(Consumer<FinishedRecipe> writer, ItemDefinition<?> cell, ItemDefinition<?> component) {
MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, cell)
.requires(AEBlocks.CHEST)
.requires(component)
.requires(AEBlocks.DENSE_ENERGY_CELL)
.requires(AppMekItems.MEGA_CHEMICAL_CELL_HOUSING)
.unlockedBy("has_mega_chemical_cell_housing", has(AppMekItems.MEGA_CHEMICAL_CELL_HOUSING))
.unlockedBy("has_" + component.id().getPath(), has(component))
.unlockedBy("has_dense_energy_cell", has(AEBlocks.DENSE_ENERGY_CELL)));
.unlockedBy("has_dense_energy_cell", has(AEBlocks.DENSE_ENERGY_CELL)),
Addons.APPMEK,
MEGACells.makeId("cells/portable/" + cell.id().getPath()));
}

private void sourceCell(Consumer<FinishedRecipe> writer, ItemDefinition<?> cell, ItemDefinition<?> component) {
MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, cell)
.requires(ArsEngItems.MEGA_SOURCE_CELL_HOUSING)
.requires(component)
.unlockedBy("has_" + component.id().getPath(), has(component))
.unlockedBy("has_mega_source_cell_housing", has(ArsEngItems.MEGA_SOURCE_CELL_HOUSING)),
Addons.ARSENG,
MEGACells.makeId("cells/standard/" + cell.id().getPath()));
}

private void appmekRecipe(Consumer<FinishedRecipe> consumer, ResourceLocation id, RecipeBuilder builder) {
MEGACells.PLATFORM.addIntegrationRecipe(consumer, builder, Addons.APPMEK, id);
private void sourcePortable(Consumer<FinishedRecipe> writer, ItemDefinition<?> cell, ItemDefinition<?> component) {
MEGACells.PLATFORM.addIntegrationRecipe(
writer,
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, cell)
.requires(AEBlocks.CHEST)
.requires(component)
.requires(AEBlocks.DENSE_ENERGY_CELL)
.requires(ArsEngItems.MEGA_SOURCE_CELL_HOUSING)
.unlockedBy("has_mega_source_cell_housing", has(ArsEngItems.MEGA_SOURCE_CELL_HOUSING))
.unlockedBy("has_" + component.id().getPath(), has(component))
.unlockedBy("has_dense_energy_cell", has(AEBlocks.DENSE_ENERGY_CELL)),
Addons.ARSENG,
MEGACells.makeId("cells/portable/" + cell.id().getPath()));
}
}
18 changes: 18 additions & 0 deletions forge/src/main/java/gripe/_90/megacells/forge/ForgePlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
import gripe._90.megacells.definition.MEGAMenus;
import gripe._90.megacells.integration.appmek.AppMekIntegration;
import gripe._90.megacells.integration.appmek.AppMekItems;
import gripe._90.megacells.integration.arseng.ArsEngIntegration;
import gripe._90.megacells.integration.arseng.ArsEngItems;
import gripe._90.megacells.misc.CompressionService;
import gripe._90.megacells.misc.LavaTransformLogic;

Expand Down Expand Up @@ -111,6 +113,10 @@ public void initItems() {
if (isAddonLoaded(Addons.APPMEK)) {
AppMekItems.init();
}

if (isAddonLoaded(Addons.ARSENG)) {
ArsEngItems.init();
}
}

@Override
Expand All @@ -122,6 +128,10 @@ public List<ItemLike> getAllCells() {
cells.add(AppMekItems.RADIOACTIVE_CHEMICAL_CELL);
}

if (isAddonLoaded(Addons.ARSENG)) {
cells.addAll(ArsEngItems.getCells());
}

return cells;
}

Expand All @@ -133,6 +143,10 @@ public List<ItemLike> getAllPortables() {
portables.addAll(AppMekItems.getPortables());
}

if (isAddonLoaded(Addons.ARSENG)) {
portables.addAll(ArsEngItems.getPortables());
}

return portables;
}

Expand Down Expand Up @@ -172,6 +186,10 @@ public void initUpgrades() {
if (isAddonLoaded(Addons.APPMEK)) {
event.enqueueWork(AppMekIntegration::initUpgrades);
}

if (isAddonLoaded(Addons.ARSENG)) {
event.enqueueWork(ArsEngIntegration::initUpgrades);
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import gripe._90.megacells.MEGACells;
import gripe._90.megacells.core.Addons;
import gripe._90.megacells.integration.appmek.AppMekIntegration;
import gripe._90.megacells.integration.arseng.ArsEngIntegration;

@Mod(MEGACells.MODID)
public class MEGACellsForge {
Expand All @@ -17,6 +18,10 @@ public MEGACellsForge() {
AppMekIntegration.init();
}

if (MEGACells.PLATFORM.isAddonLoaded(Addons.ARSENG)) {
ArsEngIntegration.init();
}

if (FMLEnvironment.dist.isClient()) {
MEGACells.Client.initClient();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package gripe._90.megacells.integration.arseng;

import java.util.Collection;
import java.util.stream.Stream;

import net.minecraftforge.fml.loading.FMLEnvironment;

import appeng.api.client.StorageCellModels;
import appeng.api.upgrades.Upgrades;
import appeng.core.definitions.AEItems;
import appeng.core.localization.GuiText;

import gripe._90.megacells.MEGACells;

public class ArsEngIntegration {
public static void init() {
if (FMLEnvironment.dist.isClient()) {
Stream.of(ArsEngItems.getCells(), ArsEngItems.getPortables())
.flatMap(Collection::stream)
.forEach(c ->
StorageCellModels.registerModel(c, MEGACells.makeId("block/drive/cells/mega_source_cell")));
}
}

public static void initUpgrades() {
ArsEngItems.getCells()
.forEach(cell -> Upgrades.add(AEItems.VOID_CARD, cell, 1, GuiText.StorageCells.getTranslationKey()));
ArsEngItems.getPortables().forEach(cell -> {
Upgrades.add(AEItems.ENERGY_CARD, cell, 2, GuiText.PortableCells.getTranslationKey());
Upgrades.add(AEItems.VOID_CARD, cell, 1, GuiText.PortableCells.getTranslationKey());
});
}
}
Loading

0 comments on commit 59715db

Please sign in to comment.