Skip to content

Commit

Permalink
chore: removed unnecessary config values
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBv committed Oct 16, 2023
1 parent 8719f42 commit 9008722
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 22 deletions.
6 changes: 0 additions & 6 deletions src/main/java/com/github/alexthe666/iceandfire/IafConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@ public class IafConfig {
public static double deathWormAttackStrength = 3D;
public static boolean deathWormAttackMonsters = true;
public static int deathWormSpawnRate = 30;
public static int deathWormSpawnCheckChance = 3;
public static int cockatriceChickenSearchLength = 32;
public static int cockatriceEggChance = 30;
public static double cockatriceMaxHealth = 40.0D;
public static boolean chickensLayRottenEggs = true;
public static boolean spawnCockatrices = true;
public static int cockatriceSpawnRate = 4;
public static int cockatriceSpawnCheckChance = 0;
public static int stymphalianBirdTargetSearchLength = 48;
public static int stymphalianBirdFeatherDropChance = 25;
public static double stymphalianBirdFeatherAttackStength = 1F;
Expand All @@ -87,7 +85,6 @@ public class IafConfig {
public static int stymphalianBirdSpawnChance = 80;
public static boolean spawnTrolls = true;
public static int trollSpawnRate = 60;
public static int trollSpawnCheckChance = 2;
public static boolean trollsDropWeapon = true;
public static double trollMaxHealth = 50;
public static double trollAttackStrength = 10;
Expand Down Expand Up @@ -219,14 +216,12 @@ public static void bakeServer(final ModConfig config) {
deathWormAttackStrength = ConfigHolder.SERVER.deathWormAttackStrength.get();
deathWormAttackMonsters = ConfigHolder.SERVER.deathWormAttackMonsters.get();
deathWormSpawnRate = ConfigHolder.SERVER.deathWormSpawnRate.get();
deathWormSpawnCheckChance = ConfigHolder.SERVER.deathWormSpawnCheckChance.get();
cockatriceChickenSearchLength = ConfigHolder.SERVER.cockatriceChickenSearchLength.get();
cockatriceEggChance = ConfigHolder.SERVER.cockatriceEggChance.get();
cockatriceMaxHealth = ConfigHolder.SERVER.cockatriceMaxHealth.get();
chickensLayRottenEggs = ConfigHolder.SERVER.chickensLayRottenEggs.get();
spawnCockatrices = ConfigHolder.SERVER.spawnCockatrices.get();
cockatriceSpawnRate = ConfigHolder.SERVER.cockatriceSpawnRate.get();
cockatriceSpawnCheckChance = ConfigHolder.SERVER.cockatriceSpawnCheckChance.get();
stymphalianBirdTargetSearchLength = ConfigHolder.SERVER.stymphalianBirdTargetSearchLength.get();
stymphalianBirdFeatherDropChance = ConfigHolder.SERVER.stymphalianBirdFeatherDropChance.get();
stymphalianBirdFeatherAttackStength = ConfigHolder.SERVER.stymphalianBirdFeatherAttackStength.get();
Expand All @@ -237,7 +232,6 @@ public static void bakeServer(final ModConfig config) {
stymphalianBirdSpawnChance = ConfigHolder.SERVER.stymphalianBirdSpawnChance.get();
spawnTrolls = ConfigHolder.SERVER.spawnTrolls.get();
trollSpawnRate = ConfigHolder.SERVER.trollSpawnRate.get();
trollSpawnCheckChance = ConfigHolder.SERVER.trollSpawnCheckChance.get();
trollsDropWeapon = ConfigHolder.SERVER.trollsDropWeapon.get();
trollMaxHealth = ConfigHolder.SERVER.trollMaxHealth.get();
trollAttackStrength = ConfigHolder.SERVER.trollAttackStrength.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ public class ServerConfig {
public final ForgeConfigSpec.DoubleValue deathWormAttackStrength;
public final ForgeConfigSpec.BooleanValue deathWormAttackMonsters;
public final ForgeConfigSpec.IntValue deathWormSpawnRate;
public final ForgeConfigSpec.IntValue deathWormSpawnCheckChance;
public final ForgeConfigSpec.IntValue cockatriceChickenSearchLength;
public final ForgeConfigSpec.IntValue cockatriceEggChance;
public final ForgeConfigSpec.DoubleValue cockatriceMaxHealth;
public final ForgeConfigSpec.BooleanValue chickensLayRottenEggs;
public final ForgeConfigSpec.BooleanValue spawnCockatrices;
public final ForgeConfigSpec.IntValue cockatriceSpawnRate;
public final ForgeConfigSpec.IntValue cockatriceSpawnCheckChance;
public final ForgeConfigSpec.IntValue stymphalianBirdTargetSearchLength;
public final ForgeConfigSpec.IntValue stymphalianBirdFeatherDropChance ;
public final ForgeConfigSpec.DoubleValue stymphalianBirdFeatherAttackStength;
Expand All @@ -80,7 +78,6 @@ public class ServerConfig {
public final ForgeConfigSpec.IntValue stymphalianBirdSpawnChance;
public final ForgeConfigSpec.BooleanValue spawnTrolls;
public final ForgeConfigSpec.IntValue trollSpawnRate;
public final ForgeConfigSpec.IntValue trollSpawnCheckChance;
public final ForgeConfigSpec.BooleanValue trollsDropWeapon;
public final ForgeConfigSpec.DoubleValue trollMaxHealth;
public final ForgeConfigSpec.DoubleValue trollAttackStrength;
Expand Down Expand Up @@ -239,7 +236,6 @@ public ServerConfig(final ForgeConfigSpec.Builder builder) {
this.deathWormAttackStrength = buildDouble(builder, "Death Worm Base Attack Strength", "all", 3, 1, 10000, "Default deathworm attack strength, this is scaled to the worm's particular size");
this.deathWormAttackMonsters = buildBoolean(builder, "Death Worms Target Monsters", "all", true, "True if wild deathworms are allowed to target and attack monsters");
this.deathWormSpawnRate = buildInt(builder, "Death Worm Spawn Weight", "all", 30, 1, 10000, "Deathworm spawn weight. Higher = lower chance to spawn");
this.deathWormSpawnCheckChance = buildInt(builder, "Death Worm Spawn Check Chance", "all", 3, 0, 10000, "A double check to see if the game can spawn death worms. Higher number = lower chance to spawn.");
builder.pop();
builder.push("Cockatrice");
this.cockatriceMaxHealth = buildDouble(builder, "Cockatrice Health", "all", 40, 1, 10000, "Maximum cockatrice health");
Expand All @@ -248,7 +244,6 @@ public ServerConfig(final ForgeConfigSpec.Builder builder) {
this.chickensLayRottenEggs = buildBoolean(builder, "Chickens Lay Rotten Eggs", "all", true, "True if chickens lay rotten eggs.");
this.spawnCockatrices = buildBoolean(builder, "Spawn Cockatrices", "all", true, "True if cockatrices are allowed to spawn");
this.cockatriceSpawnRate = buildInt(builder, "Cockatrice Spawn Weight", "all", 4, 1, 10000, "Cockatrice spawn weight. Lower = lower chance to spawn");
this.cockatriceSpawnCheckChance = buildInt(builder, "Cockatrice Spawn Check Chance", "all", 0, 0, 10000, "A double check to see if the game can spawn cockatrices. Higher number = lower chance to spawn.");
builder.pop();
builder.push("Stymphalians");
this.stymphalianBirdTargetSearchLength = buildInt(builder, "Stymphalian Bird Target Search Length", "all", 64, 1, 10000, "How many blocks away can stymphalian birds spot potential prey. Note that increasing this could cause lag.");
Expand All @@ -264,7 +259,6 @@ public ServerConfig(final ForgeConfigSpec.Builder builder) {
this.spawnTrolls = buildBoolean(builder, "Spawn Trolls", "all", true, "True if trolls are allowed to spawn");
this.trollsDropWeapon = buildBoolean(builder, "Trolls Drop Weapon", "all", true, "True if trolls are allowed to drop their weapon on death.");
this.trollSpawnRate = buildInt(builder, "Troll Spawn Weight", "all", 40, 1, 10000, "Troll spawn weight. Lower = lower chance to spawn");
this.trollSpawnCheckChance = buildInt(builder, "Troll Spawn Check Chance", "all", 2, 0, 10000, "A double check to see if the game can spawn trolls. Higher number = lower chance to spawn.");
this.trollMaxHealth = buildDouble(builder, "Troll Max Health", "all", 50, 1, 10000, "Maximum troll health");
this.trollAttackStrength = buildDouble(builder, "Troll Attack Strength", "all", 10, 1, 10000, "Troll attack strength");
builder.pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ public static BlockPos getPositionInOrbit(EntityAmphithere entity, Level world,
double extraX = radius * Mth.sin((float) (Math.PI + angle));
double extraZ = radius * Mth.cos(angle);
BlockPos radialPos = BlockPos.containing(orbit.getX() + extraX, orbit.getY(),orbit.getZ() + extraZ);
//world.setBlockState(radialPos.down(4), Blocks.QUARTZ_BLOCK.getDefaultState());
// world.setBlockState(orbit.down(4), Blocks.GOLD_BLOCK.getDefaultState());
entity.orbitRadius = possibleOrbitRadius;
return radialPos;
}
Expand Down Expand Up @@ -632,6 +630,7 @@ public void readAdditionalSaveData(@NotNull CompoundTag compound) {
this.setCommand(compound.getInt("Command"));
}

//TODO: Create entity placements
public boolean getCanSpawnHere() {
int i = Mth.floor(this.getX());
int j = Mth.floor(this.getBoundingBox().minY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ public int getExperienceReward() {
return 10;
}

public boolean getCanSpawnHere() {
return this.getRandom().nextInt(IafConfig.cockatriceSpawnCheckChance + 1) == 0;
}

@Override
protected void registerGoals() {
this.goalSelector.addGoal(1, new FloatGoal(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public boolean getCanSpawnHere() {
BlockPos blockpos = new BlockPos(i, j, k);
this.level().getBlockState(blockpos.below()).is(BlockTags.SAND);
return this.level().getBlockState(blockpos.below()).is(BlockTags.SAND)
&& this.getRandom().nextInt(1 + IafConfig.deathWormSpawnCheckChance) == 0
&& this.level().getMaxLocalRawBrightness(blockpos) > 8;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ public boolean checkSpawnRules(LevelAccessor worldIn, @NotNull MobSpawnType spaw
BlockPos pos = this.blockPosition();
BlockPos heightAt = worldIn.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, pos);
boolean rngCheck = true;
if (IafConfig.trollSpawnCheckChance > 0) {
rngCheck = this.getRandom().nextInt(IafConfig.trollSpawnCheckChance) == 0;
}
return rngCheck && pos.getY() < heightAt.getY() - 10 && super.checkSpawnRules(worldIn, spawnReasonIn);
}

Expand Down

0 comments on commit 9008722

Please sign in to comment.