diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-18 18:11:17 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-18 18:11:17 +0200 |
commit | 01c2733db797fc1bb88cee627f792d05ab00f379 (patch) | |
tree | 6b448f04b05fc2c746f2ba542f8c8b0ebb987d8f /src/main/java/io/polyfrost/oneconfig/utils | |
parent | 859f214759c688fcaaf97a2a02f933a28662c116 (diff) | |
parent | 2265233e317298db1da920430b8f8c21d6e3067e (diff) | |
download | OneConfig-01c2733db797fc1bb88cee627f792d05ab00f379.tar.gz OneConfig-01c2733db797fc1bb88cee627f792d05ab00f379.tar.bz2 OneConfig-01c2733db797fc1bb88cee627f792d05ab00f379.zip |
temporary commit so no more conflicts now stop touching me code :anrgydoggo:
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/utils')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java | 15 | ||||
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/utils/TickDelay.java | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java b/src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java new file mode 100644 index 0000000..e2e5184 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java @@ -0,0 +1,15 @@ +package io.polyfrost.oneconfig.utils; + +public class MathUtils { + public static float clamp(float number) { + return number < (float) 0.0 ? (float) 0.0 : Math.min(number, (float) 1.0); + } + + public static float easeOut(float current, float goal) { + if (Math.floor(Math.abs(goal - current) / (float) 0.01) > 0) { + return current + (goal - current) / (float) 20.0; + } else { + return goal; + } + } +} diff --git a/src/main/java/io/polyfrost/oneconfig/utils/TickDelay.java b/src/main/java/io/polyfrost/oneconfig/utils/TickDelay.java index 33b02fe..b28a20a 100644 --- a/src/main/java/io/polyfrost/oneconfig/utils/TickDelay.java +++ b/src/main/java/io/polyfrost/oneconfig/utils/TickDelay.java @@ -6,7 +6,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; public class TickDelay { - Integer delay; + int delay; Runnable function; public TickDelay(Runnable functionName, int ticks) { |