From 3077326c16259fdf2dfab4ee84a03b7d5cf7acc3 Mon Sep 17 00:00:00 2001 From: MCTBL <30978504+MCTBL@users.noreply.github.com> Date: Tue, 21 Nov 2023 02:25:54 +0800 Subject: [PATCH] Implement the new interface in AE2 for network bytes informations. (#173) * implement the interface * sa * Implements the new interface --------- Co-authored-by: Martin Robertz --- dependencies.gradle | 12 ++--- .../storage/FluidCellInventoryHandler.java | 54 ++++++++++++++++++- 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 698ce42b4..4a5039df5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -35,25 +35,25 @@ */ dependencies { api('com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev') - api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-281-GTNH:dev') + api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-286-GTNH:dev') api('curse.maven:cofh-core-69162:2388751') - api('com.github.GTNewHorizons:waila:1.6.2:dev') + api('com.github.GTNewHorizons:waila:1.6.5:dev') implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.10.1:dev") compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev') compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:ForestryMC:4.7.0:dev') - compileOnly('com.github.GTNewHorizons:EnderIO:2.5.4:dev') - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.79:dev') { + compileOnly('com.github.GTNewHorizons:EnderIO:2.5.5:dev') + compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.83:dev') { exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework' } compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.5.0-GTNH:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:GTplusplus:1.10.27:dev') { transitive = false } - compileOnly("com.github.GTNewHorizons:Hodgepodge:2.3.29:dev") { transitive = false } + compileOnly('com.github.GTNewHorizons:GTplusplus:1.10.30:dev') { transitive = false } + compileOnly("com.github.GTNewHorizons:Hodgepodge:2.3.31:dev") { transitive = false } runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.1.7:dev") } diff --git a/src/main/java/com/glodblock/github/common/storage/FluidCellInventoryHandler.java b/src/main/java/com/glodblock/github/common/storage/FluidCellInventoryHandler.java index 8ce169149..fd8b903ae 100644 --- a/src/main/java/com/glodblock/github/common/storage/FluidCellInventoryHandler.java +++ b/src/main/java/com/glodblock/github/common/storage/FluidCellInventoryHandler.java @@ -8,6 +8,7 @@ import appeng.api.AEApi; import appeng.api.config.IncludeExclude; +import appeng.api.storage.ICellCacheRegistry; import appeng.api.storage.IMEInventory; import appeng.api.storage.StorageChannel; import appeng.api.storage.data.IAEFluidStack; @@ -17,7 +18,8 @@ import appeng.util.item.AEFluidStack; import appeng.util.prioitylist.PrecisePriorityList; -public class FluidCellInventoryHandler extends MEInventoryHandler implements IFluidCellInventoryHandler { +public class FluidCellInventoryHandler extends MEInventoryHandler + implements IFluidCellInventoryHandler, ICellCacheRegistry { protected FluidCellInventoryHandler(final IMEInventory c) { super(c, StorageChannel.FLUIDS); @@ -74,4 +76,54 @@ public int getStatusForCell() { return val; } + + @Override + public boolean canGetInv() { + IFluidCellInventory cellInv = this.getCellInv(); + if (cellInv instanceof CreativeFluidCellInventory) { + return false; + } else { + return true; + } + } + + @Override + public long getTotalBytes() { + return this.getCellInv().getTotalBytes(); + } + + @Override + public long getFreeBytes() { + return this.getCellInv().getFreeBytes(); + } + + @Override + public long getUsedBytes() { + return this.getCellInv().getUsedBytes(); + } + + @Override + public long getTotalTypes() { + return this.getCellInv().getTotalFluidTypes(); + } + + @Override + public long getFreeTypes() { + return this.getCellInv().getRemainingFluidTypes(); + } + + @Override + public long getUsedTypes() { + return this.getCellInv().getStoredFluidTypes(); + } + + @Override + public int getCellStatus() { + return this.getStatusForCell(); + } + + @Override + public TYPE getCellType() { + return TYPE.FLUID; + } }