From 867280556692363d6ec183ac9838ab3c7769cf1c Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 9 Jan 2023 17:50:36 +0100 Subject: Fix voltage variable in comb chance calculation in Mega Apiary + some tweaks (#43) * Always use full potential power * Fix voltage variable (t) in comb chance calculation * Fix already existing apiaries --- src/main/java/kubatech/api/helpers/GTHelper.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/kubatech/api') diff --git a/src/main/java/kubatech/api/helpers/GTHelper.java b/src/main/java/kubatech/api/helpers/GTHelper.java index bf2b28ff79..05d8bfb919 100644 --- a/src/main/java/kubatech/api/helpers/GTHelper.java +++ b/src/main/java/kubatech/api/helpers/GTHelper.java @@ -50,4 +50,20 @@ public class GTHelper { if (isValidMetaTileEntity(tHatch)) rEU += tHatch.maxEUInput() * tHatch.maxAmperesIn(); return rEU; } + + public static double getVoltageTierD(long voltage) { + return Math.log((double) voltage / 8L) / ln4; + } + + public static double getVoltageTierD(GT_MetaTileEntity_MultiBlockBase mte) { + return Math.log((double) getMaxInputEU(mte) / 8L) / ln4; + } + + public static int getVoltageTier(long voltage) { + return (int) getVoltageTierD(voltage); + } + + public static int getVoltageTier(GT_MetaTileEntity_MultiBlockBase mte) { + return (int) getVoltageTierD(mte); + } } -- cgit