Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support For AE2-Extend-Life #119

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 85 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ buildscript {
dirs 'libs'
}
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://files.minecraftforge.net/maven"}
// maven { url "https://files.minecraftforge.net/maven"}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
// classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
// classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.4.0'
}
}

plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.50"
id 'net.minecraftforge.gradle' version '5.1.+'
id 'wtf.gofancy.fancygradle' version '1.1.+'
}

apply plugin: 'net.minecraftforge.gradle.forge'
//apply plugin: 'net.minecraftforge.gradle.forge'
//apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'idea'
apply plugin: 'com.matthewprenger.cursegradle'
Expand All @@ -42,19 +44,69 @@ compileJava {

logger.lifecycle "$archivesBaseName-$version"
logger.lifecycle "" + version
//version = "${config.version.minecraft}-${config.version.forge}"

minecraft {
version = "${config.version.minecraft}-${config.version.forge}"
runDir = "run"
mappings = 'snapshot_20180814'
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'stable', version: '39-1.12'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

replace "@VERSION@", actualVersion
// replace '@VERSION@', actualVersion

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

//JvmArgs += "-Dfml.coreMods.load=com.github.vfyjxf.nee.asm.NEELoadingPlugin"
}

server {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

//JvmArgs += "-Dfml.coreMods.load=com.github.vfyjxf.nee.asm.NEELoadingPlugin"
}
}
}

//minecraft {
// version = "${config.version.minecraft}-${config.version.forge}"
// runDir = "run"
// mappings = 'snapshot_20180814'
//
// replace "@VERSION@", actualVersion
//}

