aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--gradle.properties2
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java12
3 files changed, 15 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fe4906c..f72768f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog
+### 1.0.36
+- Fixed a crash issue with modded tooltip components that are not properly added to tooltip component factory.
+
### 1.0.35
- Fixed an issue that could cause dependent client-side mods to crash when run on a dedicated server.
- Fixed various warnings in latest.log file.
diff --git a/gradle.properties b/gradle.properties
index a657a8b..bf52eb2 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,7 +6,7 @@ org.gradle.daemon=false
name=${rootProject.name}
group=com.anthonyhilyard.${name.toLowerCase()}
author=anthonyhilyard
-version=1.0.35
+version=1.0.36
mcVersion=1.18.1
fabricVersion=0.45.0+1.18
diff --git a/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java b/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java
index 7143b25..277f5c4 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java
@@ -254,7 +254,17 @@ public class Tooltips
return eventResult.tooltipElements().stream().map(either -> either.map(text ->
ClientTooltipComponent.create(text instanceof Component ? ((Component) text).getVisualOrderText() : Language.getInstance().getVisualOrder(text)),
- ClientTooltipComponent::create)).toList();
+ x -> {
+ // First try using the create method, for vanilla and properly-implemented tooltip components.
+ try {
+ return ClientTooltipComponent.create(x);
+ }
+ // If that fails, attempt just casting it.
+ catch (IllegalArgumentException e)
+ {
+ return (ClientTooltipComponent)x;
+ }
+ })).toList();
}
public static Rect2i calculateRect(final ItemStack stack, PoseStack poseStack, List<ClientTooltipComponent> components,