Skip to content

Commit

Permalink
Surprise! Haha. Well, this is awkward.
Browse files Browse the repository at this point in the history
FIX: Fixed a bug where the freaking video game would freaking crash if you set the proximity to 0 (pain i can't believe I didn't catch this)
  • Loading branch information
Superkat32 committed Feb 5, 2024
1 parent 6c0613a commit a5d45f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.4+build.3
loader_version=0.15.2

# Mod Properties
mod_version=1.0.3
mod_version=1.0.4
maven_group=net.superkat.flutterandflounder
archives_base_name=flutterandflounder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,14 @@ private static BlockPos fishSpawningPos(ServerWorld world, BlockPos festCenterPo
int spawnRadius = world.getGameRules().getInt(FlutterAndFlounderMain.FLOUNDERFEST_MOB_SPAWN_RADIUS);
//additional blocks to add a small amount of randomness to the spawn location
int spawnProximity = world.getGameRules().getInt(FlutterAndFlounderMain.FLOUNDERFEST_MOB_SPAWN_PROXIMITY);
int x = festCenterPos.getX() + MathHelper.floor(MathHelper.cos(f) * spawnRadius) + world.random.nextInt(spawnProximity);
int z = festCenterPos.getZ() + MathHelper.floor(MathHelper.sin(f) * spawnRadius) + world.random.nextInt(spawnProximity);
int extraX = 0;
int extraZ = 0;
if(spawnProximity > 0) {
extraX = world.random.nextInt(spawnProximity);
extraZ = world.random.nextInt(spawnProximity);
}
int x = festCenterPos.getX() + MathHelper.floor(MathHelper.cos(f) * spawnRadius) + extraX;
int z = festCenterPos.getZ() + MathHelper.floor(MathHelper.sin(f) * spawnRadius) + extraZ;
int y = world.getTopY(Heightmap.Type.WORLD_SURFACE, x, z);
mutable.set(x, y, z);
if(!world.isNearOccupiedPointOfInterest(mutable) || proximity >= 2) {
Expand Down

0 comments on commit a5d45f9

Please sign in to comment.