Skip to content

Commit

Permalink
Fix NewYearCakeAdder and change its color as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Emirlol committed Oct 21, 2024
1 parent 8ae2271 commit 9b0f502
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -14,9 +15,9 @@
public class NewYearCakeAdder extends SimpleSlotTextAdder {
@Override
public @NotNull List<SlotText> 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));
}
}

0 comments on commit 9b0f502

Please sign in to comment.