Skip to content

Commit

Permalink
2.0.4 build4
Browse files Browse the repository at this point in the history
  • Loading branch information
Greymerk committed Jun 29, 2024
1 parent 450f6bd commit feb5fea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
}

version = "${project.mod_version}-c-${project.minecraft_version}-fabric"
version = "${project.mod_version}-${project.minecraft_version}-fabric"
group = project.maven_group

base {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ loader_version=0.14.21
fabric_version=0.83.0+1.20.1

# Mod Properties
mod_version=2.0.4
mod_version=2.0.4-build4
maven_group=com.greymerk
archives_base_name=RoguelikeDungeons
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public void generate(IWorldEditor editor) {

RoomProvider roomProvider = this.settings.getLevel(floor.getOrigin().getY()).getRooms();

int numRooms = Math.clamp(Config.ofInteger(Config.ROOMS_PER_LEVEL).orElse(20), 1, 1000);
int configRoomNumber = Config.ofInteger(Config.ROOMS_PER_LEVEL).orElse(20);
int numRooms = Math.max(1, Math.min(1000, configRoomNumber));

List<Room> rooms = roomProvider.getRooms(rand, numRooms);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public void generateFeatures(StructureWorldAccess worldAccess, Chunk chunk, Stru
if(!Dungeon.canSpawn(editor, pos.copy())) return;

Random rand = editor.getRandom(pos);
Double chance = Math.clamp(Config.ofDouble(Config.FREQUENCY), 0, 1.0);
//Double chance = Math.clamp(Config.ofDouble(Config.FREQUENCY), 0, 1.0);
Double chance = Math.max(0, Math.min(1.0, Config.ofDouble(Config.FREQUENCY)));
Double roll = rand.nextDouble();
if(chance == 1.0 || roll < chance) {
Dungeon.generate(editor, pos);
Expand Down

0 comments on commit feb5fea

Please sign in to comment.