add ME Fluid Quantum Storage Cell

add ME Fluid Digital Singularity Storage Cell
This commit is contained in:
asdflj committed 2023-02-11 21:57:05 +08:00
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);
@@ -52,6 +52,12 @@ public class ItemAndBlockHolder {
.register();
public static ItemBasicFluidStorageCell CELL16384K = new ItemBasicFluidStorageCell(CellType.Cell16384kPart, 16384)
.register();
public static ItemBasicFluidStorageCell CELL131072K = new ItemBasicFluidStorageCell(
CellType.Cell131072kPart,
131072).register();
public static ItemBasicFluidStorageCell CELL554160890921312K = new ItemBasicFluidStorageCell(
CellType.Cell554160890921312kPart,
554160890921312L).register();
public static ItemCreativeFluidStorageCell CREATIVE_CELL = new ItemCreativeFluidStorageCell().register();
public static ItemBasicFluidStoragePart CELL_PART = new ItemBasicFluidStoragePart().register();
@@ -1,5 +1,6 @@
package com.glodblock.github.loader;
import static com.glodblock.github.common.storage.CellType.Cell16384kPart;
import static com.glodblock.github.loader.ItemAndBlockHolder.*;
import static net.minecraft.init.Blocks.redstone_torch;
import static net.minecraft.init.Items.fish;
@@ -109,6 +110,12 @@ public class RecipeLoader implements Runnable {
.findItemStack("appliedenergistics2", "tile.BlockChest", 1);
public static final ItemStack AE2_ENERGY_CELL = GameRegistry
.findItemStack("appliedenergistics2", "tile.BlockEnergyCell", 1);
public static final ItemStack AE2_MATTER_CONDENSER = GameRegistry
.findItemStack("appliedenergistics2", "tile.BlockCondenser", 1);
public static final ItemStack AE2_QUANTUM_RING = GameRegistry
.findItemStack("appliedenergistics2", "tile.BlockQuantumRing", 1);
public static final ItemStack AE2_DENSE_ENERGY_CELL = GameRegistry
.findItemStack("appliedenergistics2", "tile.BlockDenseEnergyCell", 1);
public static final ItemStack THE_WIRELESS_TERM = GameRegistry
.findItemStack("thaumicenergistics", "wireless.essentia.terminal", 1);
private static final ItemStack WCT_WIRELESS_TERM = GameRegistry
@@ -392,7 +399,28 @@ public class RecipeLoader implements Runnable {
ItemBasicFluidStorageCell[] cells = new ItemBasicFluidStorageCell[] { CELL1K, CELL4K, CELL16K, CELL64K,
CELL256K, CELL1024K, CELL4096K, CELL16384K };
GameRegistry.addRecipe(
new ShapedOreRecipe(
CELL131072K.stack(),
"RCR",
"CEC",
"RCR",
'C',
Cell16384kPart.stack(1),
'E',
AE2_DENSE_ENERGY_CELL,
'R',
AE2_QUANTUM_RING));
GameRegistry.addRecipe(
new ShapedOreRecipe(
CELL554160890921312K.stack(),
"CCC",
"CMC",
"CCC",
'C',
CELL131072K,
'M',
AE2_MATTER_CONDENSER));
for (ItemBasicFluidStorageCell cell : cells) {
GameRegistry.addRecipe(
new ShapedOreRecipe(
@@ -30,6 +30,8 @@ item.fluid_storage.256.name=%s256k%s ME Fluid Storage Cell
item.fluid_storage.1024.name=%s1024k%s ME Fluid Storage Cell
item.fluid_storage.4096.name=%s4096k%s ME Fluid Storage Cell
item.fluid_storage.16384.name=%s16384k%s ME Fluid Storage Cell
item.fluid_storage.131072.name=%s131072k%s ME Fluid Quantum Storage Cell
item.fluid_storage.554160890921312.name=%s554P%s ME Fluid Digital Singularity Storage Cell
item.fluid_part.0.name=%s1k%s ME Fluid Storage Component
item.fluid_part.1.name=%s4k%s ME Fluid Storage Component
item.fluid_part.2.name=%s16k%s ME Fluid Storage Component
@@ -30,6 +30,8 @@ item.fluid_storage.256.name=%s256k%s-ME流体存储元件
item.fluid_storage.1024.name=%s1024k%s-ME流体存储元件
item.fluid_storage.4096.name=%s4096k%s-ME流体存储元件
item.fluid_storage.16384.name=%s16384k%s-ME流体存储元件
item.fluid_storage.131072.name=%s131072k%s ME流体量子存储元件
item.fluid_storage.554160890921312.name=%s554P%s MEl流体数字奇点元件
item.fluid_part.0.name=%s1k%s-ME流体存储组件
item.fluid_part.1.name=%s4k%s-ME流体存储组件
item.fluid_part.2.name=%s16k%s-ME流体存储组件
Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B