//minecraft {
// version = "1.12.2-14.23.5.2847"
// runDir = "run"
// mappings = "stable_39"
// useDepAts = true
// makeObfSourceJar = false
//}
repositories {
gradlePluginPortal()
maven {
url "http://maven.shadowfacts.net/"
url "https://maven.shadowfacts.net/"
}
maven {
name 'Mobius Repo'
Expand Down Expand Up @@ -102,44 +154,50 @@ repositories {
}
maven { url = "https://www.cursemaven.com" }
maven { url = "https://maven.hypherionmc.me/" }
maven { url 'https://jitpack.io' }
flatDir {
dirs 'libs'
}
}

dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
compileOnly "org.jetbrains.kotlin:kotlin-reflect:${config.kotlin_version}"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${config.kotlin_version}"

compile group: "net.shadowfacts", name: "Forgelin", version: "1.8.4"

deobfProvided ("mcp.mobius.waila:Hwyla:${config.version.waila}:api") {
compileOnly ("mcp.mobius.waila:Hwyla:${config.version.waila}:api") {
transitive = false
}

deobfCompile "cofh:RedstoneFlux:${config.version.rf}:universal"
compileOnly "cofh:RedstoneFlux:${config.version.rf}:universal"

compileOnly ("cofh:CoFHCore:${config.version.cofh}:deobf") {
transitive = false
}

//deobfProvided ("li.cil.oc:OpenComputers:${config.version.oc}:api")
deobfProvided ("li.cil.oc:OpenComputers:${config.version.oc}")
compileOnly ("li.cil.oc:OpenComputers:${config.version.oc}")

deobfProvided "mezz.jei:jei_${config.version.minecraft}:${config.version.jei}:api"
compileOnly "mezz.jei:jei_${config.version.minecraft}:${config.version.jei}:api"
// runtime "mezz.jei:jei_${config.version.minecraft}:${config.version.jei}"

deobfProvided "com.mod-buildcraft:buildcraft-api:${config.version.bc}"
compileOnly "com.mod-buildcraft:buildcraft-api:${config.version.bc}"
runtime "com.mod-buildcraft:buildcraft:${config.version.bc}"

// deobfCompile "igwmod:IGW-Mod-${config.version.minecraft}:${config.version.igw}:universal"

// deobfCompile "mekanism:Mekanism:${config.version.me}"
deobfCompile "curse.maven:mekanism-268560:${config.version.me}"
deobfCompile "p455w0rd:p455w0rdslib:${config.version.pl}"
deobfCompile "p455w0rd:AE2WTLib:${config.version.wt}:api"
compileOnly "curse.maven:mekanism-268560:${config.version.me}"
compileOnly "p455w0rd:p455w0rdslib:${config.version.pl}"
compileOnly "p455w0rd:AE2WTLib:${config.version.wt}:api"
runtime "p455w0rd:AE2WTLib:${config.version.wt}"
compileOnly "p455w0rd:WirelessCraftingTerminal:${config.version.wc}:api"
runtime "p455w0rd:WirelessCraftingTerminal:${config.version.wc}"
runtime "p455w0rd:MouseTweaks:2.10"

deobfProvided "curse.maven:gas-conduits-309756:3328809"
compileOnly "curse.maven:gas-conduits-309756:3328809"

// deobfCompile ("appeng:appliedenergistics2:${config.version.ae}:api"){
// transitive = false
Expand All @@ -148,29 +206,32 @@ dependencies {

deobfCompile "MCMultiPart2:MCMultiPart:${config.version.mcmp}"
// deobfCompile "baubles:Baubles:1.12:${config.version.baubles}"
deobfCompile "curse.maven:baubles-227083:${config.version.baubles}"
compileOnly "curse.maven:baubles-227083:${config.version.baubles}"

deobfProvided ("com.enderio:EnderIO:1.12.2-5.3.70:api") {
compileOnly ("com.enderio:EnderIO:1.12.2-5.3.70:api") {
transitive = false
}

deobfProvided ("com.enderio:EnderIO:1.12.2-5.3.70") {
compileOnly ("com.enderio:EnderIO:1.12.2-5.3.70") {
transitive = false
}

deobfProvided "com.enderio.core:EnderCore:1.12.2-0.5.76"
compileOnly "com.enderio.core:EnderCore:1.12.2-0.5.76"

compile "info.loenwind.autoconfig:AutoConfig:1.12.2-1.0.2"
compile "info.loenwind.autosave:AutoSave:1.12.2-1.0.11"
}

processResources {
inputs.property "version", project.version
duplicatesStrategy = DuplicatesStrategy.INCLUDE

from(sourceSets.main.resources.srcDirs) {
include '**/*.lang'
include '**/*.info'
include '**/*.properties'

expand 'version': project.version, 'mcversion': project.minecraft.version
// expand 'version': project.version, 'mc_version': project.minecraft.version
}

from(sourceSets.main.resources.srcDirs) {
Expand All @@ -187,6 +248,7 @@ compileKotlin {
}

task apiJar(type: Jar) {
// duplicatesStrategy = DuplicatesStrategy.INCLUDE
classifier = 'api'
from sourceSets.main.output
from sourceSets.main.java
Expand Down Expand Up @@ -223,7 +285,7 @@ if (System.getenv("CURSEFORGE_API_KEY") != null) {
}
}

sourceJar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
//sourceJar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
apiJar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
jar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version.minecraft=1.12.2
version.mappings=snapshot_20171212
#version.forge=14.23.5.2855
version.forge=14.23.5.2847
version.ae=rv6-stable-7
version.ae=rv6.stable.7
version.oc=MC1.12.2-1.7.5.192
version.baubles=2518667
version.bc=7.99.15
Expand Down
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Oct 17 23:45:09 SGT 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,20 @@ public IAEFluidStack[] getCondensedFluidInputs() {

@Override
public IAEItemStack[] getCondensedInputs() {
if (this.pattern == null)
{
return new IAEItemStack[0];
}
return removeFluidContainers(this.pattern.getCondensedInputs(), true);
}

@Override
public IAEItemStack[] getCondensedOutputs() {
if (this.pattern == null)
{
return new IAEItemStack[0];
}

return this.pattern.getCondensedOutputs();
}

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/the9grounds/aeadditions/util/GasUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasStack;
import mekanism.api.gas.IGasItem;
import org.jetbrains.annotations.Nullable;

public class GasUtil {

public static IAEFluidStack createAEFluidStack(Gas gas) {
return createAEFluidStack(new FluidStack(MekanismGas.fluidGas.get(gas),1000));
}

@Nullable
public static IAEFluidStack createAEFluidStack(GasStack gasStack) {
return gasStack == null ? null : createAEFluidStack(new FluidStack(MekanismGas.fluidGas.get(gasStack.getGas()), gasStack.amount));
}
Expand All @@ -36,6 +38,7 @@ public static IAEFluidStack createAEFluidStack(Gas gas, long amount) {
amount);
}

@Nullable
public static IAEFluidStack createAEFluidStack(IAEGasStack gasStack){
if (gasStack == null || gasStack.getGas() == null)
return null;
Expand All @@ -54,6 +57,7 @@ public static IAEGasStack createAEGasStack(Gas gas, long amount) {
return createAEGasStack(gas).setStackSize(amount);
}

@Nullable
public static IAEGasStack createAEGasStack(IAEFluidStack fluidStack) {
if (fluidStack == null || fluidStack.getFluid() == null || !isGas(fluidStack.getFluid()))
return null;
Expand Down Expand Up @@ -173,6 +177,7 @@ public static GasStack getGasStack(FluidStack fluidStack) {
return null;
}

@Nullable
public static GasStack getGasStack(IAEFluidStack fluidStack) {
if (fluidStack == null) {
return null;
Expand All @@ -184,6 +189,7 @@ public static GasStack getGasStack(IAEFluidStack fluidStack) {
return null;
}

@Nullable
public static FluidStack getFluidStack(GasStack gasStack) {
if (gasStack == null) {
return null;
Expand All @@ -203,6 +209,7 @@ public static boolean isGas(Fluid fluid) {
return fluid != null && fluid instanceof MekanismGas.GasFluid;
}

@Nullable
public static Gas getGas(Fluid fluid) {
if (fluid == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.the9grounds.aeadditions.wireless;

import appeng.core.sync.GuiBridge;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import appeng.api.features.IWirelessTermHandler;
import appeng.api.util.IConfigManager;
import com.the9grounds.aeadditions.api.IWirelessGasFluidTermHandler;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class AEWirelessTermHandler implements IWirelessTermHandler {

Expand All @@ -24,6 +26,9 @@ public IConfigManager getConfigManager(ItemStack is) {
return new ConfigManager();
}

public IGuiHandler getGuiHandler(ItemStack itemStack){ return GuiBridge.GUI_WIRELESS_TERM;
}

@Override
public String getEncryptionKey(ItemStack item) {
IWirelessGasFluidTermHandler handler = WirelessTermRegistry
Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/com/the9grounds/aeadditions/AEAdditions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
import net.minecraftforge.fml.common.network.NetworkRegistry
import org.apache.logging.log4j.Logger
import java.io.File

@Mod(
Expand All @@ -41,6 +42,8 @@ object AEAdditions {

@JvmField val integration = Integration()
private var configFolder: File? = null

@JvmStatic var logger: Logger? = null
@JvmStatic var packetHandler: PacketHandler? = null
get() {
Preconditions.checkNotNull(field)
Expand All @@ -54,6 +57,7 @@ object AEAdditions {

@Mod.EventHandler
fun preInit(event: FMLPreInitializationEvent) {
logger = event.modLog
packetHandler = PacketHandler()
NetworkRegistry.INSTANCE.registerGuiHandler(this, GuiHandler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class MEMonitorFluidGasWrapper(val gasMonitor: IMEMonitor<IAEGasStack>) : IMEMon

final val listeners = mutableMapOf<IMEMonitorHandlerReceiver<IAEFluidStack>, Any?>()

override fun injectItems(fluidStack: IAEFluidStack?, actionable: Actionable?, actionSource: IActionSource?): IAEFluidStack {
override fun injectItems(fluidStack: IAEFluidStack?, actionable: Actionable?, actionSource: IActionSource?): IAEFluidStack? {
return GasUtil.createAEFluidStack(gasMonitor.injectItems(GasUtil.createAEGasStack(fluidStack), actionable, actionSource))
}

override fun extractItems(fluidStack: IAEFluidStack?, actionable: Actionable?, actionSource: IActionSource?): IAEFluidStack {
override fun extractItems(fluidStack: IAEFluidStack?, actionable: Actionable?, actionSource: IActionSource?): IAEFluidStack? {
return GasUtil.createAEFluidStack(gasMonitor.extractItems(GasUtil.createAEGasStack(fluidStack), actionable, actionSource))
}

Expand Down Expand Up @@ -65,7 +65,11 @@ class MEMonitorFluidGasWrapper(val gasMonitor: IMEMonitor<IAEGasStack>) : IMEMon
val changes = mutableListOf<IAEFluidStack>()

iterable.forEach {
changes.add(GasUtil.createAEFluidStack(it))
var aeFluidStack = GasUtil.createAEFluidStack(it)
if (aeFluidStack != null){
changes.add(aeFluidStack)
}

}

this.listeners.forEach { (k, _) ->
Expand Down
Loading
Loading