aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features/HidePetCandy.java
blob: 8ef28d27d23208a85eb109bd8827ca5ffba5343a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package me.Danker.features;

import me.Danker.commands.ToggleCommand;
import me.Danker.utils.Utils;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class HidePetCandy {

    @SubscribeEvent
    public void onTooltip(ItemTooltipEvent event) {
        if (!Utils.inSkyblock) return;
        if (event.toolTip == null) return;

        if (ToggleCommand.hidePetCandy) {
            for (int i = 0; i < event.toolTip.size(); i++) {
                if (event.toolTip.get(i).endsWith("Pet Candy Used")) {
                    event.toolTip.remove(i);
                    event.toolTip.remove(i);
                    break;
                }
            }
        }
    }

}