diff options
| author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-12-28 18:15:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-28 18:15:54 +0100 |
| commit | 748fe043379899876ee079d3d414f50b5dfad9b6 (patch) | |
| tree | 1c9b3af776c21a0278fcd3b455300d18f5c9d5ad /src/main/java/gregtech/api/enums/HeatingCoilLevel.java | |
| parent | 5da080296a9a04aaee27bc88036650c8c26820ce (diff) | |
| parent | 7fb679c5bec20dc8caa40b3a92b2a6590912f6f9 (diff) | |
| download | GT5-Unofficial-748fe043379899876ee079d3d414f50b5dfad9b6.tar.gz GT5-Unofficial-748fe043379899876ee079d3d414f50b5dfad9b6.tar.bz2 GT5-Unofficial-748fe043379899876ee079d3d414f50b5dfad9b6.zip | |
Merge pull request #380 from GTNewHorizons/CoilsLogicRework
Heating Coil Logic Overhaul
Diffstat (limited to 'src/main/java/gregtech/api/enums/HeatingCoilLevel.java')
| -rw-r--r-- | src/main/java/gregtech/api/enums/HeatingCoilLevel.java | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/enums/HeatingCoilLevel.java b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java new file mode 100644 index 0000000000..db94a3fe62 --- /dev/null +++ b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java @@ -0,0 +1,69 @@ +package gregtech.api.enums; + +import net.minecraft.util.EnumChatFormatting; + +public enum HeatingCoilLevel { + None, // 0 + ULV, //Not implemented 901 + LV, //Cupronickel 1801 + MV, //KANTHAL 2701 + HV, //NICHROME 3601 + EV, //TUNGSTENSTEEL 4501 + IV, //HSSG 5401 + LuV, //HSSS 6301 + ZPM, //NAQUADAH 7201 + UV, //NAQUADAHALLOY 8101 + UHV, //TRINIUM 9001 + UEV, //ELECTRUMFLUX 9901 + UIV, //AWAKENEDDRACONIUM 10801 + //Not Implemented yet + UMV, + UXV, + OpV, + MAX, + ; + + /** + * @return the Coils Tier Name + */ + public String getTierName() { + if (this.ordinal() < 1 || (this.ordinal()-1) >= GT_Values.VN.length) + return "ERROR!"; + return GT_Values.TIER_COLORS[this.ordinal() - 1] + GT_Values.VOLTAGE_NAMES[this.ordinal() - 1] + EnumChatFormatting.RESET; + } + + /** + * @return the coil heat, used for recipes in the Electronic Blast Furnace for example + */ + public long getHeat() { + return this == None ? 0 : 1L + (900L * this.ordinal()); + } + + /** + * @return the coil tier, used for discount in the Pyrolyse Ofen for example + */ + public byte getTier() { + return (byte) (this.ordinal() - 2); + } + + /** + * @return the coil Level, used for Parallels in the Multi Furnace for example + */ + public byte getLevel() { + return (byte) Math.max(16, 2 << (this.ordinal() - 2)); + } + + /** + * @return the coil Discount, used for discount in the Multi Furnace for example + */ + public byte getCostDiscount() { + return (byte) Math.min(1, 2 << (this.ordinal() - 1 - 6)); //-1 bcs. of none, -4 = offset + } + + public static HeatingCoilLevel getFromTier(byte tier){ + if (tier < 0 || tier > HeatingCoilLevel.values().length -1) + return HeatingCoilLevel.None; + + return HeatingCoilLevel.values()[tier+2]; + } +}
\ No newline at end of file |
