Skip to content

Commit

Permalink
Add Integration for AE2FC Fluid Storage Cells (#143)
Browse files Browse the repository at this point in the history
Co-authored-by: Julia Dijkstra <[email protected]>
  • Loading branch information
Vlamonster and Julia Dijkstra authored Jan 29, 2025
1 parent 0e5e32f commit eede104
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 12 deletions.
22 changes: 11 additions & 11 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ dependencies {

compile("com.google.code.findbugs:jsr305:3.0.2")

compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-518-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-533-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:EnderStorage:1.7.0:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.63:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.101:dev") {transitive = false }
compile("com.github.GTNewHorizons:ForestryMC:4.10.1:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Railcraft:9.16.2:dev") {transitive = false }
compile("com.github.GTNewHorizons:NotEnoughItems:2.7.18-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.6.0:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Railcraft:9.16.3:dev") {transitive = false }
compile("com.github.GTNewHorizons:NotEnoughItems:2.7.27-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.6.2:dev") {transitive = false }
compile("com.github.GTNewHorizons:CodeChickenLib:1.3.0:dev") {transitive = false }
compile("com.github.GTNewHorizons:CodeChickenCore:1.4.1:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:waila:1.8.2:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Galacticraft:3.3.1-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Galacticraft:3.3.4-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:TinkersMechworks:0.4.0:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:ProjectRed:4.11.0-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:BloodMagic:1.7.0:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.7.4-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:BloodMagic:1.7.5:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.7.5-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:ExtraCells2:2.5.35:dev") {transitive = false }
compileOnly('com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.16-gtnh:dev') {transitive = false }
compileOnly('com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.28-gtnh:dev') {transitive = false }
compile("com.github.GTNewHorizons:EnderIO:2.9.2:dev") {
compile("com.github.GTNewHorizons:EnderCore:0.4.6:dev")
transitive = false
}
compileOnly("com.github.GTNewHorizons:Avaritiaddons:1.8.4-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:gendustry:1.9.0-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:gendustry:1.9.1-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:WirelessRedstone-CBE:1.7.0:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.42:dev") {transitive = false }
compileOnly("appeng:RotaryCraft:V5c:api") {transitive = false }
Expand All @@ -47,7 +47,7 @@ dependencies {
compileOnly("curse.maven:agricraft-225635:2284133") {transitive = false }
compileOnly("curse.maven:stargatetech-2-226769:2230351") {transitive = false }

compileOnlyApi("com.github.GTNewHorizons:Angelica:1.0.0-beta28:api") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Angelica:1.0.0-beta30:api") { transitive = false }

compileOnly(deobf("https://immibis.com/mcmoddl/files/redlogic-59.1.13.jar"))
compileOnly files("dependencies/ic2classic-api.zip") //curseforge one does NOT work ...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package li.cil.oc.integration.ae2fc;

import appeng.api.AEApi;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.StorageChannel;
import appeng.util.IterationCounter;
import com.glodblock.github.common.storage.IFluidCellInventory;
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
import com.glodblock.github.common.storage.IStorageFluidCell;
import li.cil.oc.api.driver.Converter;
import net.minecraft.item.ItemStack;

import java.util.Map;

public final class ConverterFluidCellInventory implements Converter {
@Override
public void convert(final Object value, final Map<Object, Object> output) {
if (value instanceof IFluidCellInventory) {
final IFluidCellInventory cell = (IFluidCellInventory) value;
output.put("storedFluidTypes", cell.getStoredFluidTypes());
output.put("storedFluidCount", cell.getStoredFluidCount());
output.put("remainingFluidCount", cell.getRemainingFluidCount());
output.put("remainingFluidTypes", cell.getRemainingFluidTypes());

output.put("totalFluidTypes", cell.getTotalFluidTypes());
output.put(
"availableFluids",
cell.getAvailableItems(AEApi.instance().storage().createFluidList(), IterationCounter.fetchNewId()));

output.put("totalBytes", cell.getTotalBytes());
output.put("freeBytes", cell.getFreeBytes());
output.put("usedBytes", cell.getUsedBytes());
output.put("unusedFluidCount", cell.getUnusedFluidCount());
output.put("canHoldNewFluid", cell.canHoldNewFluid());

output.put("name", cell.getItemStack().getDisplayName());
} else if (value instanceof IFluidCellInventoryHandler) {
convert(((IFluidCellInventoryHandler) value).getCellInv(), output);
} else if ((value instanceof ItemStack) && (((ItemStack) value).getItem() instanceof IStorageFluidCell)) {
IMEInventoryHandler<?> inventory = AEApi.instance()
.registries()
.cell()
.getCellInventory((ItemStack) value, null, StorageChannel.FLUIDS);
if (inventory instanceof IFluidCellInventoryHandler)
convert(((IFluidCellInventoryHandler) inventory).getCellInv(), output);
}
}
}
1 change: 1 addition & 0 deletions src/main/scala/li/cil/oc/integration/ae2fc/ModAe2fc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ object ModAe2fc extends ModProxy {
override def getMod: Mod = Mods.Ae2Fc
override def initialize(): Unit = {
Driver.add(ConverterFluidDrop)
Driver.add(new ConverterFluidCellInventory)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import cpw.mods.fml.common.registry.GameRegistry
import li.cil.oc.{Constants, api}
import li.cil.oc.api.Driver
import li.cil.oc.common.Tier
import li.cil.oc.common.init.Items.registerItem
import li.cil.oc.common.recipe.Recipes.addSubItem
import li.cil.oc.common.tileentity.Print
import li.cil.oc.integration.ModProxy
Expand Down

0 comments on commit eede104

Please sign in to comment.