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

131 lines
5.2 KiB
Java

package io.gitlab.jfronny.combit;
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;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.entity.damage.DamageSource;
import java.util.HashSet;
public class CombitConfig implements JfConfig {
// Invulnerability
@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;
@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;
// 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;
@Entry public static Boolean alwaysBurn = false;
// Health
@Entry public static Double entityHealthFactor = 1.5;
@Entry public static HashSet<String> entityHealthBlacklist = null;
// Weapons
@Entry public static Double cooldownProgressOverride = -1d;
@Entry public static Double cooldownProgressPerTickOverride = -1d;
@Entry public static Double weaponAttackDamageFactor = 1d;
@Entry public static Double axeAttackDamageFactor = 1d;
// Knockback
@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
@Entry public static Boolean debug = FabricLoader.getInstance().isDevelopmentEnvironment();
@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;
skeletonsBurn = true;
zombiesBurn = true;
creepersBurn = false;
creepersExplodeWhenBurning = false;
alwaysBurn = false;
entityHealthFactor = 1.0;
entityHealthBlacklist = null;
cooldownProgressOverride = 0.8;
cooldownProgressPerTickOverride = Double.MIN_VALUE;
weaponAttackDamageFactor = 1d;
axeAttackDamageFactor = 0.5;
snowballKnockbackFactor = 1d;
snowballDamage = 0f;
eggKnockbackFactor = 1d;
eggDamage = 0f;
fishingBobberPullFactor = 1d;
}
@Preset public static void madness() {
iFrameInterval = 0;
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;
alwaysBurn = 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;
}
@Preset public static void noInvulnerability() {
iFrameInterval = 0;
}
}