From c500ef1223c14e51431fca1bde48c3a2a34d5fcb Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 10 Feb 2021 21:00:03 +0800 Subject: Fix bit fiddling Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/api/enums/HeatingCoilLevel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/api/enums/HeatingCoilLevel.java') 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){ -- cgit