Skip to content

Commit

Permalink
Merge branch 'hannibal002:beta' into customscoreboard
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 authored Nov 20, 2023
2 parents e5cd299 + 94ab85f commit 33f0223
Show file tree
Hide file tree
Showing 18 changed files with 202 additions and 119 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,36 @@

## Version 0.21.1 (unreleased)


### New Features

+ Organised the config into sub categories. - nea & walker
+ Wrong crop milestone step detection. - hannibal2
+ When opening the crop milestone menu, a chat message is sent if Hypixel's crops per milestone level data is
different from SkyHanni's.
+ You can use this to share your hypixel data with SkyHanni via the discord.
+ This will allow us to fix the crop milestone features quicker, as we currently do not have accurate data for this.
+ If you don't want to share anything, you can disable the chat message in the config with /sh copy milestone data.

### Changes


#### Garden Changes

+ Added mythic/Maeve visitor support. - walker & hannibal2
+ Added option to use custom Blocks per Second value in some Garden GUIs instead of the real one. - hannibal2
+ Added option to change the item scale of SkyMart Coins per Copper list. - hannibal2
+ Added support for Sunder 6 in /ff upgrades. - hannibal2
+ Added support for mythic in Visitor Drop Statistics. - hannibal2
+ Use the crop fortune from tab in Farming Fortune HUD. - alexia
+ Shows the last saved ff value in gray while switching tools instead of the question mark. - hannibal2
+ Removed chat message that your crop milestone data is correct. - hannibal2

#### Other Changes

+ Added guess seconds to the Visitor Timer when the tab list doesn't show seconds. - hannibal2
+ Add option to hide the chat message when toggling /shmouselock. - hannibal2
+ Reminds to use the GUI Position Editor hotkey. - hannibal2
+ Reminds every 30 minutes after using /sh gui or clicking the GUI edit button.

### Fixes

Expand All @@ -36,6 +47,11 @@
+ Fixed Farming Contest Medal Icons in Inventory not showing. - hannibal2
+ Fixed /ff not detecting collection analyst fortune. - hannibal2
+ Fixed Mushroom Cow Perk display not working. - hannibal2
+ Fixed visitor timer error if the visitors aren't unlocked yet. - hannibal2
+ Fixed farming weight no longer updating on block breaking. - hannibal2
+ Added cooldown to prevent spam clicking on farming weight buttons to open many web pages. - hannibal2
+ Fixed clickable farming weight GUI no longer opens #1000 in lb website. - hannibal2
+ Fixed /ff upgrade suggests updating bustling reforge even when no farming armor is found. - hannibal2

#### Other Fixes

Expand All @@ -46,6 +62,8 @@
+ Fixed Archfiend Dice and High Class Archfiend Dice counting as slayer drops when rolled. - hannibal2
+ Fixed dice roll profit counting as Mob Kill Coins in Slayer Tracker. - hannibal2
+ Fixed Sack Display sometimes not formatting a million correctly. - Hize
+ Fixed Estimated Item Value getting shown in stats breakdown menu. - hannibal2
+ Fixed a bug with the ender chest and SkyHanni GUI editor. - hannibal2

### Technical Details

Expand All @@ -56,6 +74,11 @@
+ Extracted sacks, friends, known features and Jacob contests in to their separate files. - CalMWolfs
+ Add log clearing. - CalMWolfs
+ Add auto-prefix to chat message methods. - walker
+ Added support for extra data in error manager. - hannibal2
+ Added /readcropmilestonefromclipboard. - hannibal2
+ This command reads the clipboard content, in the format of users sending crop milestone step data.
+ The new data gets compared to the currently saved data, differences are getting replaced and the result gets put
into the clipboard. The clipboard context can be used to update the repo content.

## Version 0.21

