From 9b0f50232080853c6584b738d8aec89a676840bd Mon Sep 17 00:00:00 2001 From: Rime <81419447+Emirlol@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:49:50 +0300 Subject: [PATCH] Fix NewYearCakeAdder and change its color as well --- .../skyblock/item/slottext/adders/NewYearCakeAdder.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java index a218f0eae0..f81c0df8cf 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java @@ -4,6 +4,7 @@ import de.hysky.skyblocker.skyblock.item.slottext.SlotText; import de.hysky.skyblocker.utils.ItemUtils; import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; import net.minecraft.screen.slot.Slot; import net.minecraft.text.Text; import org.jetbrains.annotations.NotNull; @@ -14,9 +15,9 @@ public class NewYearCakeAdder extends SimpleSlotTextAdder { @Override public @NotNull List getText(@Nullable Slot slot, @NotNull ItemStack stack, int slotId) { - if (stack.getSkyblockId().equals("NEW_YEAR_CAKE")) { - return SlotText.bottomLeftList(Text.literal(String.valueOf(ItemUtils.getCustomData(stack).getInt("new_years_cake"))).withColor(0xCBA6F7)); - } - return List.of(); + if (!stack.isOf(Items.CAKE)) return List.of(); + int year = ItemUtils.getCustomData(stack).getInt("new_years_cake"); + if (year <= 0) return List.of(); + return SlotText.bottomLeftList(Text.literal(String.valueOf(year)).withColor(0x74c7ec)); } }