aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Hilyard <anthony.hilyard@gmail.com>2021-10-11 22:52:58 -0700
committerAnthony Hilyard <anthony.hilyard@gmail.com>2021-10-11 22:52:58 -0700
commit0eb0e8504684ad9e7bdae99a54de618809cee8d4 (patch)
treefdac5271bde7d3f1166de532313903b9b86c5094
parent8c02a2a7e0d2e2951cdc6a4382a6aa8f235ec63b (diff)
downloadIceberg-0eb0e8504684ad9e7bdae99a54de618809cee8d4.tar.gz
Iceberg-0eb0e8504684ad9e7bdae99a54de618809cee8d4.tar.bz2
Iceberg-0eb0e8504684ad9e7bdae99a54de618809cee8d4.zip
Fixed a null pointer exception during tooltip calculation. Fixed a
compatibility issue with advancement-related mods.
-rw-r--r--gradle.properties2
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java6
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java2
3 files changed, 5 insertions, 5 deletions
diff --git a/gradle.properties b/gradle.properties
index 7a5db84..2534db5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,6 +6,6 @@ org.gradle.daemon=false
name=Iceberg
group=com.anthonyhilyard.iceberg
author=anthonyhilyard
-version=1.0.10
+version=1.0.12
mcVersion=1.16.5
forgeVersion=36.2.2 \ No newline at end of file
diff --git a/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java b/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
index 8148b9b..fe20cec 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
@@ -1,6 +1,6 @@
package com.anthonyhilyard.iceberg.events;
-import net.minecraftforge.event.entity.player.AdvancementEvent;
+import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraft.advancements.Advancement;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.common.MinecraftForge;
@@ -14,14 +14,14 @@ import net.minecraftforge.common.MinecraftForge;
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
*/
-public class CriterionEvent extends AdvancementEvent
+public class CriterionEvent extends PlayerEvent
{
private final Advancement advancement;
private final String criterionKey;
public CriterionEvent(PlayerEntity player, Advancement advancement, String criterionKey)
{
- super(player, advancement);
+ super(player);
this.advancement = advancement;
this.criterionKey = criterionKey;
}
diff --git a/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java b/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java
index bc5f081..d111ae5 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java
@@ -234,7 +234,7 @@ public class Tooltips
int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font)
{
Rectangle2d rect = new Rectangle2d(0, 0, 0, 0);
- if (textLines.isEmpty())
+ if (textLines == null || textLines.isEmpty() || stack == null)
{
return rect;
}