diff options
author | RabbitType99 <luis.be@gmx.de> | 2021-03-09 23:27:30 +0100 |
---|---|---|
committer | RabbitType99 <luis.be@gmx.de> | 2021-03-09 23:27:30 +0100 |
commit | cb5106e11c553108a63b9aa8b44c70a449ef627d (patch) | |
tree | 4a498919931327c7fff10d9891c9551b4181de1b /src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java | |
parent | 87f5d4c76b907da4fb5952e7dff5ebad88b080d8 (diff) | |
parent | e7237307e71c649b4b7c880259ff1781fcc7c435 (diff) | |
download | SkyblockMod-cb5106e11c553108a63b9aa8b44c70a449ef627d.tar.gz SkyblockMod-cb5106e11c553108a63b9aa8b44c70a449ef627d.tar.bz2 SkyblockMod-cb5106e11c553108a63b9aa8b44c70a449ef627d.zip |
Merge branch 'development' into InstallerFrame
# Conflicts:
# build.gradle
Diffstat (limited to 'src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java')
-rw-r--r-- | src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java new file mode 100644 index 0000000..8f15fa7 --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java @@ -0,0 +1,31 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StringUtils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class StartsWithSolver { + + @SubscribeEvent + public void onGuiRender(GuiChestBackgroundDrawnEvent event) { + String displayName = event.displayName; + if (ToggleCommand.startsWithToggled && Utils.inDungeons && displayName.startsWith("What starts with:")) { + char letter = displayName.charAt(displayName.indexOf("'") + 1); + for (Slot slot : event.slots) { + if (slot.inventory == Minecraft.getMinecraft().thePlayer.inventory) continue; + ItemStack item = slot.getStack(); + if (item == null) continue; + if (item.isItemEnchanted()) continue; + if (StringUtils.stripControlCodes(item.getDisplayName()).charAt(0) == letter) { + Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); + } + } + } + } + +} |