diff --git a/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt b/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt index 66ca5e9d051b..e2a1be42bc8c 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt @@ -224,7 +224,7 @@ enum class TabWidget( ), REPUTATION( // language=RegExp - "(?:§.)*(Barbarian|Mage) Reputation:", + "(?:§.)*(?Barbarian|Mage) Reputation:", ), FACTION_QUESTS( // language=RegExp diff --git a/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt index 4c185123e149..84042c8044e5 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt @@ -73,13 +73,11 @@ abstract class GuiContainerEvent(open val gui: GuiContainer, open val container: val slot: Slot?, val slotId: Int, val clickedButton: Int, - @Deprecated("old", ReplaceWith("clickTypeEnum")) - val clickType: Int, - val clickTypeEnum: ClickType? = ClickType.getTypeById(clickType), + val clickType: ClickType?, ) : GuiContainerEvent(gui, container), Cancellable { fun makePickblock() { - if (this.clickedButton == 2 && this.clickTypeEnum == ClickType.MIDDLE) return + if (this.clickedButton == 2 && this.clickType == ClickType.MIDDLE) return slot?.slotNumber?.let { slotNumber -> InventoryUtils.clickSlot(slotNumber, container.windowId, 2, 3) cancel() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt index 5819e6033594..80c528bdda69 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt @@ -72,7 +72,7 @@ object VisitorRewardWarning { } // all but shift click types work for accepting visitor - if (event.clickTypeEnum == GuiContainerEvent.ClickType.SHIFT) return + if (event.clickType == GuiContainerEvent.ClickType.SHIFT) return if (isRefuseSlot) { VisitorAPI.changeStatus(visitor, VisitorAPI.VisitorStatus.REFUSED, "refused") // fallback if tab list is disabled diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt index f76a0de8d174..d759107ff53a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -158,7 +158,7 @@ object HarpFeatures { if (isHarpGui(InventoryUtils.openInventoryName())) { if (config.keybinds) { // needed to not send duplicate clicks via keybind feature - if (event.clickTypeEnum == GuiContainerEvent.ClickType.HOTBAR) { + if (event.clickType == GuiContainerEvent.ClickType.HOTBAR) { event.cancel() return } @@ -172,8 +172,9 @@ object HarpFeatures { event.container.inventory.filterNotNull().indexOfFirst { songSelectedPattern.anyMatches(it.getLore()) }.takeIf { it != -1 }?.let { + val clickType = event.clickType?.id ?: return event.cancel() - InventoryUtils.clickSlot(it, event.container.windowId, event.clickedButton, event.clickType) + InventoryUtils.clickSlot(it, event.container.windowId, event.clickedButton, clickType) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt index a33e7f45390e..e5601fbd2df0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt @@ -100,7 +100,7 @@ object ChocolateFactoryInventory { ) return // this would break ChocolateFactoryKeybinds otherwise - if (event.clickTypeEnum == GuiContainerEvent.ClickType.HOTBAR) return + if (event.clickType == GuiContainerEvent.ClickType.HOTBAR) return // if the user is holding shift, we don't want to pickblock, handled by hypixel as +10 levels for rabbits if (KeyboardManager.isShiftKeyDown() && slotNumber in ChocolateFactoryAPI.rabbitSlots.keys) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt index c498e66be1fd..218d7a42eb3f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt @@ -44,7 +44,7 @@ object ChocolateFactoryKeybinds { if (!ChocolateFactoryAPI.inChocolateFactory) return // needed to not send duplicate clicks via keybind feature - if (event.clickTypeEnum == GuiContainerEvent.ClickType.HOTBAR) { + if (event.clickType == GuiContainerEvent.ClickType.HOTBAR) { event.cancel() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index 71b920d9de22..07cc255c1602 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -7,25 +7,27 @@ import at.hannibal2.skyhanni.config.features.crimsonisle.ReputationHelperConfig. import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.jsonobjects.repo.CrimsonIsleReputationJson +import at.hannibal2.skyhanni.data.model.TabWidget import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.SackChangeEvent +import at.hannibal2.skyhanni.events.WidgetUpdateEvent import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.DailyQuestHelper import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.QuestLoader import at.hannibal2.skyhanni.features.nether.reputationhelper.kuudra.DailyKuudraBossHelper import at.hannibal2.skyhanni.features.nether.reputationhelper.miniboss.DailyMiniBossHelper import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList +import at.hannibal2.skyhanni.utils.CollectionUtils.addString import at.hannibal2.skyhanni.utils.ConditionalUtils.afterChange import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems -import at.hannibal2.skyhanni.utils.TabListData +import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables +import at.hannibal2.skyhanni.utils.renderables.Renderable import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiInventory @@ -39,9 +41,9 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { val miniBossHelper = DailyMiniBossHelper(this) val kuudraBossHelper = DailyKuudraBossHelper(this) - var factionType = FactionType.NONE + var factionType: FactionType? = null - private var display = emptyList>() + private var display = emptyList() private var dirty = true var tabListQuestsMissing = false @@ -94,6 +96,15 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { dirty = true } + @HandleEvent + fun onWidgetUpdate(event: WidgetUpdateEvent) { + if (!event.isWidget(TabWidget.REPUTATION)) return + + TabWidget.REPUTATION.matchMatcherFirstLine { + factionType = FactionType.fromName(group("faction")) + } + } + @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!IslandType.CRIMSON_ISLE.isInIsland()) return @@ -105,39 +116,31 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { dirty = false updateRender() } - - if (event.repeatSeconds(3)) { - val list = TabListData.getTabList().filter { it.contains("Reputation:") } - for (line in list) { - factionType = if (line.contains("Mage")) { - FactionType.MAGE - } else if (line.contains("Barbarian")) { - FactionType.BARBARIAN - } else { - FactionType.NONE - } - } - } } private fun updateRender() { - val newList = mutableListOf>() - - // TODO test - if (factionType == FactionType.NONE) return - - newList.addAsSingletonList("§e§lReputation Helper") - if (tabListQuestsMissing) { - newList.addAsSingletonList("§cFaction Quests Widget not found!") - newList.addAsSingletonList("§7Open §e/tab §7and enable it!") - } else { - questHelper.render(newList) - miniBossHelper.render(newList) - kuudraBossHelper.render(newList) - } - + display = buildList { + addString("§e§lReputation Helper") + if (factionType == null) { + addString("§cFaction not found!") + return + } - display = newList + if (tabListQuestsMissing) { + addString("§cFaction Quests Widget not found!") + addString("§7Open §e/tab §7and enable it!") + } else { + questHelper.run { + addQuests() + } + miniBossHelper.run { + addDailyMiniBoss() + } + kuudraBossHelper.run { + addKuudraBoss() + } + } + } } @HandleEvent(priority = HandleEvent.LOWEST) @@ -149,7 +152,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { return } - config.position.renderStringsAndItems( + config.position.renderRenderables( display, posLabel = "Crimson Isle Reputation Helper", ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/FactionType.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/FactionType.kt index d531aa8f4996..26cf373a48ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/FactionType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/FactionType.kt @@ -1,8 +1,11 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper -enum class FactionType { - BARBARIAN, - MAGE, +enum class FactionType(val factionName: String) { + BARBARIAN("Barbarian"), + MAGE("Mage"), + ; - NONE + companion object { + fun fromName(name: String) = entries.firstOrNull { it.factionName.equals(name, ignoreCase = true) } + } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index 2aaa6f62b6f1..01c35a808a5c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -29,7 +29,8 @@ import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.T import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.UnknownQuest import at.hannibal2.skyhanni.features.nether.reputationhelper.miniboss.CrimsonMiniBoss import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList +import at.hannibal2.skyhanni.utils.CollectionUtils.addItemStack +import at.hannibal2.skyhanni.utils.CollectionUtils.addString import at.hannibal2.skyhanni.utils.ConditionalUtils import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName @@ -45,6 +46,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.RenderUtils.highlight import at.hannibal2.skyhanni.utils.StringUtils.removeWordsAtEnd +import at.hannibal2.skyhanni.utils.renderables.Renderable import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.ContainerChest @@ -213,11 +215,9 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { private fun renderTownBoard(event: LorenzRenderWorldEvent) { if (!quests.any { it.needsTownBoardLocation() }) return - val location = when (reputationHelper.factionType) { + val location = when (reputationHelper.factionType ?: return) { FactionType.BARBARIAN -> townBoardBarbarian FactionType.MAGE -> townBoardMage - - FactionType.NONE -> return } event.drawWaypointFilled(location, LorenzColor.WHITE.toColor()) event.drawDynamicText(location, "Town Board", 1.5) @@ -227,23 +227,23 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { state == QuestState.READY_TO_COLLECT || (this is RescueMissionQuest && state == QuestState.ACCEPTED) } - fun render(display: MutableList>) { + fun MutableList.addQuests() { if (greatSpook) { - display.addAsSingletonList("") - display.addAsSingletonList("§7Daily Quests (§cdisabled§7)") - display.addAsSingletonList(" §5§lThe Great Spook §7happened :O") + addString("") + addString("§7Daily Quests (§cdisabled§7)") + addString(" §5§lThe Great Spook §7happened :O") return } val done = quests.count { it.state == QuestState.COLLECTED } - display.addAsSingletonList("") - display.addAsSingletonList("§7Daily Quests (§e$done§8/§e5 collected§7)") + addString("") + addString("§7Daily Quests (§e$done§8/§e5 collected§7)") if (done != 5) { val filteredQuests = quests.filter { !config.hideComplete.get() || it.state != QuestState.COLLECTED } - filteredQuests.mapTo(display) { renderQuest(it) } + addAll(filteredQuests.map { renderQuest(it) }) } } - private fun renderQuest(quest: Quest): List { + private fun renderQuest(quest: Quest): Renderable { val category = quest.category val state = quest.state.displayName val stateColor = quest.state.color @@ -275,7 +275,6 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { "" } - val result = mutableListOf() val item = quest.displayItem.getItemStack() val displayName = if (category == QuestCategory.FETCH || category == QuestCategory.FISHING) { @@ -287,10 +286,13 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { val categoryName = category.displayName - result.add(" $stateText$categoryName: ") - result.add(item) - result.add("§f$displayName$progressText$sacksText") - return result + return Renderable.horizontalContainer( + buildList { + addString(" $stateText$categoryName: ") + addItemStack(item) + addString("§f$displayName$progressText$sacksText") + }, + ) } fun finishMiniBoss(miniBoss: CrimsonMiniBoss) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt index ed9e6ebc2421..e34b2bfee4e2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt @@ -10,13 +10,15 @@ import at.hannibal2.skyhanni.events.kuudra.KuudraCompleteEvent import at.hannibal2.skyhanni.features.nether.kuudra.KuudraTier import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList +import at.hannibal2.skyhanni.utils.CollectionUtils.addItemStack +import at.hannibal2.skyhanni.utils.CollectionUtils.addString import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NEUItems.getItemStack import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled +import at.hannibal2.skyhanni.utils.renderables.Renderable import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationHelper) { @@ -52,21 +54,25 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH reputationHelper.update() } - fun render(display: MutableList>) { + fun MutableList.addKuudraBoss() { val done = kuudraTiers.count { it.doneToday } - display.addAsSingletonList("") - display.addAsSingletonList("§7Daily Kuudra (§e$done§8/§e5 killed§7)") + addString("") + addString("§7Daily Kuudra (§e$done§8/§e5 killed§7)") if (done < 5) { for (tier in kuudraTiers) { if (config.hideComplete.get() && tier.doneToday) continue val result = if (tier.doneToday) "§aDone" else "§bTodo" val displayName = tier.getDisplayName() val displayItem = tier.displayItem - val lineList = mutableListOf() - lineList.add(" ") - lineList.add(displayItem.getItemStack()) - lineList.add("$displayName: $result") - display.add(lineList) + + val row = Renderable.horizontalContainer( + buildList { + addString(" ") + addItemStack(displayItem.getItemStack()) + addString("$displayName: $result") + }, + ) + add(row) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt index e2376ca196dd..5a25faf61098 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt @@ -10,7 +10,8 @@ import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorMana import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.MiniBossQuest import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.QuestState -import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList +import at.hannibal2.skyhanni.utils.CollectionUtils.addItemStack +import at.hannibal2.skyhanni.utils.CollectionUtils.addString import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland @@ -18,6 +19,7 @@ import at.hannibal2.skyhanni.utils.NEUItems.getItemStack import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled +import at.hannibal2.skyhanni.utils.renderables.Renderable import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHelper) { @@ -64,10 +66,12 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel reputationHelper.update() } - fun render(display: MutableList>) { + fun MutableList.addDailyMiniBoss() { val done = miniBosses.count { it.doneToday } - display.addAsSingletonList("") - display.addAsSingletonList("§7Daily Bosses (§e$done§8/§e5 killed§7)") + + addString("") + addString("§7Daily Bosses (§e$done§8/§e5 killed§7)") + if (done != 5) { for (miniBoss in miniBosses) { if (config.hideComplete.get() && miniBoss.doneToday) continue @@ -75,11 +79,14 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel val displayName = miniBoss.displayName val displayItem = miniBoss.displayItem - val lineList = mutableListOf() - lineList.add(" ") - lineList.add(displayItem.getItemStack()) - lineList.add("§5$displayName§7: $result") - display.add(lineList) + val row = Renderable.horizontalContainer( + buildList { + addString(" ") + addItemStack(displayItem.getItemStack()) + addString("§5$displayName§7: $result") + }, + ) + add(row) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt index 0f443f47592a..c752e83b7a80 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.mixins.hooks import at.hannibal2.skyhanni.data.GuiData import at.hannibal2.skyhanni.events.DrawScreenAfterEvent import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.events.GuiContainerEvent.ClickType import at.hannibal2.skyhanni.events.GuiContainerEvent.CloseWindowEvent import at.hannibal2.skyhanni.events.GuiContainerEvent.SlotClickEvent import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests @@ -68,7 +69,7 @@ class GuiContainerHook(guiAny: Any) { fun onMouseClick(slot: Slot?, slotId: Int, clickedButton: Int, clickType: Int, ci: CallbackInfo) { val item = gui.inventorySlots?.inventory?.takeIf { it.size > slotId && slotId >= 0 }?.get(slotId) - if (SlotClickEvent(gui, gui.inventorySlots, item, slot, slotId, clickedButton, clickType).post() + if (SlotClickEvent(gui, gui.inventorySlots, item, slot, slotId, clickedButton, ClickType.getTypeById(clickType)).post() ) ci.cancel() }