Skip to content

Commit

Permalink
add lapis reserve compat
Browse files Browse the repository at this point in the history
closes #66
  • Loading branch information
deirn committed Apr 28, 2024
1 parent efe2ecc commit 10ed7f3
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 8 deletions.
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}

Expand All @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/Uploads.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("ClassName")
@file:Suppress("ClassName", "MayBeConstant")

object cfIds {
val megane = "408118"
Expand All @@ -11,6 +11,7 @@ object cfIds {
val rebornCore = "237903"
val techReborn = "233564"
val wirelessNet = "461316"
val lapisReserve = "399679"
}

object cfSlugs {
Expand All @@ -32,6 +33,7 @@ object cfSlugs {
val rebornCore = "reborncore"
val techReborn = "techreborn"
val wirelessNet = "wireless-networks"
val lapisReserve = "lapis-reserve"
}

object mrIds {
Expand Down
4 changes: 3 additions & 1 deletion dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
1 change: 1 addition & 0 deletions modules/fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ publishMods {
cfSlugs.rebornCore,
cfSlugs.techReborn,
cfSlugs.wirelessNet,
cfSlugs.lapisReserve,
)
}

Expand Down
1 change: 1 addition & 0 deletions modules/fabric/curseforge.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ <h2>Supported Mods</h2>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/extra-generators">Extra Generators</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/industrial-revolution">Industrial Revolution</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/kibe">Kibe</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/lapis-reserve">Lapis Reserve</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/luggage">Luggage</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/modern-dynamics">Modern Dynamics</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/powah-rearchitected">Powah!</a></li>
Expand Down
13 changes: 13 additions & 0 deletions modules/fabric/lapis-reserve/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
metadata("lol.bai.megane.module.lapisreserve") {
waila("MeganeLapisReserve")

fmj {
depends(
"lapisreserve" to any
)
}
}

dependencies {
modImplementation(deps.fabric.lapisReserve)
}
Original file line number Diff line number Diff line change
@@ -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);
}

}
Original file line number Diff line number Diff line change
@@ -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<EnchantmentTableBlockEntity> {

@Override
public void appendData(IDataWriter data, IServerAccessor<EnchantmentTableBlockEntity> 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));
});
}

}
1 change: 1 addition & 0 deletions modules/fabric/modrinth.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 9 additions & 5 deletions modules/forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ publishMods {
optional(
cfSlugs.ae2,
cfSlugs.createForge,
cfSlugs.ie
cfSlugs.ie,
cfSlugs.lapisReserve
)
}

Expand Down Expand Up @@ -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)
}
}
}

Expand All @@ -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
}
}
}
Expand Down
1 change: 1 addition & 0 deletions modules/forge/curseforge.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h2>Supported Mods</h2>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/applied-energistics-2">Applied Energistics 2</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/create">Create</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/immersive-engineering">Immersive Engineering</a></li>
<li><a href="https://www.curseforge.com/minecraft/mc-mods/lapis-reserve">Lapis Reserve</a></li>
</ul>
Have other mods to suggest? Open an issue on <a href="https://github.com/badasintended/megane/issues">GitHub</a>.

Expand Down
16 changes: 16 additions & 0 deletions modules/forge/lapis-reserve/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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))
}
Original file line number Diff line number Diff line change
@@ -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);
}

}
Original file line number Diff line number Diff line change
@@ -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<EnchantmentTableBlockEntity> {

@Override
public void appendData(IDataWriter data, IServerAccessor<EnchantmentTableBlockEntity> 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));
});
}

}
1 change: 1 addition & 0 deletions modules/forge/modrinth.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

0 comments on commit 10ed7f3

Please sign in to comment.