diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2021-02-10 21:00:03 +0800 |
---|---|---|
committer | Glease <4586901+Glease@users.noreply.github.com> | 2021-02-10 21:22:25 +0800 |
commit | c500ef1223c14e51431fca1bde48c3a2a34d5fcb (patch) | |
tree | a7e01ca5ddf0526d28957317a48d2e2622af7b45 /src/main | |
parent | ffbec810bd1b0d66d820e80e3288507a1ea3f082 (diff) | |
download | GT5-Unofficial-c500ef1223c14e51431fca1bde48c3a2a34d5fcb.tar.gz GT5-Unofficial-c500ef1223c14e51431fca1bde48c3a2a34d5fcb.tar.bz2 GT5-Unofficial-c500ef1223c14e51431fca1bde48c3a2a34d5fcb.zip |
Fix bit fiddling
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/gregtech/api/enums/HeatingCoilLevel.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/enums/HeatingCoilLevel.java b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java index f4b28ede2b..2388a92cd3 100644 --- a/src/main/java/gregtech/api/enums/HeatingCoilLevel.java +++ b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java @@ -50,14 +50,14 @@ public enum HeatingCoilLevel { * @return the coil Level, used for Parallels in the Multi Furnace for example */ public byte getLevel() { - return (byte) Math.min(16, 2 << (this.ordinal() - 2)); + return (byte) (1 << Math.min(Math.max(0, this.ordinal() - 2), 4)); } /** * @return the coil Discount, used for discount in the Multi Furnace for example */ - public byte getCostDiscount() { - return (byte) Math.max(1, 2 << (this.ordinal() - 1 - 6)); //-1 bcs. of none, -4 = offset + public int getCostDiscount() { + return 1 << Math.max(0, this.ordinal() - 5); } public static HeatingCoilLevel getFromTier(byte tier){ |