Skip to content

Commit

Permalink
update deps, fix ae2 and alloy forgery mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Nov 12, 2022
1 parent d0b931b commit 6739cc8
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 53 deletions.
21 changes: 11 additions & 10 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ object deps {
val yarn = "net.fabricmc:yarn:1.18.2+build.3:v2"
val fabricLoader = "net.fabricmc:fabric-loader:0.14.9"

val wthit = "mcp.mobius.waila:wthit:fabric-4.13.3"
val wthit = "mcp.mobius.waila:wthit:fabric-4.13.4"

val ae2 = "appeng:appliedenergistics2-fabric:11.1.6"
val alloyForge = "maven.modrinth:jhl28YkY:2.0.13+1.18"
val create = "com.simibubi:Create:0.5.0c-708"
val clothConfig = "me.shedaniel.cloth:cloth-config-fabric:6.2.62"
val ae2 = "appeng:appliedenergistics2-fabric:11.6.2"
val alloyForge = "maven.modrinth:jhl28YkY:2.0.16+1.18.2"
val create = "com.simibubi.create:create-fabric-1.18.2:0.5.0e-733"
val clothConfig = "me.shedaniel.cloth:cloth-config-fabric:6.3.81"
val extraGen = "maven.modrinth:VXtwLg17:1.2.1-BETA+1.18"
val fabricApi = "net.fabricmc.fabric-api:fabric-api:0.58.0+1.18.2"
val flk = "net.fabricmc:fabric-language-kotlin:1.8.3+kotlin.1.7.10"
val kibe = "maven.modrinth:OvlwmUdC:1.9.9-BETA+1.18"
val modernDynamics = "maven.modrinth:fMpvLrnF:0.2.5-beta"
val modmenu = "com.terraformersmc:modmenu:3.2.3"
val fabricApi = "net.fabricmc.fabric-api:fabric-api:0.66.0+1.18.2"
val flk = "net.fabricmc:fabric-language-kotlin:1.8.6+kotlin.1.7.21"
val kibe = "maven.modrinth:OvlwmUdC:1.9.10-BETA+1.18"
val modernDynamics = "maven.modrinth:fMpvLrnF:0.2.6-beta"
val modmenu = "com.terraformersmc:modmenu:3.2.4"
val noIndium = "me.luligabi:NoIndium:1.0.2+1.18.2"
val owo = "io.wispforest:owo-lib:0.7.2-no-cme+1.18"
val patchouli = "vazkii.patchouli:Patchouli:1.18.2-71.1-FABRIC"
Expand All @@ -46,6 +46,7 @@ object deps {
val magna = "com.github.Draylar:magna:1.7.1-1.18"
val stepAttr = "com.github.emilyploszaj:step-height-entity-attribute:v1.0.1"
val fakePlayer = "dev.cafeteria:fake-player-api:0.3.0"
val mixinExtras = "com.github.LlamaLad7:MixinExtras:0.1.1-rc.4"
}

fun DependencyHandlerScope.modImpl(dep: String, dependencyConfiguration: ExternalModuleDependency.() -> Unit = {}) {
Expand Down
26 changes: 20 additions & 6 deletions buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import org.gradle.api.tasks.TaskAction
import version.CurseForgeVersionFetcher
import version.ModrinthVersionFetcher
import version.VersionFetcher
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.net.http.HttpClient
import java.util.*
import kotlin.reflect.KProperty
Expand All @@ -12,15 +14,21 @@ import kotlin.reflect.full.memberProperties
abstract class FetchLatestVersionsTask : DefaultTask() {
@TaskAction
fun run() {
val output = StringBuilder()
val http = HttpClient.newHttpClient()

fun out(line: String = "") {
output.appendLine(line)
println(line)
}

class VersionFetcherDsl<T>(
val versionFetcher: VersionFetcher<T>
) {
fun fetch(name: KProperty<*>, project: String, parser: (T) -> String) {
val res = versionFetcher.getLatestVersionFor(http, project, versions.minecraft)
if (res != null) {
println("val ${name.name} = \"${parser(res)}\"")
out("val ${name.name} = \"${parser(res)}\"")
} else {
throw GradleException("Failed to get version for ${name}")
}
Expand All @@ -33,11 +41,15 @@ abstract class FetchLatestVersionsTask : DefaultTask() {

fetcher(ModrinthVersionFetcher) {
fetch(deps::wthit, mrIds.wthit) { "mcp.mobius.waila:wthit:${it.version_number}" }
println()
out()

fetch(deps::ae2, mrIds.ae2) { "appeng:appliedenergistics2-fabric:${it.version_number.removePrefix("fabric-")}" }
fetch(deps::alloyForge, mrIds.alloyForge) { it.maven }
fetch(deps::create, mrIds.create) { "com.simibubi:Create:${it.version_number.removePrefix("create-1.18.2-")}" }
fetch(deps::create, mrIds.create) {
"com.simibubi.create:create-fabric-${
it.version_number.removePrefix("create-fabric-").replaceFirst('-', ':')
}"
}
fetch(deps::clothConfig, mrIds.clothConfig) { "me.shedaniel.cloth:cloth-config-fabric:${it.version_number}" }
fetch(deps::extraGen, mrIds.extraGen) { it.maven }
fetch(deps::fabricApi, mrIds.fabricApi) { "net.fabricmc.fabric-api:fabric-api:${it.version_number}" }
Expand All @@ -50,7 +62,7 @@ abstract class FetchLatestVersionsTask : DefaultTask() {
fetch(deps::patchouli, mrIds.patchouli) { "vazkii.patchouli:Patchouli:${it.version_number.toUpperCase(Locale.ROOT)}" }
}

println()
out()

fetcher(CurseForgeVersionFetcher) {
fetch(deps::dmlSim, cfIds.dmlSim) { it.maven }
Expand All @@ -61,15 +73,17 @@ abstract class FetchLatestVersionsTask : DefaultTask() {
fetch(deps::techReborn, cfIds.techReborn) { "TechReborn:TechReborn-1.18:${it.download.fileName.removePrefix("TechReborn-")}" }
fetch(deps::wirelessNet, cfIds.wirelessNet) { it.maven }

println("\nobject lba {")
out("\nobject lba {")
deps.lba::class.memberProperties.forEach { module ->
@Suppress("UNCHECKED_CAST")
fetch(module as KProperty<String>, cfIds.lba) {
"alexiil.mc.lib:libblockattributes-${module.name}:${it.download.fileName.removePrefix("libblockattributes-all-")}"
}
}
println("}")
out("}")
}

Toolkit.getDefaultToolkit().systemClipboard.setContents(StringSelection(output.toString()), null)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public interface AccessorForgeControllerBlockEntity {
ForgeDefinition getForgeDefinition();

@Accessor
int getFuel();

float getFuel();

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected void init() {

@Override
public long getStored() {
return access.getFuel();
return Math.round(access.getFuel());
}

@Override
Expand Down
5 changes: 4 additions & 1 deletion module-compat/applied-energistics-2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ dependencies {
runtimeOnly(namedProject("reborn-energy"))
runtimeOnly(namedProject("fabric-transfer"))

modImpl(deps.ae2)
modImpl(deps.ae2) {
exclude("curse.maven:jade-324717")
exclude("mezz.jei:jei-${deps.minecraft}-fabric")
}
modImpl(deps.fabricApi)
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package lol.bai.megane.module.ae2.mixin;

import appeng.api.integrations.igtooltip.providers.ServerDataProvider;
import appeng.integration.modules.igtooltip.blocks.PowerStorageDataProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(targets = "appeng.integration.modules.wthit.WthitModule$1")
public class MixinWthitModule1 {

@Unique
private static final Logger LOGGER = LoggerFactory.getLogger("MixinWthitModule1");

@Inject(method = "addBlockEntityData", at = @At("HEAD"), cancellable = true, remap = false)
private void megane_removePowerTooltip(Class<?> blockEntityClass, ServerDataProvider<?> provider, CallbackInfo ci) {
if (provider instanceof PowerStorageDataProvider) {
LOGGER.info("[megane-applied-energistics-2] Disabled AE2's builtin power tooltip in favor of Megane's");
ci.cancel();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"defaultRequire": 1
},
"mixins" : [
"MixinBlockEntityDataProvider"
"MixinWthitModule1"
]
}
2 changes: 2 additions & 0 deletions module-compat/create/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ repositories {
dependencies {
modImpl(deps.create) {
exclude("dev.emi:emi")
exclude("com.github.LlamaLad7:MixinExtras")
}
modImpl(deps.fabricApi)
modImpl(deps.mixinExtras)
}

0 comments on commit 6739cc8

Please sign in to comment.