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

128 lines
5.1 KiB
Java
Raw Normal View History

2021-12-29 23:36:10 +01:00
package io.gitlab.jfronny.combit;
2022-01-08 23:04:18 +01:00
import io.gitlab.jfronny.libjf.config.api.Entry;
import io.gitlab.jfronny.libjf.config.api.JfConfig;
import io.gitlab.jfronny.libjf.config.api.Preset;
import io.gitlab.jfronny.libjf.config.api.Verifier;
2021-12-29 23:36:10 +01:00
import net.fabricmc.loader.api.FabricLoader;
2022-01-08 22:27:12 +01:00
import net.minecraft.entity.damage.DamageSource;
2021-12-29 23:36:10 +01:00
import java.util.HashSet;
public class CombitConfig implements JfConfig {
// Invulnerability
2022-01-08 23:04:18 +01:00
@Entry public static Integer 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;
@Entry public static Boolean excludeAllMobs = false;
@Entry public static Boolean excludePlayers = false;
2022-01-08 23:04:18 +01:00
// Entity Modification
@Entry public static Boolean skeletonsBurn = true;
@Entry public static Boolean zombiesBurn = true;
@Entry public static Boolean creepersBurn = false;
@Entry public static Boolean creepersExplodeWhenBurning = false;
// Health
@Entry public static Double entityHealthFactor = 1.5;
@Entry public static HashSet<String> entityHealthBlacklist = null;
// Weapons
2022-01-08 23:04:18 +01:00
@Entry public static Double cooldownProgressOverride = -1d;
@Entry public static Double cooldownProgressPerTickOverride = -1d;
@Entry public static Double weaponAttackDamageFactor = 1d;
@Entry public static Double axeAttackDamageFactor = 1d;
2022-01-08 22:27:12 +01:00
// Knockback
2022-01-08 23:04:18 +01: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
2021-12-29 23:36:10 +01:00
@Entry public static Boolean debug = FabricLoader.getInstance().isDevelopmentEnvironment();
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<>();
damageSourceWhitelist.add(DamageSource.IN_FIRE.getName());
damageSourceWhitelist.add(DamageSource.LIGHTNING_BOLT.getName());
damageSourceWhitelist.add(DamageSource.LAVA.getName());
damageSourceWhitelist.add(DamageSource.HOT_FLOOR.getName());
damageSourceWhitelist.add(DamageSource.IN_WALL.getName());
damageSourceWhitelist.add(DamageSource.CACTUS.getName());
damageSourceWhitelist.add(DamageSource.OUT_OF_WORLD.getName());
damageSourceWhitelist.add(DamageSource.SWEET_BERRY_BUSH.getName());
}
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 22:27:12 +01:00
entityHealthFactor = 1.0;
entityHealthBlacklist = null;
cooldownProgressOverride = 0.8;
cooldownProgressPerTickOverride = Double.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;
entityHealthFactor = 10d;
entityHealthBlacklist = null;
cooldownProgressOverride = 1d;
cooldownProgressPerTickOverride = Double.MAX_VALUE;
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
}
2021-12-29 23:36:10 +01:00
}