Skip to content

Commit

Permalink
update to 1.19.2, fix ae2 mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Sep 1, 2022
1 parent a28e48f commit 38c2c39
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 102 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ afterEvaluate {
// addOptional(cfSlugs.create)
// addOptional(cfSlugs.dmlSim)
addOptional(cfSlugs.extraGen)
// addOptional(cfSlugs.indrev)
addOptional(cfSlugs.indrev)
addOptional(cfSlugs.kibe)
// addOptional(cfSlugs.lba)
addOptional(cfSlugs.luggage)
Expand Down
63 changes: 33 additions & 30 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,54 @@ import org.gradle.kotlin.dsl.DependencyHandlerScope
import org.gradle.kotlin.dsl.exclude

object versions {
val minecraft = "1.19"
val minecraft = "1.19.2"
}

object deps {
val minecraft = "com.mojang:minecraft:${versions.minecraft}"
val yarn = "net.fabricmc:yarn:1.19+build.4:v2"
val fabricLoader = "net.fabricmc:fabric-loader:0.14.8"

val wthit = "mcp.mobius.waila:wthit:fabric-5.6.1"
val fabricApi = "net.fabricmc.fabric-api:fabric-api:0.57.0+1.19"
val modmenu = "com.terraformersmc:modmenu:4.0.0"

val ae2 = "appeng:appliedenergistics2-fabric:12.0.1-alpha"
val dmlSim = "curse.maven:deep-mob-learning-simulacrum-508931:3785658"
val clothConfig = "me.shedaniel.cloth:cloth-config-fabric:6.2.62"
val extraGen = "curse.maven:extra-generators-475623:3856206"
val flk = "net.fabricmc:fabric-language-kotlin:1.8.0+kotlin.1.7.0"
val trEnergy = "teamreborn:energy:2.2.0"
val indrev = "curse.maven:industrial-revolution-391708:3759591"
val libgui = "io.github.cottonmc:LibGui:6.0.0+1.19"
val patchouli = "vazkii.patchouli:Patchouli:1.18.2-70-FABRIC"
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 noIndium = "me.luligabi:NoIndium:1.0.2+1.18.2"
val kibe = "curse.maven:kibe-388832:3842006"
val pal = "io.github.ladysnake:PlayerAbilityLib:1.6.0"
val rebornCore = "RebornCore:RebornCore-1.19:5.3.2"
val techReborn = "TechReborn:TechReborn-1.19:5.3.2"
val wirelessNet = "curse.maven:wireless-networks-461316:3876132"
val alloyForgery = "curse.maven:alloy-forgery-438718:3860382"
val yarn = "net.fabricmc:yarn:1.19.2+build.8:v2"
val fabricLoader = "net.fabricmc:fabric-loader:0.14.9"

val wthit = "mcp.mobius.waila:wthit:fabric-5.11.3"

val ae2 = "appeng:appliedenergistics2-fabric:12.1.2-beta"
val alloyForge = "maven.modrinth:jhl28YkY:2.0.16+1.19"
val create = "com.simibubi:Create:0.5.0c-708"
val clothConfig = "me.shedaniel.cloth:cloth-config-fabric:8.0.75+fabric"
val extraGen = "maven.modrinth:VXtwLg17:1.2.1-BETA+1.19"
val fabricApi = "net.fabricmc.fabric-api:fabric-api:0.60.0+1.19.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.19"
val modernDynamics = "maven.modrinth:fMpvLrnF:0.3.2-beta"
val modmenu = "com.terraformersmc:modmenu:4.0.6"
val noIndium = "me.luligabi:NoIndium:1.1.0+1.19"
val owo = "io.wispforest:owo-lib:0.7.3+1.19"
val create = "com.simibubi:Create:mc1.18.2_v0.4.1+628"
val modernDynamics = "curse.maven:modern-dynamics-552758:3875277"
val luggage = "curse.maven:luggage-594709:3870828"
val patchouli = "vazkii.patchouli:Patchouli:1.19.2-76-FABRIC"

val dmlSim = "curse.maven:cursemod-508931:3785658"
val indrev = "curse.maven:cursemod-391708:3940035"
val luggage = "curse.maven:cursemod-594709:3901069"
val pal = "io.github.ladysnake:PlayerAbilityLib:1.6.0"
val rebornCore = "RebornCore:RebornCore-1.19:5.3.4"
val techReborn = "TechReborn:TechReborn-1.19:5.3.4"
val wirelessNet = "curse.maven:cursemod-461316:3876132"

object lba {
val core = "alexiil.mc.lib:libblockattributes-core:0.10.2"
val fluids = "alexiil.mc.lib:libblockattributes-fluids:0.10.2"
val items = "alexiil.mc.lib:libblockattributes-items:0.10.2"
}

val trEnergy = "teamreborn:energy:2.2.0"
val libgui = "io.github.cottonmc:LibGui:6.0.1+1.19"
val magna = "com.github.GabrielOlvH:magna:0.5.2"
val stepAttr = "com.github.emilyploszaj:step-height-entity-attribute:v1.0.1"
val fakePlayer = "dev.cafeteria:fake-player-api:0.5.0"
}

fun DependencyHandlerScope.modImpl(dep: String) {
"modImplementation"(dep) {
if (!dep.startsWith("net.fabricmc.fabric-api")) exclude(group = "net.fabricmc.fabric-api")
exclude(group = "mezz.jei")
}
}
28 changes: 14 additions & 14 deletions buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ abstract class FetchLatestVersionsTask : DefaultTask() {
class VersionFetcherDsl<T>(
val versionFetcher: VersionFetcher<T>
) {
fun fetch(name: KProperty<*>, project: String, parser: (T) -> String) {
val res = versionFetcher.getLatestVersionFor(http, project, versions.minecraft)
fun fetch(name: KProperty<*>, project: String, mc: String = versions.minecraft, parser: (T) -> String) {
val res = versionFetcher.getLatestVersionFor(http, project, mc)
if (res != null) {
println("val ${name.name} = \"${parser(res)}\"")
} else {
Expand All @@ -35,36 +35,36 @@ abstract class FetchLatestVersionsTask : DefaultTask() {
fetch(deps::wthit, mrIds.wthit) { "mcp.mobius.waila:wthit:${it.version_number}" }
println()

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::ae2, mrIds.ae2, "1.19.1") { "appeng:appliedenergistics2-fabric:${it.version_number.removePrefix("fabric-")}" }
fetch(deps::alloyForge, mrIds.alloyForge, "1.19") { it.maven }
fetch(deps::create, mrIds.create, "1.18.2") { "com.simibubi:Create:${it.version_number.removePrefix("create-1.18.2-")}" }
fetch(deps::clothConfig, mrIds.clothConfig) { "me.shedaniel.cloth:cloth-config-fabric:${it.version_number}" }
fetch(deps::extraGen, mrIds.extraGen) { it.maven }
fetch(deps::extraGen, mrIds.extraGen, "1.19") { it.maven }
fetch(deps::fabricApi, mrIds.fabricApi) { "net.fabricmc.fabric-api:fabric-api:${it.version_number}" }
fetch(deps::flk, mrIds.flk) { "net.fabricmc:fabric-language-kotlin:${it.version_number}" }
fetch(deps::kibe, mrIds.kibe) { it.maven }
fetch(deps::kibe, mrIds.kibe, "1.19") { it.maven }
fetch(deps::modernDynamics, mrIds.modernDynamics) { it.maven }
fetch(deps::modmenu, mrIds.modmenu) { "com.terraformersmc:modmenu:${it.version_number}" }
fetch(deps::noIndium, mrIds.noIndium) { "me.luligabi:NoIndium:${it.version_number}" }
fetch(deps::owo, mrIds.owo) { "io.wispforest:owo-lib:${it.version_number}" }
fetch(deps::noIndium, mrIds.noIndium, "1.19") { "me.luligabi:NoIndium:${it.version_number}" }
fetch(deps::owo, mrIds.owo, "1.19") { "io.wispforest:owo-lib:${it.version_number}" }
fetch(deps::patchouli, mrIds.patchouli) { "vazkii.patchouli:Patchouli:${it.version_number.toUpperCase(Locale.ROOT)}" }
}

println()

fetcher(CurseForgeVersionFetcher) {
fetch(deps::dmlSim, cfIds.dmlSim) { it.maven }
fetch(deps::dmlSim, cfIds.dmlSim, "1.18.2") { it.maven }
fetch(deps::indrev, cfIds.indrev) { it.maven }
fetch(deps::luggage, cfIds.luggage) { it.maven }
fetch(deps::pal, cfIds.pal) { "io.github.ladysnake:PlayerAbilityLib:${it.download.fileName.removePrefix("pal-")}" }
fetch(deps::rebornCore, cfIds.rebornCore) { "RebornCore:RebornCore-1.18:${it.download.fileName.removePrefix("RebornCore-")}" }
fetch(deps::techReborn, cfIds.techReborn) { "TechReborn:TechReborn-1.18:${it.download.fileName.removePrefix("TechReborn-")}" }
fetch(deps::wirelessNet, cfIds.wirelessNet) { it.maven }
fetch(deps::rebornCore, cfIds.rebornCore) { "RebornCore:RebornCore-1.19:${it.download.fileName.removePrefix("RebornCore-")}" }
fetch(deps::techReborn, cfIds.techReborn) { "TechReborn:TechReborn-1.19:${it.download.fileName.removePrefix("TechReborn-")}" }
fetch(deps::wirelessNet, cfIds.wirelessNet, "1.19") { it.maven }

println("\nobject lba {")
deps.lba::class.memberProperties.forEach { module ->
@Suppress("UNCHECKED_CAST")
fetch(module as KProperty<String>, cfIds.lba) {
fetch(module as KProperty<String>, cfIds.lba, "1.18.2") {
"alexiil.mc.lib:libblockattributes-${module.name}:${it.download.fileName.removePrefix("libblockattributes-all-")}"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package lol.bai.megane.runtime.provider.block;

import java.util.List;
import java.util.Map;

import lol.bai.megane.api.provider.FluidInfoProvider;
import lol.bai.megane.api.util.BarFormat;
Expand All @@ -25,7 +24,6 @@
import static lol.bai.megane.runtime.util.Keys.F_NBT;
import static lol.bai.megane.runtime.util.Keys.F_SIZE;
import static lol.bai.megane.runtime.util.Keys.F_STORED;
import static lol.bai.megane.runtime.util.MeganeUtils.CONFIG;
import static lol.bai.megane.runtime.util.MeganeUtils.config;
import static lol.bai.megane.runtime.util.MeganeUtils.fluidName;
import static lol.bai.megane.runtime.util.MeganeUtils.id;
Expand All @@ -43,10 +41,8 @@ protected void addFluid(ITooltip tooltip, IBlockAccessor accessor, Fluid fluid,
BlockPos pos = accessor.getPosition();
World world = accessor.getWorld();

Map<Identifier, Integer> colors = config().fluid.getColors();
boolean expand = accessor.getPlayer().isSneaking() && config().fluid.isExpandWhenSneak();

Identifier id = Registry.FLUID.getId(fluid);
List<FluidInfoProvider> providers = Registrar.FLUID_INFO.get(fluid);
FluidInfoProvider provider = null;

Expand All @@ -59,18 +55,7 @@ protected void addFluid(ITooltip tooltip, IBlockAccessor accessor, Fluid fluid,
}
}

int color;
if (nbt != null && provider != null) {
color = provider.getColor() & 0xFFFFFF;
} else if (colors.containsKey(id)) {
color = colors.get(id);
} else {
color = provider == null
? colors.computeIfAbsent(DEFAULT, s -> 0x0D0D59)
: provider.getColor() & 0xFFFFFF;
colors.put(id, color);
CONFIG.save();
}
int color = provider != null ? provider.getColor() : 0x0D0D59;

tooltip.addLine(new PairComponent(
new WrappedComponent(provider == null ? fluidName(fluid) : provider.getName()),
Expand Down

This file was deleted.

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

import appeng.api.integrations.igtooltip.TooltipBuilder;
import appeng.api.integrations.igtooltip.TooltipContext;
import appeng.integration.modules.igtooltip.blocks.PowerStorageDataProvider;
import net.minecraft.block.entity.BlockEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Unique;

@SuppressWarnings("UnstableApiUsage")
@Mixin(PowerStorageDataProvider.class)
public class MixinPowerStorageDataProvider {

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

@Unique
private static boolean firstCall = true;

/**
* @author deirn
* @reason Remove AE2's own energy tooltip, since megane provides it
*/
@Overwrite
public void buildTooltip(BlockEntity object, TooltipContext context, TooltipBuilder tooltip) {
if (firstCall) {
firstCall = false;
LOGGER.info("[Megane] Replaced AE2's own energy tooltip with Megane's");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"defaultRequire": 1
},
"mixins" : [
"MixinBlockEntityDataProvider"
"MixinPowerStorageDataProvider"
]
}
7 changes: 0 additions & 7 deletions module-compat/industrial-revolution/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@ repositories {
}

dependencies {
runtimeOnly(namedProject("reborn-energy"))
runtimeOnly(namedProject("fabric-transfer"))
runtimeOnly(namedProject("lib-block-attributes"))

modImpl(deps.indrev)
modImpl(deps.fabricApi)
modImpl(deps.flk)
modImpl(deps.trEnergy)
modImpl(deps.libgui)
modImpl(deps.patchouli)
modImpl(deps.lba.core)
modImpl(deps.lba.fluids)
modImpl(deps.lba.items)
modImpl(deps.magna)
modImpl(deps.stepAttr)
modImpl(deps.fakePlayer)
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ compat("applied-energistics-2")
//compat("deep-mob-learning-simulacrum")
compat("extra-generators")
compat("fabric-transfer")
//compat("industrial-revolution")
compat("industrial-revolution")
compat("kibe")
//compat("lib-block-attributes")
compat("luggage")
Expand Down

0 comments on commit 38c2c39

Please sign in to comment.