Expand Down
7 changes: 7 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@ Use `/sh` or `/skyhanni` to open the SkyHanni config in game.
+ Highlights Visitors outside the Garden.
+ Block Interacting with Visitors. - nea
+ Blocks you from interacting with / unlocking Visitors to allow for Dedication Cycling.
+ Wrong crop milestone step detection. - hannibal2
+ When opening the crop milestone menu, a chat message is sent if Hypixel's crops per milestone level data is
different from SkyHanni's.
+ You can use this to share your hypixel data with SkyHanni via the discord.
+ This will allow us to fix the crop milestone features quicker, as we currently do not have accurate data for this.
+ If you don't want to share anything, you can disable the chat message in the config with /sh copy milestone data.

</details>
<details open><summary>

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "at.hannibal2.skyhanni"
version = "0.21.1.Beta.4"
version = "0.21.1.Beta.6"

// Toolchains:
java {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ import org.apache.logging.log4j.Logger
clientSideOnly = true,
useMetadata = true,
guiFactory = "at.hannibal2.skyhanni.config.ConfigGuiForgeInterop",
version = "0.21.1.Beta.4",
version = "0.21.1.Beta.6",
)
class SkyHanniMod {
@Mod.EventHandler
Expand Down Expand Up @@ -680,6 +680,7 @@ class SkyHanniMod {
if (screenToOpen != null) {
screenTicks++
if (screenTicks == 5) {
Minecraft.getMinecraft().thePlayer.closeScreen()
Minecraft.getMinecraft().displayGuiScreen(screenToOpen)
screenTicks = 0
screenToOpen = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object Commands {
private val openMainMenu: (Array<String>) -> Unit = {
if (it.isNotEmpty()) {
if (it[0].lowercase() == "gui") {
GuiEditManager.openGuiPositionEditor()
GuiEditManager.openGuiPositionEditor(hotkeyReminder = true)
} else {
ConfigGuiManager.openConfigGui(it.joinToString(" "))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ public class EliteFarmingWeightConfig {
public boolean overtakeETA = false;

@Expose
@ConfigOption(name = "Offscreen Drop Message", desc = "Show a chat message when joining Garden how many spots you have dropped since last Garden join.")
@ConfigOption(name = "Show LB Change", desc = "Show the change of your position in the farming weight leaderboard while you were offline.")
@ConfigEditorBoolean
// TODO migrate
public boolean offScreenDropMessage = true;

@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class GUIConfig {

@ConfigOption(name = "Edit GUI Locations", desc = "Change the position of SkyHanni's overlays.")
@ConfigEditorButton(buttonText = "Edit")
public Runnable positions = GuiEditManager::openGuiPositionEditor;
public Runnable positions = () -> GuiEditManager.openGuiPositionEditor(true);

@Expose
@ConfigOption(name = "Open Hotkey", desc = "Press this key to open the GUI Editor.")
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesFix.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ object GardenCropMilestonesFix {
LorenzUtils.chat(
"Found §c${data.size} §ewrong crop milestone steps in the menu! " +
"Correct data got put into clipboard. " +
"Please share it on SkyHanni Discord."
"Please share it on the §bSkyHanni Discord §ein the channel §b#share-data§e."
)
OSUtils.copyToClipboard("```${data.joinToString("\n")}```")
} else {
LorenzUtils.chat("No wrong crop milestone steps found!")
// } else {
// LorenzUtils.chat("No wrong crop milestone steps found!")
}
}

Expand All @@ -62,39 +62,39 @@ object GardenCropMilestonesFix {
val next = lore.nextAfter({ GardenCropMilestones.totalPattern.matches(it) }, 3) ?: return
val total = lore.nextAfter({ GardenCropMilestones.totalPattern.matches(it) }, 6) ?: return

debug(" ")
debug("crop: $crop")
debug("realTier: $realTier")
// debug(" ")
// debug("crop: $crop")
// debug("realTier: $realTier")

val guessNextMax = GardenCropMilestones.getCropsForTier(
realTier + 1,
crop
) - GardenCropMilestones.getCropsForTier(realTier, crop)
debug("guessNextMax: ${guessNextMax.addSeparators()}")
// debug("guessNextMax: ${guessNextMax.addSeparators()}")
val nextMax = pattern.matchMatcher(next) {
group("max").formatNumber()
} ?: return
debug("nextMax real: ${nextMax.addSeparators()}")
// debug("nextMax real: ${nextMax.addSeparators()}")
if (nextMax != guessNextMax) {
debug("wrong, add to list")
// debug("wrong, add to list")
wrongData.add("$crop:$realTier:${nextMax.addSeparators()}")
}

val guessTotalMax = GardenCropMilestones.getCropsForTier(46, crop)
// println("guessTotalMax: ${guessTotalMax.addSeparators()}")
// println("guessTotalMax: ${guessTotalMax.addSeparators()}")
val totalMax = pattern.matchMatcher(total) {
group("max").formatNumber()
} ?: return
// println("totalMax real: ${totalMax.addSeparators()}")
// println("totalMax real: ${totalMax.addSeparators()}")
val totalOffBy = guessTotalMax - totalMax
debug("totalOffBy: $totalOffBy")
// debug("$crop total offf by: ${totalOffBy.addSeparators()}")
}

fun debug(message: String) {
if (SkyHanniMod.feature.dev.debug.enabled) {
// fun debug(message: String) {
// if (SkyHanniMod.feature.dev.debug.enabled) {
// println(message)
}
}
// }
// }

/**
* This helps to fix wrong crop milestone data
Expand Down
22 changes: 20 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isRancherSign
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
Expand All @@ -18,8 +19,13 @@ import net.minecraft.client.renderer.GlStateManager
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.UUID
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.minutes

class GuiEditManager {

var lastHotkeyPressed = SimpleTimeMark.farPast()

@SubscribeEvent
fun onKeyClick(event: LorenzKeyPressEvent) {
if (!LorenzUtils.inSkyBlock) return
Expand All @@ -31,9 +37,11 @@ class GuiEditManager {
if (it is GuiEditSign && !it.isRancherSign()) return
}

if (lastHotkeyPressed.passedSince() < 500.milliseconds) return
if (NEUItems.neuHasFocus()) return
lastHotkeyPressed = SimpleTimeMark.now()

openGuiPositionEditor()
openGuiPositionEditor(hotkeyReminder = false)
}

@SubscribeEvent(priority = EventPriority.LOWEST)
Expand All @@ -60,9 +68,19 @@ class GuiEditManager {
}
}

private var lastHotkeyReminded = SimpleTimeMark.farPast()

@JvmStatic
fun openGuiPositionEditor() {
fun openGuiPositionEditor(hotkeyReminder: Boolean) {
SkyHanniMod.screenToOpen = GuiPositionEditor(latestPositions.values.toList(), 2)
if (hotkeyReminder && lastHotkeyReminded.passedSince() > 30.minutes) {
lastHotkeyReminded = SimpleTimeMark.now()
LorenzUtils.chat(
"§eTo edit hidden GUI elements:\n" +
" §7- §e1. Set a key in /sh edit.\n" +
" §7- §e2. Click that key while the GUI element is visible."
)
}
}

@JvmStatic
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.OwnInventoryItemUpdateEvent
import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.events.entity.ItemAddInInventoryEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
Expand Down Expand Up @@ -30,9 +31,17 @@ class OwnInventoryData {
fun onChatPacket(event: PacketEvent.ReceiveEvent) {
if (!LorenzUtils.inSkyBlock) return

if (event.packet.let { it is S2FPacketSetSlot || it is S0DPacketCollectItem }) {
val packet = event.packet
if (packet is S2FPacketSetSlot || packet is S0DPacketCollectItem) {
dirty = true
}
if (packet is S2FPacketSetSlot) {
val windowId = packet.func_149175_c()
if (windowId == 0) {
val item = packet.func_149174_e() ?: return
OwnInventoryItemUpdateEvent(item).postAndCatch()
}
}
}

@SubscribeEvent
Expand Down
Loading

0 comments on commit 33f0223

Please sign in to comment.