From feb5fea1a2e52bd78d43b68644a426fbb3e34ca9 Mon Sep 17 00:00:00 2001 From: Brian Rivas Date: Sat, 29 Jun 2024 14:32:59 -0700 Subject: [PATCH] 2.0.4 build4 --- build.gradle | 2 +- gradle.properties | 2 +- .../com/greymerk/roguelike/dungeon/layout/LayoutManager.java | 3 ++- .../java/com/greymerk/roguelike/mixin/ChunkFeatureMixin.java | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index bf15f6fcf..168338f2f 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { diff --git a/gradle.properties b/gradle.properties index 9518cc390..6db1f150d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 \ No newline at end of file diff --git a/src/main/java/com/greymerk/roguelike/dungeon/layout/LayoutManager.java b/src/main/java/com/greymerk/roguelike/dungeon/layout/LayoutManager.java index 015f064ad..21d638b99 100644 --- a/src/main/java/com/greymerk/roguelike/dungeon/layout/LayoutManager.java +++ b/src/main/java/com/greymerk/roguelike/dungeon/layout/LayoutManager.java @@ -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 rooms = roomProvider.getRooms(rand, numRooms); diff --git a/src/main/java/com/greymerk/roguelike/mixin/ChunkFeatureMixin.java b/src/main/java/com/greymerk/roguelike/mixin/ChunkFeatureMixin.java index 00305c613..db0fa0222 100644 --- a/src/main/java/com/greymerk/roguelike/mixin/ChunkFeatureMixin.java +++ b/src/main/java/com/greymerk/roguelike/mixin/ChunkFeatureMixin.java @@ -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);