mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-25 14:34:36 +00:00
Corporea retainers use richer signal strength depending on request size
This commit is contained in:
1 parent
3c6794e722
commit
81f33e8d74
5 files changed
+21
-8
No files matched your search
@@ -297,4 +297,12 @@ public final class CorporeaHelper {
|
||||
public static String stripControlCodes(String str) {
|
||||
return patternControlCode.matcher(str).replaceAll("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the comparator strength for a corporea request that corporea crystal cubes and retainers use, following the usual "each step up requires double the items" formula.
|
||||
*/
|
||||
private static final double LOG_2 = Math.log(2);
|
||||
public static int signalStrengthForRequestSize(int requestSize) {
|
||||
return requestSize == 0 ? 0 : Math.min(15, (int) Math.floor(Math.log(requestSize) / LOG_2) + 1);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user