38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
package io.gitlab.jfronny.quickmeth;
|
|
|
|
import net.minecraft.util.math.MathHelper;
|
|
|
|
public class MathUtil {
|
|
public static double boxedInvert(double min, double max, double value) {
|
|
return max - value + min;
|
|
}
|
|
|
|
public static double boxedInvert(double value) {
|
|
return boxedInvert(MathHelper.floor(value), MathHelper.ceil(value), value);
|
|
}
|
|
|
|
public static float boxedInvert(float min, float max, float value) {
|
|
return max - value + min;
|
|
}
|
|
|
|
public static float boxedInvert(float value) {
|
|
return boxedInvert(MathHelper.floor(value), MathHelper.ceil(value), value);
|
|
}
|
|
|
|
public static long boxedInvert(long min, long max, long value) {
|
|
return max - value + min;
|
|
}
|
|
|
|
public static long boxedInvert(long value) {
|
|
return boxedInvert(MathHelper.floor(value), MathHelper.ceil(value), value);
|
|
}
|
|
|
|
public static int boxedInvert(int min, int max, int value) {
|
|
return max - value + min;
|
|
}
|
|
|
|
public static int boxedInvert(int value) {
|
|
return boxedInvert(MathHelper.floor(value), MathHelper.ceil(value), value);
|
|
}
|
|
}
|