diff --git a/dependencies.gradle b/dependencies.gradle index e2e772fad2d..430305be42c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,6 +3,7 @@ dependencies { implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev') implementation('curse.maven:cofh-core-69162:2388751') + compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:dev') {transitive = false} compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.4.0:dev') {transitive = false} compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.79:dev') {transitive = false} @@ -32,4 +33,7 @@ dependencies { } runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.1.7:dev") + runtimeOnlyNonPublishable('com.github.GTNewHorizons:Baubles:1.0.1.16:dev') + runtimeOnlyNonPublishable('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:ThaumicEnergistics:1.5.0-GTNH:dev') { transitive = false } } diff --git a/src/main/java/appeng/api/storage/ICellCacheRegistry.java b/src/main/java/appeng/api/storage/ICellCacheRegistry.java index b6a87cb6feb..23d83d09453 100644 --- a/src/main/java/appeng/api/storage/ICellCacheRegistry.java +++ b/src/main/java/appeng/api/storage/ICellCacheRegistry.java @@ -22,6 +22,12 @@ public interface ICellCacheRegistry { int getCellStatus(); - StorageChannel getCellType(); + TYPE getCellType(); + + enum TYPE { + ITEM, + FLUID, + ESSENTIA + } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java index 3547f0690e7..0d8d1e2e87d 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java @@ -432,6 +432,7 @@ private void drawItemInfo() { 13, 26, GuiColors.DefaultBlack.getColor()); + // Item byte status tempDouble = ns.getItemBytesUsed() * 100d / ns.getItemBytesTotal(); tempStr = ns.getItemBytesTotal() == 0 ? "(0%)" : " (" + df.format(tempDouble) + "%)"; @@ -489,6 +490,7 @@ private void drawFluidInfo() { 13, 26, GuiColors.DefaultBlack.getColor()); + // Fluid byte status tempDouble = ns.getFluidBytesUsed() * 100d / ns.getFluidBytesTotal(); tempStr = ns.getFluidBytesTotal() == 0 ? "(0%)" : " (" + df.format(tempDouble) + "%)"; @@ -546,6 +548,7 @@ private void drawEssentiaInfo() { 13, 26, GuiColors.DefaultBlack.getColor()); + // Essentia byte status tempDouble = ns.getEssentiaBytesUsed() * 100d / ns.getEssentiaBytesTotal(); tempStr = ns.getEssentiaBytesTotal() == 0 ? "(0%)" : " (" + df.format(tempDouble) + "%)"; diff --git a/src/main/java/appeng/me/cache/GridStorageCache.java b/src/main/java/appeng/me/cache/GridStorageCache.java index 33c68310d66..9c48b5eacd8 100644 --- a/src/main/java/appeng/me/cache/GridStorageCache.java +++ b/src/main/java/appeng/me/cache/GridStorageCache.java @@ -46,12 +46,10 @@ import appeng.api.storage.data.IItemList; import appeng.core.AEConfig; import appeng.me.helpers.GenericInterestManager; -import appeng.me.storage.CellInventoryHandler; import appeng.me.storage.DriveWatcher; import appeng.me.storage.ItemWatcher; import appeng.me.storage.MEInventoryHandler; import appeng.me.storage.NetworkInventoryHandler; -import appeng.me.storage.VoidCellInventory; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.storage.TileChest; import appeng.tile.storage.TileDrive; @@ -94,6 +92,9 @@ public class GridStorageCache implements IStorageGrid { private long essentiaCellCount; private int ticksCount; private int networkBytesUpdateFrequency; + private static final int CELL_RED = 3; + private static final int CELL_ORANGE = 2; + private static final int CELL_GREEN = 1; public GridStorageCache(final IGrid g) { this.myGrid = g; @@ -383,7 +384,7 @@ private void updateBytesInfo() { try { for (ICellProvider icp : this.activeCellProviders) { if (icp instanceof TileDrive) { - // All Item Cell + // Item cells for (IMEInventoryHandler meih : icp.getCellArray(StorageChannel.ITEMS)) { // exclude void cell if (((DriveWatcher) meih).getInternal() instanceof ICellCacheRegistry iccr) { @@ -392,18 +393,47 @@ private void updateBytesInfo() { itemBytesTotal += iccr.getTotalBytes(); itemBytesUsed += iccr.getUsedBytes(); switch (iccr.getCellStatus()) { - case 1 -> itemCellG++; - case 2 -> itemCellO++; - case 3 -> itemCellR++; + case CELL_GREEN -> itemCellG++; + case CELL_ORANGE -> itemCellO++; + case CELL_RED -> itemCellR++; } itemTypesTotal += iccr.getTotalTypes(); itemTypesUsed += iccr.getUsedTypes(); + itemCellCount++; } } - itemCellCount++; } - // TODO + // Essentia and Fluid cells for (IMEInventoryHandler meih : icp.getCellArray(StorageChannel.FLUIDS)) { + // exclude void cell + if (((DriveWatcher) meih).getInternal() instanceof ICellCacheRegistry iccr) { + // exclude creative cell + if (iccr.canGetInv()) { + if (iccr.getCellType() == ICellCacheRegistry.TYPE.FLUID) { + fluidBytesTotal += iccr.getTotalBytes(); + fluidBytesUsed += iccr.getUsedBytes(); + switch (iccr.getCellStatus()) { + case CELL_GREEN -> fluidCellG++; + case CELL_ORANGE -> fluidCellO++; + case CELL_RED -> fluidCellR++; + } + fluidTypesTotal += iccr.getTotalTypes(); + fluidTypesUsed += iccr.getUsedTypes(); + fluidCellCount++; + } else if (iccr.getCellType() == ICellCacheRegistry.TYPE.ESSENTIA) { + essentiaBytesTotal += iccr.getTotalBytes(); + essentiaBytesUsed += iccr.getUsedBytes(); + switch (iccr.getCellStatus()) { + case CELL_GREEN -> essentiaCellG++; + case CELL_ORANGE -> essentiaCellO++; + case CELL_RED -> essentiaCellR++; + } + essentiaTypesTotal += iccr.getTotalTypes(); + essentiaTypesUsed += iccr.getUsedTypes(); + essentiaCellCount++; + } + } + } } } else if (icp instanceof TileChest tc) { @@ -412,26 +442,52 @@ private void updateBytesInfo() { MEInventoryHandler meih = (MEInventoryHandler) AEApi.instance() .registries().cell().getCellInventory(cell, tc, StorageChannel.ITEMS); // exclude void cell - if (meih instanceof VoidCellInventory) { - continue; - } else if (meih instanceof CellInventoryHandler handler) { + if (meih instanceof ICellCacheRegistry iccr) { // exclude creative cell - if (handler.getCellInv() != null) { - itemBytesTotal += handler.getTotalBytes(); - itemBytesUsed += handler.getUsedBytes(); - switch (handler.getStatusForCell()) { - case 1 -> itemCellG++; - case 2 -> itemCellO++; - case 3 -> itemCellR++; + if (iccr.canGetInv()) { + itemBytesTotal += iccr.getTotalBytes(); + itemBytesUsed += iccr.getUsedBytes(); + switch (iccr.getCellStatus()) { + case CELL_GREEN -> itemCellG++; + case CELL_ORANGE -> itemCellO++; + case CELL_RED -> itemCellR++; } - itemTypesTotal += handler.getTotalTypes(); - itemTypesUsed += handler.getUsedTypes(); + itemTypesTotal += iccr.getTotalTypes(); + itemTypesUsed += iccr.getUsedTypes(); + itemCellCount++; } - itemCellCount++; } else { - // TODO meih = (MEInventoryHandler) AEApi.instance().registries().cell() .getCellInventory(cell, tc, StorageChannel.FLUIDS); + // exclude void cell + if (meih instanceof ICellCacheRegistry iccr) { + // exclude creative cell + if (iccr.canGetInv()) { + if (iccr.getCellType() == ICellCacheRegistry.TYPE.FLUID) { + fluidBytesTotal += iccr.getTotalBytes(); + fluidBytesUsed += iccr.getUsedBytes(); + switch (iccr.getCellStatus()) { + case CELL_GREEN -> fluidCellG++; + case CELL_ORANGE -> fluidCellO++; + case CELL_RED -> fluidCellR++; + } + fluidTypesTotal += iccr.getTotalTypes(); + fluidTypesUsed += iccr.getUsedTypes(); + fluidCellCount++; + } else if (iccr.getCellType() == ICellCacheRegistry.TYPE.ESSENTIA) { + essentiaBytesTotal += iccr.getTotalBytes(); + essentiaBytesUsed += iccr.getUsedBytes(); + switch (iccr.getCellStatus()) { + case CELL_GREEN -> essentiaCellG++; + case CELL_ORANGE -> essentiaCellO++; + case CELL_RED -> essentiaCellR++; + } + essentiaTypesTotal += iccr.getTotalTypes(); + essentiaTypesUsed += iccr.getUsedTypes(); + essentiaCellCount++; + } + } + } } } } diff --git a/src/main/java/appeng/me/storage/CellInventoryHandler.java b/src/main/java/appeng/me/storage/CellInventoryHandler.java index d6b2146bfd2..9f03c7d3fac 100644 --- a/src/main/java/appeng/me/storage/CellInventoryHandler.java +++ b/src/main/java/appeng/me/storage/CellInventoryHandler.java @@ -166,7 +166,7 @@ public int getCellStatus() { } @Override - public StorageChannel getCellType() { - return StorageChannel.ITEMS; + public TYPE getCellType() { + return TYPE.ITEM; } } diff --git a/src/main/resources/assets/appliedenergistics2/lang/zh_CN.lang b/src/main/resources/assets/appliedenergistics2/lang/zh_CN.lang index 608fdf84178..de4aaf9c609 100644 --- a/src/main/resources/assets/appliedenergistics2/lang/zh_CN.lang +++ b/src/main/resources/assets/appliedenergistics2/lang/zh_CN.lang @@ -229,6 +229,7 @@ gui.appliedenergistics2.CraftingStatus=合成状态 gui.appliedenergistics2.RemainingOperations=空闲处理器 gui.appliedenergistics2.FromStorage=可用数量 gui.appliedenergistics2.ToCraft=合成数量 +gui.appliedenergistics2.ToCraftRequests=合成次数 gui.appliedenergistics2.CraftingPlan=合成计划 gui.appliedenergistics2.Automatic=自动分配 gui.appliedenergistics2.Start=开始 diff --git a/src/main/resources/assets/appliedenergistics2/lang/zh_TW.lang b/src/main/resources/assets/appliedenergistics2/lang/zh_TW.lang index 178106d9262..e200397124b 100644 --- a/src/main/resources/assets/appliedenergistics2/lang/zh_TW.lang +++ b/src/main/resources/assets/appliedenergistics2/lang/zh_TW.lang @@ -176,6 +176,7 @@ gui.appliedenergistics2.Scheduled=計劃合成 gui.appliedenergistics2.CraftingStatus=合成狀態 gui.appliedenergistics2.FromStorage=可用數量 gui.appliedenergistics2.ToCraft=合成數量 +gui.appliedenergistics2.ToCraftRequests=合成次數 gui.appliedenergistics2.CraftingPlan=合成計劃 gui.appliedenergistics2.Automatic=自動分配 gui.appliedenergistics2.Start=開始