Skip to content
This repository was archived by the owner on Aug 13, 2023. It is now read-only.

Commit c57fb32

Browse files
author
Lumaa
committed
removable icon
1 parent a625b49 commit c57fb32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/lumaa/libu/client/ui/LibuToast.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import net.minecraft.client.util.math.MatrixStack;
1212
import net.minecraft.item.ItemStack;
1313
import net.minecraft.text.MutableText;
14+
import org.jetbrains.annotations.Nullable;
1415

1516
@Environment(EnvType.CLIENT)
1617
public class LibuToast implements Toast {
@@ -23,7 +24,7 @@ public class LibuToast implements Toast {
2324
private static int descColor = 0xffff55;
2425
private boolean displayed;
2526

26-
public LibuToast(ItemStack icon, MutableText title, MutableText description) {
27+
public LibuToast(@Nullable ItemStack icon, MutableText title, MutableText description) {
2728
this.icon = icon;
2829
this.title = title;
2930
this.description = description;
@@ -51,6 +52,8 @@ public Visibility draw(MatrixStack matrices, ToastManager manager, long startTim
5152
manager.drawTexture(matrices, 0, 0, 0, type.v, getWidth(), getHeight());
5253
textRenderer.draw(matrices, this.title, 30.0F, 7.0F, titleColor);
5354
textRenderer.draw(matrices, this.description, 30.0F, 18.0F, descColor);
55+
56+
assert icon != null;
5457
manager.getClient().getItemRenderer().renderInGui(matrices, icon, 8, 8);
5558

5659
this.displayed = startTime < 5000L;

0 commit comments

Comments
 (0)