Skip to content

Commit

Permalink
Merge branch 'beta' of https://github.com/hannibal002/SkyHanni into i…
Browse files Browse the repository at this point in the history
…tem-stack-size-itemdisplayoverlay
  • Loading branch information
RayDeeUx committed Feb 5, 2024
2 parents 461d7aa + aae0c39 commit 7d2b211
Show file tree
Hide file tree
Showing 20 changed files with 285 additions and 57 deletions.
25 changes: 17 additions & 8 deletions DISCORD_FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ _Frequently Asked Questions_
> Use [Patcher](<https://sk1er.club/mods/patcher>) to have 1.12 hit boxes in 1.8.9.
> **9: Why does my Item Tracker feature not track this item?**
> Check if the item goes directly into your sacks. If it does, enable the sack pickup chat message from Hypixel.
> You can use SkyHanni's own setting to still hide the message from chat.
> 1. Check if the item goes directly into your sacks.
> 2. If it does, enable the sack pickup chat message from Hypixel:
> 3. Go to `hypixel settings --> personal -> chat feedback` and enable `sack notifications`
> 4. If you want the [Sacks] messages to be hidden, do `/sh sacks hider` and enable that
> **10: How do I remove SkyHanni GUI elements?**
> 1. Type `/sh gui`
Expand All @@ -38,10 +40,17 @@ _Frequently Asked Questions_
> 4. Search for that element with /sh name
> 5. Disable this feature
> **11: How do I reset a tracker?**
> To reset a tracker, use the in-game command /shcommands <tracker type>.
> Execute the obtained command to reset the tracker

*This FAQ was last updated on January 7th, 2024.
> **11: How do I reset a SkyHanni tracker?**
> 1. Do you want to **view only the current session**?
> 2. Open the inventory (Press E) and hover over the display.
> 3. Then click on [session].
> 1. Do you want to **remove one specific item** from the tracker?
> 2. Open the inventory (Press E) and hover over the display.
> 3. Then shift-click on an item in the list to remove it.
> 1. Do you want to reset the total stats of a tracker?
> 2. To reset a tracker, use the in-game command /shcommands <tracker type>.
> 3. Execute the obtained command to reset the tracker.

*This FAQ was last updated on February 5th, 2024.
If you believe there's something that should be added to this list, please tell us, so we can add it.*
6 changes: 5 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import at.hannibal2.skyhanni.data.MinecraftData
import at.hannibal2.skyhanni.data.OtherInventoryData
import at.hannibal2.skyhanni.data.OwnInventoryData
import at.hannibal2.skyhanni.data.PartyAPI
import at.hannibal2.skyhanni.data.PetAPI
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.data.PurseAPI
import at.hannibal2.skyhanni.data.RenderData
Expand Down Expand Up @@ -113,10 +114,10 @@ import at.hannibal2.skyhanni.features.event.diana.DianaProfitTracker
import at.hannibal2.skyhanni.features.event.diana.GriffinBurrowHelper
import at.hannibal2.skyhanni.features.event.diana.GriffinBurrowParticleFinder
import at.hannibal2.skyhanni.features.event.diana.GriffinPetWarning
import at.hannibal2.skyhanni.features.event.diana.HighlightInquisitors
import at.hannibal2.skyhanni.features.event.diana.InquisitorWaypointShare
import at.hannibal2.skyhanni.features.event.diana.MythologicalCreatureTracker
import at.hannibal2.skyhanni.features.event.diana.SoopyGuessBurrow
import at.hannibal2.skyhanni.features.event.jerry.HighlightInquisitors
import at.hannibal2.skyhanni.features.event.jerry.HighlightJerries
import at.hannibal2.skyhanni.features.event.jerry.frozentreasure.FrozenTreasureTracker
import at.hannibal2.skyhanni.features.event.lobby.waypoints.christmas.PresentWaypoints
Expand Down Expand Up @@ -223,6 +224,7 @@ import at.hannibal2.skyhanni.features.inventory.tiarelay.TiaRelayWaypoints
import at.hannibal2.skyhanni.features.itemabilities.ChickenHeadTimer
import at.hannibal2.skyhanni.features.itemabilities.FireVeilWandParticles
import at.hannibal2.skyhanni.features.itemabilities.abilitycooldown.ItemAbilityCooldown
import at.hannibal2.skyhanni.features.mining.DeepCavernsParkour
import at.hannibal2.skyhanni.features.mining.HighlightMiningCommissionMobs
import at.hannibal2.skyhanni.features.mining.KingTalismanHelper
import at.hannibal2.skyhanni.features.mining.crystalhollows.CrystalHollowsNamesInCore
Expand Down Expand Up @@ -436,9 +438,11 @@ class SkyHanniMod {
loadModule(AdvancedPlayerList)
loadModule(ItemAddManager())
loadModule(BingoCardReader())
loadModule(DeepCavernsParkour())
loadModule(GardenBestCropTime())
loadModule(TrackerManager)
loadModule(UtilsPatterns)
loadModule(PetAPI)

// APIs
loadModule(BazaarApi())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public String toString() {
@FeatureToggle
public boolean highlightVisitors = false;


@Expose
@ConfigOption(
name = "Block Interacting with Visitors",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package at.hannibal2.skyhanni.config.features.mining;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorColour;
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.observer.Property;

public class DeepCavernsParkourConfig {

@Expose
@ConfigOption(name = "Enabled", desc = "Shows a parkour to the bottom of Deep Caverns and to Rhys.")
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = true;

@Expose
@ConfigOption(name = "Look Ahead", desc = "Change how many waypoints should be shown in front of you.")
@ConfigEditorSlider(minStep = 1, maxValue = 30, minValue = 1)
public Property<Integer> lookAhead = Property.of(3);

@Expose
@ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.")
@ConfigEditorBoolean
public Property<Boolean> rainbowColor = Property.of(true);

@Expose
@ConfigOption(name = "Monochrome Color", desc = "Set a boring monochrome color for the parkour platforms.")
@ConfigEditorColour
public Property<String> monochromeColor = Property.of("0:60:0:0:255");

@Expose
@ConfigOption(name = "Hilight all Lines", desc = "Show all lines in gray. Useful for debugging.")
@ConfigEditorBoolean
public boolean highlightAllLines = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public class MiningConfig {
@Accordion
public KingTalismanConfig kingTalisman = new KingTalismanConfig();

@Expose
@ConfigOption(name = "Deep Caverns Parkour", desc = "")
@Accordion
public DeepCavernsParkourConfig deepCavernsParkour = new DeepCavernsParkourConfig();

@Expose
@ConfigOption(name = "Highlight Commission Mobs", desc = "Highlight Mobs that are part of active commissions.")
@ConfigEditorBoolean
Expand Down
19 changes: 11 additions & 8 deletions src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement
import net.minecraft.network.play.client.C0APacketAnimation
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.InputEvent
import org.lwjgl.input.Mouse

class ItemClickData {

Expand All @@ -39,20 +38,24 @@ class ItemClickData {
}

@SubscribeEvent
fun onEntityClick(event: InputEvent.MouseInputEvent) {
fun onEntityClick(event: InputEvent) {
if (!LorenzUtils.inSkyBlock) return

val minecraft = Minecraft.getMinecraft()
val clickedEntity = minecraft.pointedEntity
if (minecraft.thePlayer == null) return
if (clickedEntity == null) return

val clickType = when (Mouse.getEventButton()) {
0 -> ClickType.LEFT_CLICK
1 -> ClickType.RIGHT_CLICK
val attackKey = minecraft.gameSettings.keyBindAttack
val useKey = minecraft.gameSettings.keyBindUseItem

val clickType = when {
attackKey.isKeyDown -> ClickType.LEFT_CLICK
useKey.isKeyDown -> ClickType.RIGHT_CLICK
else -> return
}

val clickedEntity = minecraft.pointedEntity
if (minecraft.thePlayer == null) return
if (clickedEntity == null) return

EntityClickEvent(clickType, clickedEntity).postAndCatch()
}
}
9 changes: 9 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
package at.hannibal2.skyhanni.data

import at.hannibal2.skyhanni.utils.StringUtils.matches
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern

object PetAPI {
private val petMenuPattern by RepoPattern.pattern(
"misc.pet.menu.title",
"Pets(?: \\(\\d+/\\d+\\) )?"
)

fun isPetMenu(inventoryTitle: String): Boolean = petMenuPattern.matches(inventoryTitle)

// Contains color code + name and for older SkyHanni users maybe also the pet level
var currentPet: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ class CosmeticFollowingLine {
val last7 = locations.keys.toList().takeLast(7)
val last2 = locations.keys.toList().takeLast(2)

for ((a, b) in locations.keys.zipWithNext()) {
locations.keys.zipWithNext { a, b ->
val locationSpot = locations[b]!!
if (firstPerson && !locationSpot.onGround && b in last7) {
// Do not render the line in the face, keep more distance while the line is in the air
continue
return
}
if (b in last2 && locationSpot.time.passedSince() < 400.milliseconds) {
// Do not render the line directly next to the player, prevent laggy design
continue
return
}
event.draw3DLine(a, b, color, locationSpot.getWidth(), !config.behindBlocks)
}
Expand All @@ -81,7 +81,8 @@ class CosmeticFollowingLine {
private fun renderClose(event: LorenzRenderWorldEvent, firstPerson: Boolean, color: Color) {
if (firstPerson && latestLocations.any { !it.value.onGround }) return

for ((a, b) in latestLocations.keys.zipWithNext()) {

latestLocations.keys.zipWithNext { a, b ->
val locationSpot = latestLocations[b]!!
event.draw3DLine(a, b, color, locationSpot.getWidth(), !config.behindBlocks)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ object GriffinBurrowHelper {
DelayedRun.runDelayed(1.seconds) {
if (BurrowAPI.lastBurrowRelatedChatMessage.passedSince() > 2.seconds) {
if (particleBurrows.containsKey(location)) {
LorenzUtils.error("Something unexected happened, deleted the burrow.")
// workaround
particleBurrows = particleBurrows.editCopy { keys.remove(location) }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.features.event.diana.DianaAPI.isDianaSpade
import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.TimeLimitedSet
Expand Down Expand Up @@ -169,7 +168,6 @@ class GriffinBurrowParticleFinder {
if (location == fakeBurrow) {
fakeBurrow = null
// This exist to detect the unlucky timing when the user opens a burrow before it gets fully deteced
LorenzUtils.chat("§dYou found a rare burrow bug. SkyHanni can auto fix it, though.")
tryDig(location, ignoreFound = true)
return
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package at.hannibal2.skyhanni.features.event.jerry
package at.hannibal2.skyhanni.features.event.diana

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.withAlpha
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.garden.fortuneguide

import at.hannibal2.skyhanni.config.Storage
import at.hannibal2.skyhanni.data.PetAPI
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.GardenToolChangeEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
Expand Down Expand Up @@ -127,9 +128,12 @@ class CaptureFarmingGear {
val farmingItems = farmingItems ?: return
val outdatedItems = outdatedItems ?: return
val items = event.inventoryItems
if (PetAPI.isPetMenu(event.inventoryName)) {
pets(farmingItems, items, outdatedItems)
return
}
when (event.inventoryName) {
"Your Equipment and Stats" -> equipmentAndStats(items, farmingItems, outdatedItems)
"Pets" -> pets(farmingItems, items, outdatedItems)
"Your Skills" -> skills(items, storage)
"Community Shop" -> communityShop(items)
"Configure Plots" -> configurePlots(items, storage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent
import io.github.moulberry.notenoughupdates.events.SlotClickEvent
import io.github.moulberry.notenoughupdates.util.Utils
Expand All @@ -18,8 +19,15 @@ class GardenDeskInSBMenu {
private var showItem = false

private val item by lazy {
val neuItem = NEUItems.getItemStack("DOUBLE_PLANT")
Utils.createItemStack(neuItem.item, "§bDesk", "§7Click here to", "§7run §e/desk")
val neuItem = "DOUBLE_PLANT".asInternalName().getItemStack()
Utils.createItemStack(
neuItem.item,
"§bOpen Desk",
"§8(From SkyHanni)",
"",
"§7Click here to",
"§7run §e/desk"
)
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.InventoryOpenEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.garden.visitor.VisitorOpenEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.LocationUtils.distanceTo
Expand All @@ -29,6 +30,7 @@ object NPCVisitorFix {

@SubscribeEvent
fun onInventoryOpen(event: InventoryOpenEvent) {
if (!GardenAPI.inGarden()) return
val name = staticVisitors.firstOrNull { event.inventoryName.contains(it) } ?: return
val nearest = findNametags(name).firstOrNull { it.distanceToPlayer() < 3 } ?: return
DelayedRun.runDelayed(200.milliseconds) {
Expand Down
Loading

0 comments on commit 7d2b211

Please sign in to comment.