aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-16 12:34:18 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-16 12:34:18 +0200
commit4293cfd919c3c93d4532534f722c407d7ad1370d (patch)
treef9f612f021ef7f4283d74312edfaca30badc6749 /src/main/java/at/hannibal2/skyhanni/features
parent538e3ceb76f8e0b590291ce9aa90aa94896cdcb6 (diff)
parent024ba52fb69b6cd44b4e31542867f802de656f15 (diff)
downloadSkyHanni-cum.tar.gz
SkyHanni-cum.tar.bz2
SkyHanni-cum.zip
Merge branch 'beta' into cumcum
# Conflicts: # src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt # src/main/java/at/hannibal2/skyhanni/config/features/AshfangConfig.java
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt54
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOpenPriceWebsite.kt65
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt129
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt39
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/anniversary/ActivePlayerTimer.kt76
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt24
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt70
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreature.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt84
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt35
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt120
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt157
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt41
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt41
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt25
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt83
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt75
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorReward.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt295
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBlockLevelGuideHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt50
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt171
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt83
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PasteIntoSigns.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt25
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt42
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt22
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt24
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ServerRestartTitle.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt60
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt46
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostFormatting.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostUtil.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt146
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/GlowingDroppedItems.kt68
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/Category.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt99
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigOptionGui.kt197
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/FeatureToggleProcessor.kt91
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/FeatureToggleableOption.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/ResetSuggestionState.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/powdertracker/PowderChestReward.kt148
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/powdertracker/PowderTracker.kt356
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GetFromSacksTabComplete.kt45
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/TabComplete.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt40
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/HighlightSlayerMiniBoss.kt52
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerBossSpawnSoon.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt81
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt101
98 files changed, 2856 insertions, 866 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
index d17a3dc6b..dfc69dee8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
@@ -21,6 +21,8 @@ class BazaarApi {
var inBazaarInventory = false
private var currentSearchedItem = ""
+ var currentlyOpenedProduct: NEUInternalName? = null
+
fun getBazaarDataByName(name: String): BazaarData? = NEUItems.getInternalNameOrNull(name)?.getBazaarData()
fun NEUInternalName.getBazaarData() = if (isBazaarItem()) {
@@ -45,6 +47,21 @@ class BazaarApi {
@SubscribeEvent
fun onInventoryOpen(event: InventoryFullyOpenedEvent) {
inBazaarInventory = checkIfInBazaar(event)
+ if (inBazaarInventory) {
+ val openedProduct = getOpenedProduct(event.inventoryItems) ?: return
+ currentlyOpenedProduct = openedProduct
+ BazaarOpenedProductEvent(openedProduct, event).postAndCatch()
+ }
+ }
+
+ private fun getOpenedProduct(inventoryItems: Map<Int, ItemStack>): NEUInternalName? {
+ val buyInstantly = inventoryItems[10] ?: return null
+
+ if (buyInstantly.displayName != "§aBuy Instantly") return null
+ val bazaarItem = inventoryItems[13] ?: return null
+
+ val itemName = bazaarItem.displayName
+ return NEUItems.getInternalNameOrNull(itemName)
}
@SubscribeEvent
@@ -118,5 +135,6 @@ class BazaarApi {
@SubscribeEvent
fun onInventoryClose(event: InventoryCloseEvent) {
inBazaarInventory = false
+ currentlyOpenedProduct = null
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt
index d6145fb63..b42a331fe 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt
@@ -1,16 +1,18 @@
package at.hannibal2.skyhanni.features.bazaar
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.BazaarOpenedProductEvent
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData
+import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getNameWithEnchantment
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NEUItems
+import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
-import net.minecraft.client.gui.inventory.GuiChest
-import net.minecraft.inventory.ContainerChest
+import io.github.moulberry.notenoughupdates.events.SlotClickEvent
+import net.minecraft.item.ItemStack
import net.minecraftforge.client.event.GuiScreenEvent
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -18,40 +20,36 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class BazaarBestSellMethod {
private var display = ""
+ // Working with the last clicked item manually because
+ // the open inventory event happen while the recent clicked item in the inventory is not in the inventory or in the cursor slot
+ private var lastClickedItem: ItemStack? = null
+ private var nextCloseWillResetItem = false
+
@SubscribeEvent
fun onInventoryClose(event: InventoryCloseEvent) {
display = ""
+ if (lastClickedItem != null) {
+ if (nextCloseWillResetItem) {
+ lastClickedItem = null
+ }
+ nextCloseWillResetItem = !nextCloseWillResetItem
+ }
}
@SubscribeEvent
- fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent.Post) {
+ fun onBazaarOpenedProduct(event: BazaarOpenedProductEvent) {
if (!isEnabled()) return
- display = getNewText(event)
+ display = updateDisplay(event.openedProduct)
}
- private fun getNewText(event: GuiScreenEvent.DrawScreenEvent.Post): String {
+ private fun updateDisplay(internalName: NEUInternalName): String {
try {
- if (event.gui !is GuiChest) return ""
- val chest = (event.gui as GuiChest).inventorySlots as ContainerChest
-
- val inv = chest.lowerChestInventory ?: return ""
-
- val buyInstantly = inv.getStackInSlot(10)
- if (buyInstantly == null || buyInstantly.displayName != "§aBuy Instantly") return ""
- val bazaarItem = inv.getStackInSlot(13) ?: return ""
-
- val internalName = NEUItems.getInternalNameOrNull(bazaarItem.displayName) ?: return ""
-
- var having = 0
- for (slot in chest.inventorySlots) {
- if (slot == null) continue
- if (slot.slotNumber == slot.slotIndex) continue
-