Add a config option for what enemies count as skeletons (#72)

This commit is contained in:
Nikolay S. authored and GitHub committed 2026-01-28 16:36:07 -06:00
1 parent c980b36e91
commit 704836810c
3 files changed
+41 -14

No files matched your search

@@ -1,7 +1,9 @@
package fox.spiteful.avaritia;
import java.io.File;
import java.util.ArrayList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.common.config.Configuration;
import org.apache.logging.log4j.Level;
@@ -16,6 +18,8 @@ public class Config {
public static boolean endestTileGriefing = true;
public static boolean fractured = false;
public static boolean fast = true;
public static String[] skeletonTypes = { "net.minecraft.entity.monster.EntitySkeleton" };
public static final ArrayList<Class<? extends EntityLivingBase>> skeletons = new ArrayList<>();
public static boolean stepUp = true;
public static boolean thaumic = true;
@@ -108,6 +112,13 @@ public class Config {
"Gotta Go Fast",
fast,
"Disable if the Infinity Boots' speed boost is too ridiculous").getBoolean(true);
skeletonTypes = conf
.get(
"general",
"Skeleton Types",
skeletonTypes,
"The list of class names of entities that count as skeletons for the Skullfire Sword.")
.getStringList();
stepUp = conf
.get("general", "Boots step up", stepUp, "Disable if the Infinity Boots' step assist is annoying")
.getBoolean(true);
@@ -173,4 +184,20 @@ public class Config {
conf.save();
}
}
public static void postLoadConfigs() {
skeletons.clear();
for (String className : skeletonTypes) {
try {
Class<?> clazz = Class.forName(className);
skeletons.add(clazz.asSubclass(EntityLivingBase.class));
} catch (ClassNotFoundException | ClassCastException e) {
Lumberjack.logger.warn(
"The \"Skeleton Types\" config contains the class name \"{}\", which does not represent a killable entity.",
className);
}
}
}
}