diff options
author | David Vierra <codewarrior@hawaii.rr.com> | 2018-03-31 13:51:35 -1000 |
---|---|---|
committer | David Vierra <codewarrior@hawaii.rr.com> | 2018-04-05 19:41:54 -1000 |
commit | 739b1b7676db0d7b302a82722c2c8e1d440e1194 (patch) | |
tree | 34bca5d670f32a8f8413551adf2f1a9950796511 /src/Java/gtPlusPlus/xmod/gregtech/common/blocks | |
parent | 65340f1b047edc2563e31f8bccc0244321bfc889 (diff) | |
download | GT5-Unofficial-739b1b7676db0d7b302a82722c2c8e1d440e1194.tar.gz GT5-Unofficial-739b1b7676db0d7b302a82722c2c8e1d440e1194.tar.bz2 GT5-Unofficial-739b1b7676db0d7b302a82722c2c8e1d440e1194.zip |
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.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/blocks')
5 files changed, 84 insertions, 26 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index 2f64b943b7..e80d9e2110 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.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,33 @@ import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler2; +import java.util.List; + public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract { CasingTextureHandler2 TextureHandler = new CasingTextureHandler2(); + public static class GregtechMetaCasingItemBlocks2 extends GregtechMetaCasingItems { + + public GregtechMetaCasingItemBlocks2(Block par1) { + super(par1); + } + + @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); + aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity)); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + public GregtechMetaCasingBlocks2() { - super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.2", GT_Material_Casings.INSTANCE); + super(GregtechMetaCasingItemBlocks2.class, "gtplusplus.blockcasings.2", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); } 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)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java index 96f13dbd5f..8f107b8ab6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java @@ -33,7 +33,7 @@ public class CasingTextureHandler2 { //Vanadium Radox Battery case 7: - return TexturesGtBlock.Overlay_Machine_Cyber_B.getIcon(); + return TexturesGtBlock.Casing_Redox_1.getIcon(); //Power Sub-Station Casing case 8: return TexturesGtBlock.Casing_Machine_Metal_Sheet_A.getIcon(); 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 51fb289b61..d6844a1eed 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java @@ -7,46 +7,39 @@ public class CasingTextureHandler3 { public static IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { - //Centrifuge - case 0: - return TexturesGtBlock.TEXTURE_METAL_PANEL_B.getIcon(); - //Coke Oven Frame + case 0: + //Aquatic Casing + return TexturesGtBlock.TEXTURE_METAL_PANEL_B.getIcon(); case 1: + //Inconel Reinforced Casing return TexturesGtBlock.TEXTURE_METAL_PANEL_D.getIcon(); - //Coke Oven Casing Tier 1 case 2: + //Multi-Use Casing return TexturesGtBlock.TEXTURE_METAL_PANEL_C.getIcon(); - //Coke Oven Casing Tier 2 case 3: + //Trinium Plated Mining Platform Casing return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon(); - //Material Press Casings case 4: - return TexturesGtBlock._PlaceHolder.getIcon(); - //Sifter Structural + //Vanadium Redox T2 + return TexturesGtBlock.Casing_Redox_2.getIcon(); case 5: - return TexturesGtBlock._PlaceHolder.getIcon(); - //Sifter Sieve + //Vanadium Redox T3 + return TexturesGtBlock.Casing_Redox_3.getIcon(); case 6: - return TexturesGtBlock._PlaceHolder.getIcon(); - //Vanadium Radox Battery + //Vanadium Redox T4 + return TexturesGtBlock.Casing_Redox_4.getIcon(); case 7: return TexturesGtBlock._PlaceHolder.getIcon(); - //Power Sub-Station Casing case 8: return TexturesGtBlock._PlaceHolder.getIcon(); - //Cyclotron Coil case 9: return TexturesGtBlock._PlaceHolder.getIcon(); - //Cyclotron External Casing case 10: return TexturesGtBlock._PlaceHolder.getIcon(); - //Multitank Exterior Casing case 11: return TexturesGtBlock._PlaceHolder.getIcon(); - //Reactor Casing I case 12: return TexturesGtBlock._PlaceHolder.getIcon(); - //Reactor Casing II case 13: if (aSide <2) { return TexturesGtBlock._PlaceHolder.getIcon(); @@ -57,7 +50,7 @@ public class CasingTextureHandler3 { case 14: return TexturesGtBlock._PlaceHolder.getIcon(); case 15: - return TexturesGtBlock._PlaceHolder.getIcon(); //Tree Farmer Textures + return TexturesGtBlock._PlaceHolder.getIcon(); default: return TexturesGtBlock._PlaceHolder.getIcon(); 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 a93cff61b2..0f8c8d44c5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -163,6 +163,12 @@ public class TexturesGtBlock { private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon("TileEntities/cover_redstone_emitter"); public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On; + //Redox Cells + public static final CustomIcon Casing_Redox_1 = new CustomIcon("redox/redox1"); + 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"); + //Centrifuge Casing private static final CustomIcon Internal_Casing_Centrifuge = new CustomIcon("TileEntities/MACHINE_CASING_CENTRIFUGE"); public static final CustomIcon Casing_Material_Centrifuge = Internal_Casing_Centrifuge; |