aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/enums/HeatingCoilLevel.java
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2021-02-10 21:00:03 +0800
committerGlease <4586901+Glease@users.noreply.github.com>2021-02-10 21:22:25 +0800
commitc500ef1223c14e51431fca1bde48c3a2a34d5fcb (patch)
treea7e01ca5ddf0526d28957317a48d2e2622af7b45 /src/main/java/gregtech/api/enums/HeatingCoilLevel.java
parentffbec810bd1b0d66d820e80e3288507a1ea3f082 (diff)
downloadGT5-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/java/gregtech/api/enums/HeatingCoilLevel.java')
-rw-r--r--src/main/java/gregtech/api/enums/HeatingCoilLevel.java6
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){