mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 17:44:46 +00:00
add ME Fluid Quantum Storage Cell
add ME Fluid Digital Singularity Storage Cell
This commit is contained in:
1 parent
e92cffd2b2
commit
eb293ceb63
11 files changed
+64
-11
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -56,14 +57,14 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
implements IStorageFluidCell, IRegister<ItemBasicFluidStorageCell> {
|
||||
|
||||
private final CellType component;
|
||||
private final int totalBytes;
|
||||
private final long 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) {
|
||||
public ItemBasicFluidStorageCell(final CellType whichCell, final long kilobytes) {
|
||||
super(Optional.of(kilobytes + "k"));
|
||||
setUnlocalizedName(NameConst.ITEM_FLUID_STORAGE + kilobytes);
|
||||
this.setFeature(EnumSet.of(AEFeature.StorageCells));
|
||||
@@ -104,6 +105,14 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
this.idleDrain = 4.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell131072kPart:
|
||||
this.idleDrain = 4.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell554160890921312kPart:
|
||||
this.idleDrain = 5.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
default:
|
||||
this.idleDrain = 0.0;
|
||||
this.perType = 8;
|
||||
@@ -126,7 +135,7 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icon.put(
|
||||
this.totalBytes / 1024,
|
||||
(int) (this.totalBytes / 1024),
|
||||
iconRegister
|
||||
.registerIcon(NameConst.RES_KEY + NameConst.ITEM_FLUID_STORAGE + "." + this.totalBytes / 1024));
|
||||
}
|
||||
@@ -134,7 +143,7 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
int id = this.totalBytes / 1024;
|
||||
int id = (int) (this.totalBytes / 1024);
|
||||
return icon.get(id);
|
||||
}
|
||||
|
||||
@@ -156,7 +165,7 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalBytes()
|
||||
+ NumberFormat.getInstance().format(cellInventory.getTotalBytes())
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.BytesUsed.getLocal());
|
||||
@@ -210,7 +219,7 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(final ItemStack cellItem) {
|
||||
public long getBytes(final ItemStack cellItem) {
|
||||
return this.totalBytes;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ItemCreativeFluidStorageCell extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(ItemStack cellItem) {
|
||||
public long getBytes(ItemStack cellItem) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ItemPortableFluidCell extends AEBasePoweredItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(final ItemStack cellItem) {
|
||||
public long getBytes(final ItemStack cellItem) {
|
||||
return 256;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,9 @@ public enum CellType {
|
||||
Cell256kPart(4, AEFeature.StorageCells),
|
||||
Cell1024kPart(5, AEFeature.StorageCells),
|
||||
Cell4096kPart(6, AEFeature.StorageCells),
|
||||
Cell16384kPart(7, AEFeature.StorageCells);
|
||||
Cell16384kPart(7, AEFeature.StorageCells),
|
||||
Cell131072kPart(8, AEFeature.StorageCells),
|
||||
Cell554160890921312kPart(9, AEFeature.StorageCells);
|
||||
|
||||
private final EnumSet<AEFeature> features;
|
||||
private int damageValue;
|
||||
@@ -74,6 +76,10 @@ public enum CellType {
|
||||
return EnumChatFormatting.RED;
|
||||
case Cell16384kPart:
|
||||
return EnumChatFormatting.DARK_PURPLE;
|
||||
case Cell131072kPart:
|
||||
return EnumChatFormatting.DARK_GRAY;
|
||||
case Cell554160890921312kPart:
|
||||
return EnumChatFormatting.DARK_RED;
|
||||
}
|
||||
return EnumChatFormatting.WHITE;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
|
||||
public interface IStorageFluidCell extends ICellWorkbenchItem {
|
||||
|
||||
int getBytes(ItemStack cellItem);
|
||||
long getBytes(ItemStack cellItem);
|
||||
|
||||
int getBytesPerType(ItemStack cellItem);
|
||||
|
||||
|
||||
Reference in new issue
Block a user