Skip to content

Commit

Permalink
Merge remote-tracking branch 'asdflj/cell' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Feb 11, 2023
2 parents 45e0dcb + 56a9dc1 commit c6b9ebb
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

dependencies {
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.21-GTNH:dev')
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-149-GTNH:dev')
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-156-GTNH:dev')
compile('curse.maven:cofh-core-69162:2388751')
compile('com.github.GTNewHorizons:waila:1.5.22:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.32:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.9.2:dev")

compileOnly('com.github.GTNewHorizons:ForestryMC:4.5.6:dev')
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -104,6 +105,14 @@ public ItemBasicFluidStorageCell(final CellType whichCell, final int kilobytes)
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;
Expand All @@ -126,15 +135,15 @@ public String getItemStackDisplayName(ItemStack stack) {
@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));
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
int id = this.totalBytes / 1024;
int id = (int) (this.totalBytes / 1024);
return icon.get(id);
}

Expand All @@ -156,7 +165,7 @@ public void addCheckedInformation(final ItemStack stack, final EntityPlayer play
+ GuiText.Of.getLocal()
+ " "
+ EnumChatFormatting.DARK_GREEN
+ cellInventory.getTotalBytes()
+ NumberFormat.getInstance().format(cellInventory.getTotalBytes())
+ " "
+ EnumChatFormatting.GRAY
+ GuiText.BytesUsed.getLocal());
Expand Down Expand Up @@ -210,7 +219,7 @@ public void addCheckedInformation(final ItemStack stack, final EntityPlayer play
}

@Override
public int getBytes(final ItemStack cellItem) {
public long getBytes(final ItemStack cellItem) {
return this.totalBytes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ItemCreativeFluidStorageCell() {
}

@Override
public int getBytes(ItemStack cellItem) {
public long getBytes(ItemStack cellItem) {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void addCheckedInformation(final ItemStack stack, final EntityPlayer play
}

@Override
public int getBytes(final ItemStack cellItem) {
public long getBytes(final ItemStack cellItem) {
return 256;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -74,6 +76,10 @@ public static EnumChatFormatting getTypeColor(CellType type) {
return EnumChatFormatting.RED;
case Cell16384kPart:
return EnumChatFormatting.DARK_PURPLE;
case Cell131072kPart:
return EnumChatFormatting.DARK_GRAY;
case Cell554160890921312kPart:
return EnumChatFormatting.DARK_RED;
}
return EnumChatFormatting.WHITE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public interface IStorageFluidCell extends ICellWorkbenchItem {

int getBytes(ItemStack cellItem);
long getBytes(ItemStack cellItem);

int getBytesPerType(ItemStack cellItem);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
30 changes: 29 additions & 1 deletion src/main/java/com/glodblock/github/loader/RecipeLoader.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -392,7 +399,28 @@ public void run() {

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(
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ae2fc/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ae2fc/lang/zh_CN.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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流体存储组件
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c6b9ebb

Please sign in to comment.