From 0bcd99855f18748c3a2dfe31912027883de42998 Mon Sep 17 00:00:00 2001
From: Majrusz <mateuszsmolarkiewicz@wp.pl>
Date: Sat, 30 Dec 2023 11:07:06 +0100
Subject: [PATCH 1/4] Updated version name

---
 changelog.md      | 2 --
 gradle.properties | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/changelog.md b/changelog.md
index 9526dc6e2..e69de29bb 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,2 +0,0 @@
-- fixed game crash during Undead Army (reported by @NotTohm)
-- fixed game crash caused by Blood Moon (reported by @ZacGames)
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 5a070cc8e..f334e2e9f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,7 +7,7 @@ minecraft_version=1.20.1
 # Mod
 mod_id=majruszsdifficulty
 mod_archives_name=majruszs-difficulty
-mod_version=1.9.5
+mod_version=1.9.6-unfinished
 mod_display_name=Majrusz's Progressive Difficulty
 mod_description=Mod that progressively increases the game difficulty over time.
 mod_authors=Majrusz

From aafa95c1dbdd64065143da0e068cb1cf4ab43fef Mon Sep 17 00:00:00 2001
From: Majrusz <mateuszsmolarkiewicz@wp.pl>
Date: Sat, 30 Dec 2023 11:20:37 +0100
Subject: [PATCH 2/4] Fixed compatibility crash with Optifine (reported by
 @Fiocher)

---
 changelog.md                                                   | 1 +
 .../mixin/MixinBlockEntityWithoutLevelRenderer.java            | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/changelog.md b/changelog.md
index e69de29bb..c80742996 100644
--- a/changelog.md
+++ b/changelog.md
@@ -0,0 +1 @@
+- fixed compatibility crash with Optifine (reported by @Fiocher)
\ No newline at end of file
diff --git a/common/src/main/java/com/majruszsdifficulty/mixin/MixinBlockEntityWithoutLevelRenderer.java b/common/src/main/java/com/majruszsdifficulty/mixin/MixinBlockEntityWithoutLevelRenderer.java
index 0224169c4..776b3205e 100644
--- a/common/src/main/java/com/majruszsdifficulty/mixin/MixinBlockEntityWithoutLevelRenderer.java
+++ b/common/src/main/java/com/majruszsdifficulty/mixin/MixinBlockEntityWithoutLevelRenderer.java
@@ -31,7 +31,8 @@ public abstract class MixinBlockEntityWithoutLevelRenderer {
 			value = "INVOKE",
 			target = "Lcom/mojang/blaze3d/vertex/PoseStack;popPose ()V"
 		),
-		method = "renderByItem (Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemDisplayContext;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;II)V"
+		method = "renderByItem (Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemDisplayContext;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;II)V",
+		require = 0 // compatibility with Optifine
 	)
 	private void renderByItem( ItemStack itemStack, ItemDisplayContext context, PoseStack poseStack, MultiBufferSource multiBufferSource, int x, int y,
 		CallbackInfo callback

From d192f3912a5fc098764a319f086579aac25de64e Mon Sep 17 00:00:00 2001
From: Majrusz <mateuszsmolarkiewicz@wp.pl>
Date: Sun, 31 Dec 2023 09:49:18 +0100
Subject: [PATCH 3/4] Fixed bug with Bleeding chances exceeding 100% on items
 with custom chances (reported by @ZacGames)

---
 changelog.md                                                   | 3 ++-
 .../java/com/majruszsdifficulty/events/OnBleedingTooltip.java  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/changelog.md b/changelog.md
index c80742996..54cac9e43 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1 +1,2 @@
-- fixed compatibility crash with Optifine (reported by @Fiocher)
\ No newline at end of file
+- fixed compatibility crash with Optifine (reported by @Fiocher)
+- fixed bug with Bleeding chances exceeding 100% on items with custom chances (reported by @ZacGames)
\ No newline at end of file
diff --git a/common/src/main/java/com/majruszsdifficulty/events/OnBleedingTooltip.java b/common/src/main/java/com/majruszsdifficulty/events/OnBleedingTooltip.java
index de9f9d476..f2ae4bb32 100644
--- a/common/src/main/java/com/majruszsdifficulty/events/OnBleedingTooltip.java
+++ b/common/src/main/java/com/majruszsdifficulty/events/OnBleedingTooltip.java
@@ -3,6 +3,7 @@
 import com.majruszlibrary.events.OnItemAttributeTooltip;
 import com.majruszlibrary.events.base.Event;
 import com.majruszlibrary.events.base.Events;
+import com.majruszlibrary.math.Range;
 import com.majruszlibrary.text.TextHelper;
 import net.minecraft.ChatFormatting;
 import net.minecraft.network.chat.MutableComponent;
@@ -27,7 +28,7 @@ public OnBleedingTooltip( OnItemAttributeTooltip data, int amplifier ) {
 	}
 
 	public void addItem( double chance ) {
-		MutableComponent component = TextHelper.translatable( "effect.majruszsdifficulty.bleeding.item_tooltip", TextHelper.percent( ( float )chance ), TextHelper.toRoman( this.amplifier + 1 ) )
+		MutableComponent component = TextHelper.translatable( "effect.majruszsdifficulty.bleeding.item_tooltip", TextHelper.percent( Range.CHANCE.clamp( ( float )chance ) ), TextHelper.toRoman( this.amplifier + 1 ) )
 			.withStyle( ChatFormatting.DARK_GREEN );
 
 		this.data.add( EquipmentSlot.MAINHAND, component );

From 0f859425ea8e827288bd2d15d24ff8a1239f59b5 Mon Sep 17 00:00:00 2001
From: Majrusz <mateuszsmolarkiewicz@wp.pl>
Date: Sun, 31 Dec 2023 09:50:45 +0100
Subject: [PATCH 4/4] Removed unfinished tag

---
 gradle.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gradle.properties b/gradle.properties
index f334e2e9f..60467301a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,7 +7,7 @@ minecraft_version=1.20.1
 # Mod
 mod_id=majruszsdifficulty
 mod_archives_name=majruszs-difficulty
-mod_version=1.9.6-unfinished
+mod_version=1.9.6
 mod_display_name=Majrusz's Progressive Difficulty
 mod_description=Mod that progressively increases the game difficulty over time.
 mod_authors=Majrusz