diff options
author | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-03 19:59:46 +0200 |
---|---|---|
committer | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-03 19:59:46 +0200 |
commit | 09291c4f8ee992d2b1c037dfeac84ee362e6288e (patch) | |
tree | e7ae4675068672d24e012cca0d66ac07ad0f7dc8 /src/main/java/me/Danker/features | |
parent | df1f83cf4ddb80969d2086cf1d7a86df9dc90653 (diff) | |
download | SkyblockMod-09291c4f8ee992d2b1c037dfeac84ee362e6288e.tar.gz SkyblockMod-09291c4f8ee992d2b1c037dfeac84ee362e6288e.tar.bz2 SkyblockMod-09291c4f8ee992d2b1c037dfeac84ee362e6288e.zip |
added Completed Commission Highlighting
Diffstat (limited to 'src/main/java/me/Danker/features')
-rw-r--r-- | src/main/java/me/Danker/features/HighlightCommissions.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java new file mode 100644 index 0000000..ae262c3 --- /dev/null +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -0,0 +1,37 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.item.ItemWritableBook; + +import org.lwjgl.util.Color; +import java.util.List; + +public class HighlightCommissions { + + @SubscribeEvent + public void onGuiRender(GuiChestBackgroundDrawnEvent event) { + if(!Utils.inSkyblock) return; + if(!ToggleCommand.highlightCommissions) return; + List<Slot> slots = event.slots; + if (!event.displayName.equals("Commissions")) return; + + for (Slot slot : slots) { + if (slot != null && slot.getStack() == null) continue; + if (slot.getStack().getItem() instanceof ItemWritableBook) { + for (String line : Utils.getItemLore(slot.getStack())) { + if (line.contains("COMPLETED")) { + Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0x51FF51 + 0xD7000000); + break; + } + } + + } + } + } + +} |