Add config option to remove skeleguns

This commit is contained in:
George Paton 2024-10-24 16:04:01 +11:00
parent 557913db64
commit ddfe24e680
2 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,7 @@ public class MobConfig {
public static boolean enableDucks = true;
public static boolean enableMobGear = true;
public static boolean enableMobWeapons = true;
public static boolean enableHives = true;
public static int hiveSpawn = 256;
@ -94,6 +95,7 @@ public class MobConfig {
enableDucks = CommonConfig.createConfigBool(config, CATEGORY, "12.D00_enableDucks", "Whether pressing O should allow the player to duck", true);
enableMobGear = CommonConfig.createConfigBool(config, CATEGORY, "12.D01_enableMobGear", "Whether zombies and skeletons should have additional gear when spawning", true);
enableMobWeapons = CommonConfig.createConfigBool(config, CATEGORY, "12.D02_enableMobWeapons", "Whether skeletons should have bows replaced with guns when spawning at higher soot levels", true);
enableHives = CommonConfig.createConfigBool(config, CATEGORY, "12.G00_enableHives", "Whether glyphid hives should spawn", true);
hiveSpawn = CommonConfig.createConfigInt(config, CATEGORY, "12.G01_hiveSpawn", "The average amount of chunks per hive", 256);

View File

@ -424,6 +424,7 @@ public class ModEventHandler {
}
private static ItemStack getSkelegun(float soot, Random rand) {
if(!MobConfig.enableMobWeapons) return null;
if(rand.nextDouble() > Math.log(soot) * 0.25) return null;
ArrayList<WeightedRandomObject> pool = new ArrayList<WeightedRandomObject>();