diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index d366821..5c001f4 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -52,6 +52,7 @@ object deps { val rebornCore by json() val techReborn by json() val wirelessNet by json() + val lapisReserve by json() const val trEnergy = "teamreborn:energy:2.2.0" const val libgui = "io.github.cottonmc:LibGui:6.0.1+1.19" @@ -80,6 +81,7 @@ object deps { val ie by json() val rs by json() val jei by json() + val lapisReserve by json() object mekanism : DependencyPath { override val prefix = "forge.mekanism" diff --git a/buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt b/buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt index 5ee5ed8..6502255 100644 --- a/buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt +++ b/buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt @@ -73,7 +73,7 @@ abstract class FetchLatestVersionsTask : DefaultTask() { fetch(fabric::modmenu, mrIds.modmenu) { "com.terraformersmc:modmenu:${it.version_number}" } fetch(fabric::noIndium, mrIds.noIndium, "1.19") { "me.luligabi:NoIndium:${it.version_number}" } fetch(fabric::owo, mrIds.owo, "1.19") { "io.wispforest:owo-lib:${it.version_number}" } - fetch(fabric::patchouli, mrIds.patchouli) { "vazkii.patchouli:Patchouli:${it.version_number.toUpperCase(Locale.ROOT)}" } + fetch(fabric::patchouli, mrIds.patchouli) { "vazkii.patchouli:Patchouli:${it.version_number.uppercase(Locale.ROOT)}" } fetch(fabric::powah, mrIds.powah) { it.maven } } @@ -85,6 +85,7 @@ abstract class FetchLatestVersionsTask : DefaultTask() { fetch(fabric::rebornCore, cfIds.rebornCore) { "RebornCore:RebornCore-1.19:${it.download.fileName.removePrefix("RebornCore-")}" } fetch(fabric::techReborn, cfIds.techReborn) { "TechReborn:TechReborn-1.19:${it.download.fileName.removePrefix("TechReborn-")}" } fetch(fabric::wirelessNet, cfIds.wirelessNet, "1.19") { it.maven } + fetch(fabric::lapisReserve, cfIds.lapisReserve, "1.19.2") { it.maven } } fetcher(ModrinthVersionFetcher, "forge", forge.wthit) { @@ -113,6 +114,10 @@ abstract class FetchLatestVersionsTask : DefaultTask() { fetch(forge.thermal::expansion, mrIds.thermalExpansion) { it.maven } } + fetcher(CurseForgeVersionFetcher, "forge", forge) { + fetch(forge::lapisReserve, cfIds.lapisReserve, "1.19.2") { it.maven } + } + mapper .writer() .withDefaultPrettyPrinter() diff --git a/buildSrc/src/main/kotlin/Uploads.kt b/buildSrc/src/main/kotlin/Uploads.kt index 5603e17..6319fb4 100644 --- a/buildSrc/src/main/kotlin/Uploads.kt +++ b/buildSrc/src/main/kotlin/Uploads.kt @@ -1,4 +1,4 @@ -@file:Suppress("ClassName") +@file:Suppress("ClassName", "MayBeConstant") object cfIds { val megane = "408118" @@ -11,6 +11,7 @@ object cfIds { val rebornCore = "237903" val techReborn = "233564" val wirelessNet = "461316" + val lapisReserve = "399679" } object cfSlugs { @@ -32,6 +33,7 @@ object cfSlugs { val rebornCore = "reborncore" val techReborn = "techreborn" val wirelessNet = "wireless-networks" + val lapisReserve = "lapis-reserve" } object mrIds { diff --git a/dependencies.json b/dependencies.json index e38962a..1ac6a24 100644 --- a/dependencies.json +++ b/dependencies.json @@ -24,6 +24,7 @@ "fabric.rebornCore" : "RebornCore:RebornCore-1.19:5.4.0", "fabric.techReborn" : "TechReborn:TechReborn-1.19:5.4.0", "fabric.wirelessNet" : "curse.maven:cursemod-461316:3876132", + "fabric.lapisReserve" : "curse.maven:cursemod-399679:3345208", "forge.wthit.api" : "mcp.mobius.waila:wthit-api:forge-5.25.0", "forge.wthit.runtime" : "mcp.mobius.waila:wthit:forge-5.25.0", "forge.badpackets" : "lol.bai:badpackets:forge-0.2.3", @@ -36,5 +37,6 @@ "forge.mekanism.generators" : "mekanism:Mekanism:1.20.1-10.3.9.13:generators", "forge.thermal.cofhCore" : "maven.modrinth:OWSRM4vD:ssRHxD6e", "forge.thermal.foundation" : "maven.modrinth:Xvg6q5Wp:kaIOIjDc", - "forge.thermal.expansion" : "maven.modrinth:hmD6rrUJ:W9opx6mY" + "forge.thermal.expansion" : "maven.modrinth:hmD6rrUJ:W9opx6mY", + "forge.lapisReserve" : "curse.maven:cursemod-399679:3787247" } \ No newline at end of file diff --git a/modules/fabric/build.gradle.kts b/modules/fabric/build.gradle.kts index 61a88ed..40ffee4 100644 --- a/modules/fabric/build.gradle.kts +++ b/modules/fabric/build.gradle.kts @@ -35,6 +35,7 @@ publishMods { cfSlugs.rebornCore, cfSlugs.techReborn, cfSlugs.wirelessNet, + cfSlugs.lapisReserve, ) } diff --git a/modules/fabric/curseforge.html b/modules/fabric/curseforge.html index 60e47fb..f3b451f 100644 --- a/modules/fabric/curseforge.html +++ b/modules/fabric/curseforge.html @@ -19,6 +19,7 @@

Supported Mods

  • Extra Generators
  • Industrial Revolution
  • Kibe
  • +
  • Lapis Reserve
  • Luggage
  • Modern Dynamics
  • Powah!
  • diff --git a/modules/fabric/lapis-reserve/build.gradle.kts b/modules/fabric/lapis-reserve/build.gradle.kts new file mode 100644 index 0000000..4bb9f14 --- /dev/null +++ b/modules/fabric/lapis-reserve/build.gradle.kts @@ -0,0 +1,13 @@ +metadata("lol.bai.megane.module.lapisreserve") { + waila("MeganeLapisReserve") + + fmj { + depends( + "lapisreserve" to any + ) + } +} + +dependencies { + modImplementation(deps.fabric.lapisReserve) +} diff --git a/modules/fabric/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/MeganeLapisReserve.java b/modules/fabric/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/MeganeLapisReserve.java new file mode 100644 index 0000000..07b763a --- /dev/null +++ b/modules/fabric/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/MeganeLapisReserve.java @@ -0,0 +1,15 @@ +package lol.bai.megane.module.lapisreserve; + +import lol.bai.megane.module.lapisreserve.provider.LapisReserveProvider; +import mcp.mobius.waila.api.IRegistrar; +import mcp.mobius.waila.api.IWailaPlugin; +import net.minecraft.world.level.block.entity.EnchantmentTableBlockEntity; + +public class MeganeLapisReserve implements IWailaPlugin { + + @Override + public void register(IRegistrar registrar) { + registrar.addBlockData(new LapisReserveProvider(), EnchantmentTableBlockEntity.class); + } + +} diff --git a/modules/fabric/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/provider/LapisReserveProvider.java b/modules/fabric/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/provider/LapisReserveProvider.java new file mode 100644 index 0000000..6a82e6a --- /dev/null +++ b/modules/fabric/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/provider/LapisReserveProvider.java @@ -0,0 +1,23 @@ +package lol.bai.megane.module.lapisreserve.provider; + +import mcp.mobius.waila.api.IDataProvider; +import mcp.mobius.waila.api.IDataWriter; +import mcp.mobius.waila.api.IPluginConfig; +import mcp.mobius.waila.api.IServerAccessor; +import mcp.mobius.waila.api.data.ItemData; +import net.minecraft.world.level.block.entity.EnchantmentTableBlockEntity; +import sf.ssf.sfort.PlayerInterface; + +public class LapisReserveProvider implements IDataProvider { + + @Override + public void appendData(IDataWriter data, IServerAccessor accessor, IPluginConfig config) { + data.add(ItemData.class, res -> { + var reserve = ((PlayerInterface) accessor.getPlayer().getInventory()).getLapisreserve(); + if (reserve.isEmpty()) return; + + res.add(ItemData.of(config).add(reserve)); + }); + } + +} diff --git a/modules/fabric/modrinth.md b/modules/fabric/modrinth.md index 6656d13..ee8af4c 100644 --- a/modules/fabric/modrinth.md +++ b/modules/fabric/modrinth.md @@ -15,6 +15,7 @@ Megane is a collection of [WTHIT](https://modrinth.com/mod/wthit) plugins that a - [Extra Generators](https://modrinth.com/mod/VXtwLg17) - [Industrial Revolution](https://www.curseforge.com/minecraft/mc-mods/industrial-revolution) - [Kibe](https://modrinth.com/mod/OvlwmUdC) +- [Lapis Reserve](https://www.curseforge.com/minecraft/mc-mods/lapis-reserve) - [Luggage](https://www.curseforge.com/minecraft/mc-mods/luggage) - [Modern Dynamics](https://modrinth.com/mod/fMpvLrnF) - [Powah!](https://modrinth.com/mod/KZO4S4DO) diff --git a/modules/forge/build.gradle.kts b/modules/forge/build.gradle.kts index f0d7089..6543a5a 100644 --- a/modules/forge/build.gradle.kts +++ b/modules/forge/build.gradle.kts @@ -27,7 +27,8 @@ publishMods { optional( cfSlugs.ae2, cfSlugs.createForge, - cfSlugs.ie + cfSlugs.ie, + cfSlugs.lapisReserve ) } @@ -154,9 +155,10 @@ tasks { ) } - val genWaila by tasks.getting(GenWailaTask::class) - mergeWaila.dependsOn(genWaila) - mergeWaila.input.add(genWaila.output) + tasks.withType(GenWailaTask::class) { + mergeWaila.dependsOn(this) + mergeWaila.input.add(output) + } } } @@ -166,9 +168,11 @@ tasks { } subprojects.forEach { sub -> + val subMain = sub.sourceSets.main.get() + sourceSets { main { - runtimeClasspath += sub.sourceSets.main.get().runtimeClasspath + runtimeClasspath += subMain.runtimeClasspath + subMain.output } } } diff --git a/modules/forge/curseforge.html b/modules/forge/curseforge.html index cad7a2c..4dbdcea 100644 --- a/modules/forge/curseforge.html +++ b/modules/forge/curseforge.html @@ -15,6 +15,7 @@

    Supported Mods

  • Applied Energistics 2
  • Create
  • Immersive Engineering
  • +
  • Lapis Reserve
  • Have other mods to suggest? Open an issue on GitHub. diff --git a/modules/forge/lapis-reserve/build.gradle.kts b/modules/forge/lapis-reserve/build.gradle.kts new file mode 100644 index 0000000..2082e37 --- /dev/null +++ b/modules/forge/lapis-reserve/build.gradle.kts @@ -0,0 +1,16 @@ +metadata("lol.bai.megane.module.lapisreserve") { + waila("MeganeLapisReserve") { + required("lapisreserve") + } + + forgeFml() + packMcmeta() + + modsToml{ + depends("lapisreserve" to any) + } +} + +dependencies { + implementation(fg.deobf(deps.forge.lapisReserve)) +} diff --git a/modules/forge/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/MeganeLapisReserve.java b/modules/forge/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/MeganeLapisReserve.java new file mode 100644 index 0000000..07b763a --- /dev/null +++ b/modules/forge/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/MeganeLapisReserve.java @@ -0,0 +1,15 @@ +package lol.bai.megane.module.lapisreserve; + +import lol.bai.megane.module.lapisreserve.provider.LapisReserveProvider; +import mcp.mobius.waila.api.IRegistrar; +import mcp.mobius.waila.api.IWailaPlugin; +import net.minecraft.world.level.block.entity.EnchantmentTableBlockEntity; + +public class MeganeLapisReserve implements IWailaPlugin { + + @Override + public void register(IRegistrar registrar) { + registrar.addBlockData(new LapisReserveProvider(), EnchantmentTableBlockEntity.class); + } + +} diff --git a/modules/forge/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/provider/LapisReserveProvider.java b/modules/forge/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/provider/LapisReserveProvider.java new file mode 100644 index 0000000..2ea828d --- /dev/null +++ b/modules/forge/lapis-reserve/src/main/java/lol/bai/megane/module/lapisreserve/provider/LapisReserveProvider.java @@ -0,0 +1,23 @@ +package lol.bai.megane.module.lapisreserve.provider; + +import mcp.mobius.waila.api.IDataProvider; +import mcp.mobius.waila.api.IDataWriter; +import mcp.mobius.waila.api.IPluginConfig; +import mcp.mobius.waila.api.IServerAccessor; +import mcp.mobius.waila.api.data.ItemData; +import net.minecraft.world.level.block.entity.EnchantmentTableBlockEntity; +import sf.ssf.sfort.lapisreserve.PlayerInterface; + +public class LapisReserveProvider implements IDataProvider { + + @Override + public void appendData(IDataWriter data, IServerAccessor accessor, IPluginConfig config) { + data.add(ItemData.class, res -> { + var reserve = ((PlayerInterface) accessor.getPlayer().getInventory()).getLapisreserve(); + if (reserve.isEmpty()) return; + + res.add(ItemData.of(config).add(reserve)); + }); + } + +} diff --git a/modules/forge/modrinth.md b/modules/forge/modrinth.md index 28ee232..3244445 100644 --- a/modules/forge/modrinth.md +++ b/modules/forge/modrinth.md @@ -11,6 +11,7 @@ Megane is a collection of [WTHIT](https://modrinth.com/mod/wthit) plugins that a - [Applied Energistics 2](https://modrinth.com/mod/XxWD5pD3) - [Create](https://modrinth.com/mod/LNytGWDc) - [Immersive Engineering](https://modrinth.com/mod/tIm2nV03) +- [Lapis Reserve](https://www.curseforge.com/minecraft/mc-mods/lapis-reserve) Have other mods to suggest? Open an issue on [GitHub](https://github.com/badasintended/megane/issues). diff --git a/settings.gradle.kts b/settings.gradle.kts index 5e0ed96..a6287e7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,6 +33,7 @@ fabric("deep-mob-learning-simulacrum") fabric("extra-generators") fabric("industrial-revolution") fabric("kibe") +fabric("lapis-reserve") fabric("luggage") fabric("modern-dynamics") fabric("powah") @@ -43,6 +44,7 @@ fabric("wireless-networks") forge("applied-energistics-2") forge("create") forge("immersive-engineering") +forge("lapis-reserve") //forge("mekanism") //forge("refined-storage") //forge("thermal-expansion")