Combit/src/main/java/io/gitlab/jfronny/combit/CombitConfig.java

137 lines
5.0 KiB
Java
Raw Normal View History

2021-12-29 23:36:10 +01:00
package io.gitlab.jfronny.combit;
2022-08-28 15:21:37 +02:00
import io.gitlab.jfronny.libjf.config.api.v1.*;
2021-12-29 23:36:10 +01:00
import net.fabricmc.loader.api.FabricLoader;
import java.util.HashSet;
2022-08-28 15:21:37 +02:00
@JfConfig
public class CombitConfig {
2021-12-29 23:36:10 +01:00
// Invulnerability
2022-08-28 15:21:37 +02:00
@Entry public static int iFrameInterval = -1;
@Entry(min=-1, max = 1) public static double attackCancelThreshold = -1d;
@Entry(min=-1, max = 1) public static double knockbackCancelThreshold = -1d;
2021-12-29 23:36:10 +01:00
@Entry public static HashSet<String> attackerWhitelist = null;
@Entry public static HashSet<String> damageSourceWhitelist = null;
@Entry public static HashSet<String> targetEntityWhitelist = null;
2022-08-28 15:21:37 +02:00
@Entry public static boolean excludeAllMobs = false;
@Entry public static boolean excludePlayers = false;
2022-01-08 23:04:18 +01:00
// Entity Modification
2022-08-28 15:21:37 +02:00
@Entry public static boolean skeletonsBurn = true;
@Entry public static boolean zombiesBurn = true;
@Entry public static boolean creepersBurn = false;
@Entry public static boolean creepersExplodeWhenBurning = false;
@Entry public static boolean alwaysBurn = false;
// Health
2022-08-28 15:21:37 +02:00
@Entry public static double entityHealthFactor = 1.5;
@Entry public static HashSet<String> entityHealthBlacklist = null;
// Weapons
2022-08-28 15:21:37 +02:00
@Entry public static float cooldownProgressOverride = -1f;
@Entry public static float cooldownProgressPerTickOverride = -1f;
@Entry public static double weaponAttackDamageFactor = 1d;
@Entry public static double axeAttackDamageFactor = 1d;
2022-01-08 22:27:12 +01:00
// Knockback
2022-08-28 15:21:37 +02:00
@Entry public static double snowballKnockbackFactor = 0d;
@Entry public static float snowballDamage = 0f;
@Entry public static double eggKnockbackFactor = 0d;
@Entry public static float eggDamage = 0f;
@Entry public static double fishingBobberPullFactor = 1d;
// Debug
2022-08-28 15:21:37 +02:00
@Entry public static boolean debug = FabricLoader.getInstance().isDevelopmentEnvironment();
static {
validate();
}
2022-01-08 22:27:12 +01:00
@Verifier public static void validate() {
if (attackerWhitelist == null) {
attackerWhitelist = new HashSet<>();
attackerWhitelist.add("minecraft:slime");
attackerWhitelist.add("minecraft:magma_cube");
attackerWhitelist.add("tconstruct:blueslime");
attackerWhitelist.add("thaumcraft:thaumslime");
}
if (targetEntityWhitelist == null) {
targetEntityWhitelist = new HashSet<>();
}
if (damageSourceWhitelist == null) {
damageSourceWhitelist = new HashSet<>();
// net.minecraft.entity.damage.DamageSource
damageSourceWhitelist.add("inFire");
damageSourceWhitelist.add("lightningBolt");
damageSourceWhitelist.add("lava");
damageSourceWhitelist.add("hotFloor");
damageSourceWhitelist.add("inWall");
damageSourceWhitelist.add("cactus");
damageSourceWhitelist.add("outOfWorld");
damageSourceWhitelist.add("sweetBerryBush");
2022-01-08 22:27:12 +01:00
}
if (entityHealthBlacklist == null) {
entityHealthBlacklist = new HashSet<>();
entityHealthBlacklist.add("minecraft:player");
}
}
@Preset public static void v189() {
iFrameInterval = -1;
attackCancelThreshold = 0.1;
knockbackCancelThreshold = 0.75;
attackerWhitelist = null;
damageSourceWhitelist = null;
targetEntityWhitelist = null;
excludeAllMobs = false;
excludePlayers = false;
2022-01-08 23:04:18 +01:00
skeletonsBurn = true;
zombiesBurn = true;
creepersBurn = false;
creepersExplodeWhenBurning = false;
2022-01-08 23:32:51 +01:00
alwaysBurn = false;
2022-01-08 22:27:12 +01:00
entityHealthFactor = 1.0;
entityHealthBlacklist = null;
2022-08-28 15:21:37 +02:00
cooldownProgressOverride = 0.8f;
cooldownProgressPerTickOverride = Float.MIN_VALUE;
2022-01-08 23:04:18 +01:00
weaponAttackDamageFactor = 1d;
2022-01-08 22:27:12 +01:00
axeAttackDamageFactor = 0.5;
2022-01-08 23:04:18 +01:00
snowballKnockbackFactor = 1d;
snowballDamage = 0f;
eggKnockbackFactor = 1d;
eggDamage = 0f;
fishingBobberPullFactor = 1d;
2022-01-08 22:27:12 +01:00
}
2022-01-08 23:04:18 +01:00
@Preset public static void madness() {
2022-01-08 22:27:12 +01:00
iFrameInterval = 0;
2022-01-08 23:04:18 +01:00
attackCancelThreshold = 0d;
knockbackCancelThreshold = 0d;
attackerWhitelist = new HashSet<>();
damageSourceWhitelist = new HashSet<>();
targetEntityWhitelist = new HashSet<>();
excludeAllMobs = false;
excludePlayers = false;
skeletonsBurn = false;
zombiesBurn = false;
creepersBurn = true;
creepersExplodeWhenBurning = true;
2022-01-08 23:32:51 +01:00
alwaysBurn = true;
2022-01-08 23:04:18 +01:00
entityHealthFactor = 10d;
entityHealthBlacklist = null;
2022-08-28 15:21:37 +02:00
cooldownProgressOverride = 1f;
cooldownProgressPerTickOverride = Float.MAX_VALUE;
2022-01-08 23:04:18 +01:00
weaponAttackDamageFactor = 0.5;
axeAttackDamageFactor = 5d;
snowballKnockbackFactor = -1d;
snowballDamage = 0f;
eggKnockbackFactor = -5d;
eggDamage = 1f;
fishingBobberPullFactor = 2d;
2022-01-08 22:27:12 +01:00
}
2022-01-08 23:04:18 +01:00
@Preset public static void noInvulnerability() {
iFrameInterval = 0;
2022-01-08 22:27:12 +01:00
}
2022-12-29 14:31:08 +01:00
static {
JFC_CombitConfig.ensureInitialized();
}
2021-12-29 23:36:10 +01:00
}