Skip to content

Commit

Permalink
Update Applied Botanics integration
Browse files Browse the repository at this point in the history
Closes #90
  • Loading branch information
62832 committed Nov 27, 2023
1 parent a8624c2 commit 4391320
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ private void generateItemModels(BiConsumer<ResourceLocation, Supplier<JsonElemen
if (MEGACells.PLATFORM.isAddonLoaded(Addons.APPBOT)) {
flatItem(AppBotItems.MEGA_MANA_CELL_HOUSING, output);
AppBotItems.getCells().forEach(cell -> cellModel(cell, output));

// TODO: portables
AppBotItems.getPortables().forEach(portable -> portableModel(portable, output));
driveCell("mega_mana_cell", output);
}

Expand All @@ -207,6 +206,15 @@ private void cellModel(ItemDefinition<?> cell, BiConsumer<ResourceLocation, Supp
output);
}

private void portableModel(ItemDefinition<?> portable, BiConsumer<ResourceLocation, Supplier<JsonElement>> output) {
ModelTemplates.TWO_LAYERED_ITEM.create(
ModelLocationUtils.getModelLocation(portable.asItem()),
TextureMapping.layered(
MEGACells.makeId("item/cell/portable/" + portable.id().getPath()),
AppEng.makeId("item/portable_cell_led")),
output);
}

private void portableModel(
ItemDefinition<?> portable,
String screenType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@

import java.util.List;

import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.Item;

import appeng.api.upgrades.Upgrades;
import appeng.core.localization.GuiText;

import appbot.ABItems;
import appbot.AppliedBotanics;

public final class AppBotIntegration {
public static void initUpgrades() {
AppBotItems.getPortables()
.forEach(c -> Upgrades.add(GREATER_ENERGY_CARD, c, 2, GuiText.PortableCells.getTranslationKey()));

for (var portable : List.of(
ABItems.PORTABLE_MANA_CELL_1K,
ABItems.PORTABLE_MANA_CELL_4K,
ABItems.PORTABLE_MANA_CELL_16K,
ABItems.PORTABLE_MANA_CELL_64K,
ABItems.PORTABLE_MANA_CELL_256K)) {
cell("portable_mana_storage_cell_1k"),
cell("portable_mana_storage_cell_4k"),
cell("portable_mana_storage_cell_16k"),
cell("portable_mana_storage_cell_64k"),
cell("portable_mana_storage_cell_256k"))) {
Upgrades.add(GREATER_ENERGY_CARD, portable, 2, GuiText.PortableCells.getTranslationKey());
}
}

private static Item cell(String id) {
return BuiltInRegistries.ITEM.get(AppliedBotanics.id(id));
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ dependencies {
modImplementation(libs.cloth.fabric)
modImplementation(libs.modmenu)

modCompileOnly(libs.appbot.fabric) { exclude(group = "dev.emi", module = "emi-fabric") }
modImplementation(libs.appbot.fabric) { exclude(group = "dev.emi", module = "emi-fabric") }
modRuntimeOnly(libs.botania.fabric) { exclude(group = "dev.emi", module = "emi-fabric") }

// modRuntimeOnly(libs.ae2wtlib.fabric)
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
},
"suggests": {
"ae2wtlib": ">=$ae2wtVersion",
"appbot": "$appbotVersion"
"appbot": ">=$appbotVersion"
}
}
2 changes: 1 addition & 1 deletion forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependencies {
modCompileOnly(variantOf(libs.mekanism) { classifier("generators") })
modRuntimeOnly(variantOf(libs.mekanism) { classifier("all") })

modCompileOnly(libs.appbot.forge)
modImplementation(libs.appbot.forge)
modRuntimeOnly(libs.botania.forge)
modRuntimeOnly(libs.patchouli.forge)

Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ description = "ME Greater Accumulation Cells - For when kilobytes just won't do.
[[dependencies.megacells]]
modId="appbot"
mandatory=false
versionRange = "[$appbotVersion]"
versionRange = "[$appbotVersion,)"
ordering = "AFTER"
side = "BOTH"

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencyResolutionManagement {
library("curios", "top.theillusivec4.curios", "curios-forge").version("5.2.0+$minecraftVersion")

// Applied Botanics
val appbotVersion = "1.4.2"
val appbotVersion = "1.5.0"
version("appbot", appbotVersion)
library("appbot-fabric", "maven.modrinth", "applied-botanics").version("$appbotVersion-fabric")
library("appbot-forge", "maven.modrinth", "applied-botanics").version("$appbotVersion-forge")
Expand Down

0 comments on commit 4391320

Please sign in to comment.