From 9008722f3cf1bdeb2580dc0ff243d5d07cf0bc39 Mon Sep 17 00:00:00 2001 From: TheBv Date: Mon, 16 Oct 2023 22:10:56 +0200 Subject: [PATCH] chore: removed unnecessary config values --- .../java/com/github/alexthe666/iceandfire/IafConfig.java | 6 ------ .../github/alexthe666/iceandfire/config/ServerConfig.java | 6 ------ .../alexthe666/iceandfire/entity/EntityAmphithere.java | 3 +-- .../alexthe666/iceandfire/entity/EntityCockatrice.java | 4 ---- .../alexthe666/iceandfire/entity/EntityDeathWorm.java | 1 - .../github/alexthe666/iceandfire/entity/EntityTroll.java | 3 --- 6 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/main/java/com/github/alexthe666/iceandfire/IafConfig.java b/src/main/java/com/github/alexthe666/iceandfire/IafConfig.java index c1624ab46..4aae7b099 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/IafConfig.java +++ b/src/main/java/com/github/alexthe666/iceandfire/IafConfig.java @@ -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; @@ -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; @@ -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(); @@ -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(); diff --git a/src/main/java/com/github/alexthe666/iceandfire/config/ServerConfig.java b/src/main/java/com/github/alexthe666/iceandfire/config/ServerConfig.java index 2e4fac017..637432cad 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/config/ServerConfig.java +++ b/src/main/java/com/github/alexthe666/iceandfire/config/ServerConfig.java @@ -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; @@ -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; @@ -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"); @@ -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."); @@ -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(); diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityAmphithere.java b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityAmphithere.java index 9c121876c..2747398f3 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityAmphithere.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityAmphithere.java @@ -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; } @@ -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); diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java index 8b4c04268..c977756e4 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java @@ -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)); diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityDeathWorm.java b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityDeathWorm.java index 97f266377..4ee8b9dde 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityDeathWorm.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityDeathWorm.java @@ -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; } diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityTroll.java b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityTroll.java index 55566fd03..7b882be0a 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityTroll.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityTroll.java @@ -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); }