2020-08-06 23:55:17 +02:00
|
|
|
package io.gitlab.jfronny.quickmeth;
|
|
|
|
|
2020-08-07 11:02:13 +02:00
|
|
|
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
|
|
|
import me.sargunvohra.mcmods.autoconfig1u.serializer.JanksonConfigSerializer;
|
2020-08-06 23:55:17 +02:00
|
|
|
import net.fabricmc.api.ModInitializer;
|
2020-08-07 09:58:35 +02:00
|
|
|
import net.minecraft.util.math.MathHelper;
|
2020-08-06 23:55:17 +02:00
|
|
|
|
|
|
|
public class quickmeth implements ModInitializer {
|
2020-08-07 11:02:13 +02:00
|
|
|
public static Cfg cfg;
|
|
|
|
static {
|
|
|
|
AutoConfig.register(Cfg.class, JanksonConfigSerializer::new);
|
|
|
|
cfg = AutoConfig.getConfigHolder(Cfg.class).getConfig();
|
|
|
|
}
|
|
|
|
|
2020-08-06 23:55:17 +02:00
|
|
|
@Override
|
|
|
|
public void onInitialize() {
|
|
|
|
|
|
|
|
}
|
2020-08-07 00:18:24 +02:00
|
|
|
|
|
|
|
public static double BoxedInvert(double min, double max, double value) {
|
|
|
|
return max - value + min;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static double BoxedInvert(double value) {
|
2020-08-07 09:58:35 +02:00
|
|
|
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);
|
2020-08-07 00:18:24 +02:00
|
|
|
}
|
2020-08-06 23:55:17 +02:00
|
|
|
}
|