From 739b1b7676db0d7b302a82722c2c8e1d440e1194 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sat, 31 Mar 2018 13:51:35 -1000 Subject: Rewrite Power Sub-Station machine structure Machine now allows variable height with 2-16 layers of cells (configurable via CELL_HEIGHT_MIN/MAX constants). Machine now affords more cell types for its interior (as detected in `getCellTier()`). Three more tiers of cells are added. Machine now computes energy storage from the number and type of cells in its interior. Base energy storage drastically reduced. Energy storage is now computed using a base value for the lowest tier of cells along with a tier multiplier. If the machine fails to form, stored energy is conserved. When the machine successfully forms, any energy above the storage capacity is deleted. Machine fails to form if not all cells are identical, or if dynamo/energy hatches are above the cells' tier. TODO: Add more tiers of energy cells, add crafting recipes for all new energy cells, rename and retexture cells to match tier and/or recipe, maybe adjust energy storage values. --- .../common/blocks/GregtechMetaCasingBlocks3.java | 43 ++++++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 0204b08b2e..f13a0b786e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -11,13 +15,41 @@ import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler3; +import java.util.List; + public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract { CasingTextureHandler3 TextureHandler = new CasingTextureHandler3(); + public static class GregtechMetaCasingItemBlocks3 extends GregtechMetaCasingItems { + + public GregtechMetaCasingItemBlocks3(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int meta = aStack.getItemDamage(); + long capacity = 0; + switch (meta) { + case 4: + case 5: + case 6: + capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(meta); + break; + default: + break; + } + if (capacity > 0) { + aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity)); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + public GregtechMetaCasingBlocks3() { - super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.3", GT_Material_Casings.INSTANCE); + super(GregtechMetaCasingItemBlocks3.class, "gtplusplus.blockcasings.3", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); } @@ -25,9 +57,9 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel Reinforced Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Multi-Use Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Trinium Plated Mining Platform Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Placeholder"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Placeholder"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Placeholder"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Cell (Lapotron Fortified)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Cell (Naquadah Doped)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Cell (Neutronium Laced)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Placeholder");; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Placeholder"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Placeholder"); @@ -41,6 +73,9 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1)); GregtechItemList.Casing_Multi_Use.set(new ItemStack(this, 1, 2)); GregtechItemList.Casing_BedrockMiner.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_Vanadium_Redox_T2.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_Vanadium_Redox_T3.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_Vanadium_Redox_T4.set(new ItemStack(this, 1, 6)); //GregtechItemList.Casing_WashPlant.set(new ItemStack(this, 1, 4)); //GregtechItemList.Casing_Sifter.set(new ItemStack(this, 1, 5)); //GregtechItemList.Casing_SifterGrate.set(new ItemStack(this, 1, 6)); -- cgit From 2cf95a2b3e82ceb3a8eec69e33262cf36b797ae6 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Thu, 5 Apr 2018 22:26:38 -1000 Subject: Add energy cell tiers up to MAX voltage, make lowest cell EV tier Renamed cells to the voltage tiers Added textures for new cells, adjusted existing textures. Texture colors are vaguely similar to pump/robot arm colors Legacy power stations will have 1.8 billion EU storage --- .../xmod/gregtech/api/enums/GregtechItemList.java | 9 ++++-- .../common/blocks/GregtechMetaCasingBlocks2.java | 8 +++--- .../common/blocks/GregtechMetaCasingBlocks3.java | 32 +++++++++------------ .../blocks/textures/CasingTextureHandler3.java | 12 ++++---- .../common/blocks/textures/TexturesGtBlock.java | 4 +++ ...chMetaTileEntity_PowerSubStationController.java | 20 ++++++------- .../miscutils/textures/blocks/redox/redox1.png | Bin 717 -> 562 bytes .../miscutils/textures/blocks/redox/redox2.png | Bin 741 -> 721 bytes .../miscutils/textures/blocks/redox/redox3.png | Bin 693 -> 776 bytes .../miscutils/textures/blocks/redox/redox4.png | Bin 708 -> 781 bytes .../miscutils/textures/blocks/redox/redox5.png | Bin 0 -> 794 bytes .../miscutils/textures/blocks/redox/redox6.png | Bin 0 -> 779 bytes 12 files changed, 44 insertions(+), 41 deletions(-) create mode 100644 src/resources/assets/miscutils/textures/blocks/redox/redox5.png create mode 100644 src/resources/assets/miscutils/textures/blocks/redox/redox6.png (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index afbf68d8a6..2b9860ef1c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -167,9 +167,12 @@ public enum GregtechItemList implements GregtechItemContainer { //Power Substation Casing_Vanadium_Redox, - Casing_Vanadium_Redox_T2, - Casing_Vanadium_Redox_T3, - Casing_Vanadium_Redox_T4, + Casing_Vanadium_Redox_IV, + Casing_Vanadium_Redox_LuV, + Casing_Vanadium_Redox_ZPM, + Casing_Vanadium_Redox_UV, + Casing_Vanadium_Redox_MAX, + Casing_Power_SubStation, //Cyclotron diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index e80d9e2110..8dd52c7074 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -31,9 +31,9 @@ extends GregtechMetaCasingBlocksAbstract { @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { int meta = aStack.getItemDamage(); - long capacity = 0; - if (meta == 7) { - capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(3); + int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta); + if (tier > 0) { + long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier); aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity)); } super.addInformation(aStack, aPlayer, aList, aF3_H); @@ -52,7 +52,7 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Wash Plant Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Industrial Sieve Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Large Sieve Grate"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Sub-Station External Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Cyclotron Coil"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index f13a0b786e..7baa8ec36a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -31,17 +31,9 @@ extends GregtechMetaCasingBlocksAbstract { @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { int meta = aStack.getItemDamage(); - long capacity = 0; - switch (meta) { - case 4: - case 5: - case 6: - capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(meta); - break; - default: - break; - } - if (capacity > 0) { + int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta); + if (tier > 0) { + long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier); aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity)); } super.addInformation(aStack, aPlayer, aList, aF3_H); @@ -57,11 +49,11 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel Reinforced Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Multi-Use Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Trinium Plated Mining Platform Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Cell (Lapotron Fortified)"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Cell (Naquadah Doped)"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Cell (Neutronium Laced)"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Placeholder");; - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Placeholder"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)");; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Placeholder"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Placeholder"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Placeholder"); @@ -73,9 +65,11 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1)); GregtechItemList.Casing_Multi_Use.set(new ItemStack(this, 1, 2)); GregtechItemList.Casing_BedrockMiner.set(new ItemStack(this, 1, 3)); - GregtechItemList.Casing_Vanadium_Redox_T2.set(new ItemStack(this, 1, 4)); - GregtechItemList.Casing_Vanadium_Redox_T3.set(new ItemStack(this, 1, 5)); - GregtechItemList.Casing_Vanadium_Redox_T4.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_Vanadium_Redox_IV.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_Vanadium_Redox_LuV.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_Vanadium_Redox_ZPM.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_Vanadium_Redox_UV.set(new ItemStack(this, 1, 7)); + GregtechItemList.Casing_Vanadium_Redox_MAX.set(new ItemStack(this, 1, 8)); //GregtechItemList.Casing_WashPlant.set(new ItemStack(this, 1, 4)); //GregtechItemList.Casing_Sifter.set(new ItemStack(this, 1, 5)); //GregtechItemList.Casing_SifterGrate.set(new ItemStack(this, 1, 6)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java index d6844a1eed..e83ce098c8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java @@ -20,18 +20,20 @@ public class CasingTextureHandler3 { //Trinium Plated Mining Platform Casing return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon(); case 4: - //Vanadium Redox T2 + //Vanadium Redox IV return TexturesGtBlock.Casing_Redox_2.getIcon(); case 5: - //Vanadium Redox T3 + //Vanadium Redox LuV return TexturesGtBlock.Casing_Redox_3.getIcon(); case 6: - //Vanadium Redox T4 + //Vanadium Redox ZPM return TexturesGtBlock.Casing_Redox_4.getIcon(); case 7: - return TexturesGtBlock._PlaceHolder.getIcon(); + //Vanadium Redox UV + return TexturesGtBlock.Casing_Redox_5.getIcon(); case 8: - return TexturesGtBlock._PlaceHolder.getIcon(); + //Vanadium Redox MAX + return TexturesGtBlock.Casing_Redox_6.getIcon(); case 9: return TexturesGtBlock._PlaceHolder.getIcon(); case 10: diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 0f8c8d44c5..0c187480bb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -168,6 +168,10 @@ public class TexturesGtBlock { public static final CustomIcon Casing_Redox_2 = new CustomIcon("redox/redox2"); public static final CustomIcon Casing_Redox_3 = new CustomIcon("redox/redox3"); public static final CustomIcon Casing_Redox_4 = new CustomIcon("redox/redox4"); + public static final CustomIcon Casing_Redox_5 = new CustomIcon("redox/redox5"); + public static final CustomIcon Casing_Redox_6 = new CustomIcon("redox/redox6"); + public static final CustomIcon Casing_Redox_7 = new CustomIcon("redox/redox7"); + public static final CustomIcon Casing_Redox_8 = new CustomIcon("redox/redox8"); //Centrifuge Casing private static final CustomIcon Internal_Casing_Centrifuge = new CustomIcon("TileEntities/MACHINE_CASING_CENTRIFUGE"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 2aa30a0c30..4746dc2728 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -109,15 +109,15 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe Logger.INFO("Power Sub-Station problem: " + msg); } - private int getCellTier(Block aBlock, int aMeta) { + public static int getCellTier(Block aBlock, int aMeta) { if (aBlock == ModBlocks.blockCasings2Misc && aMeta == 7) { - return 3; - } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 4) { return 4; - } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 5) { + } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 4) { return 5; - } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 6) { + } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 5) { return 6; + } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 6) { + return 7; } else { return -1; } @@ -282,15 +282,15 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe return true; } - // Define storage capacity of smallest cell tier (HV) and compute higher tiers from it - private static final long CELL_TIER_HV_CAPACITY = 10 * 1000 * 1000; // one lapotron crystal + // Define storage capacity of smallest cell tier (EV) and compute higher tiers from it + private static final long CELL_TIER_EV_CAPACITY = 100 * 1000 * 1000; // one lapotronic orb private static final long CELL_TIER_MULTIPLIER = 4; // each tier's capacity is this many times the previous tier public static long getCapacityFromCellTier(int aOverallCellTier) { // Use integer math instead of `Math.pow` to avoid range/precision errors - if (aOverallCellTier < 3) return 0; - aOverallCellTier -= 3; - long capacity = CELL_TIER_HV_CAPACITY; + if (aOverallCellTier < 4) return 0; + aOverallCellTier -= 4; + long capacity = CELL_TIER_EV_CAPACITY; while (aOverallCellTier > 0) { capacity *= CELL_TIER_MULTIPLIER; aOverallCellTier--; diff --git a/src/resources/assets/miscutils/textures/blocks/redox/redox1.png b/src/resources/assets/miscutils/textures/blocks/redox/redox1.png index f3a48f72f8..05b752e0e7 100644 Binary files a/src/resources/assets/miscutils/textures/blocks/redox/redox1.png and b/src/resources/assets/miscutils/textures/blocks/redox/redox1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/redox/redox2.png b/src/resources/assets/miscutils/textures/blocks/redox/redox2.png index 0456dbe20b..231b6b17af 100644 Binary files a/src/resources/assets/miscutils/textures/blocks/redox/redox2.png and b/src/resources/assets/miscutils/textures/blocks/redox/redox2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/redox/redox3.png b/src/resources/assets/miscutils/textures/blocks/redox/redox3.png index ab2b3b27e9..88cb664c41 100644 Binary files a/src/resources/assets/miscutils/textures/blocks/redox/redox3.png and b/src/resources/assets/miscutils/textures/blocks/redox/redox3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/redox/redox4.png b/src/resources/assets/miscutils/textures/blocks/redox/redox4.png index b925ffc26b..a627b64eef 100644 Binary files a/src/resources/assets/miscutils/textures/blocks/redox/redox4.png and b/src/resources/assets/miscutils/textures/blocks/redox/redox4.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/redox/redox5.png b/src/resources/assets/miscutils/textures/blocks/redox/redox5.png new file mode 100644 index 0000000000..9564596329 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/redox/redox5.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/redox/redox6.png b/src/resources/assets/miscutils/textures/blocks/redox/redox6.png new file mode 100644 index 0000000000..1023b718cc Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/redox/redox6.png differ -- cgit