mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-12 08:17:32 +00:00
Merge pull request #44 from GTNewHorizons/fixs
add contents display on cells and fix pattern terminal encode overflow
This commit is contained in:
8 files changed
+36
-1
No files matched your search
@@ -387,6 +387,7 @@ public class FCBasePartContainer extends FCBaseMonitorContain
|
||||
|
||||
if (i != null) {
|
||||
i.writeToNBT(c);
|
||||
c.setInteger("Count", i.stackSize);
|
||||
}
|
||||
|
||||
return c;
|
||||
|
||||
@@ -357,6 +357,7 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain
|
||||
|
||||
if (i != null) {
|
||||
i.writeToNBT(c);
|
||||
c.setInteger("Count", i.stackSize);
|
||||
}
|
||||
|
||||
return c;
|
||||
|
||||
@@ -17,6 +17,7 @@ import appeng.items.contents.CellConfig;
|
||||
import appeng.items.contents.CellUpgrades;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
@@ -50,8 +51,10 @@ public class ItemBasicFluidStorageCell extends AEBaseItem implements IStorageFlu
|
||||
private final int totalBytes;
|
||||
private final int perType;
|
||||
private final double idleDrain;
|
||||
private final ReadableNumberConverter format = ReadableNumberConverter.INSTANCE;
|
||||
private static final HashMap<Integer, IIcon> icon = new HashMap<>();
|
||||
|
||||
@SuppressWarnings("Guava")
|
||||
public ItemBasicFluidStorageCell(final CellType whichCell, final int kilobytes) {
|
||||
super(Optional.of(kilobytes + "k"));
|
||||
setUnlocalizedName(NameConst.ITEM_FLUID_STORAGE + kilobytes);
|
||||
@@ -137,6 +140,20 @@ public class ItemBasicFluidStorageCell extends AEBaseItem implements IStorageFlu
|
||||
lines.add(cellInventory.getStoredFluidTypes() + " " + GuiText.Of.getLocal() + ' '
|
||||
+ cellInventory.getTotalFluidTypes() + ' ' + GuiText.Types.getLocal());
|
||||
|
||||
if (GuiScreen.isCtrlKeyDown()) {
|
||||
if (cellInventory.getStoredFluidTypes() > 0) {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CELL_CONTENTS));
|
||||
for (IAEFluidStack fluid : cellInventory.getContents()) {
|
||||
if (fluid != null) {
|
||||
lines.add(String.format(
|
||||
" %s x%smB",
|
||||
fluid.getFluidStack().getLocalizedName(),
|
||||
format.toWideReadableForm(fluid.getStackSize())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (handler.isPreformatted()) {
|
||||
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST
|
||||
? GuiText.Included
|
||||
|
||||
@@ -11,6 +11,8 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -409,10 +411,18 @@ public class FluidCellInventory implements IFluidCellInventory {
|
||||
for (final IAEFluidStack i : this.getCellItems()) {
|
||||
out.add(i);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IAEFluidStack> getContents() {
|
||||
List<IAEFluidStack> ret = new ArrayList<>();
|
||||
for (IAEFluidStack fluid : this.getCellItems()) {
|
||||
ret.add(fluid);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel() {
|
||||
return StorageChannel.FLUIDS;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.glodblock.github.common.storage;
|
||||
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import java.util.List;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -70,4 +71,6 @@ public interface IFluidCellInventory extends IMEInventory<IAEFluidStack> {
|
||||
long getStoredFluidTypes();
|
||||
|
||||
long getTotalFluidTypes();
|
||||
|
||||
List<IAEFluidStack> getContents();
|
||||
}
|
||||
@@ -34,6 +34,7 @@ public class NameConst {
|
||||
public static final String TT_DUMP_TANK = TT_KEY + "dump_tank";
|
||||
public static final String TT_REQUEST_SIZE = TT_KEY + "request_size";
|
||||
public static final String TT_BATCH_SIZE = TT_KEY + "batch_size";
|
||||
public static final String TT_CELL_CONTENTS = TT_KEY + "cell_contents";
|
||||
|
||||
public static final String WAILA_KEY = FluidCraft.MODID + ".waila.";
|
||||
public static final String WAILA_ENABLE = WAILA_KEY + "enable";
|
||||
|
||||
@@ -37,6 +37,7 @@ ae2fc.waila.disable=Disable
|
||||
|
||||
ae2fc.tooltip.request_size=Amount to Maintain
|
||||
ae2fc.tooltip.batch_size=Crafting Batch Size
|
||||
ae2fc.tooltip.cell_contents=Contains Fluid:
|
||||
ae2fc.tooltip.fluid_terminal=uh So we don't need EC2 anymore?
|
||||
ae2fc.tooltip.invalid_fluid=Invalid fluid!
|
||||
ae2fc.tooltip.encode_pattern=Encode Patter
|
||||
|
||||
@@ -37,6 +37,7 @@ ae2fc.waila.disable=禁用
|
||||
|
||||
ae2fc.tooltip.request_size=缓存量
|
||||
ae2fc.tooltip.batch_size=批量制作数量
|
||||
ae2fc.tooltip.cell_contents=内含流体:
|
||||
ae2fc.tooltip.fluid_terminal=我们不再需要EC2了吗?
|
||||
ae2fc.tooltip.invalid_fluid=流体无效!
|
||||
ae2fc.tooltip.encode_pattern=编写样板
|
||||
|
||||
Reference in new issue
Block a user