Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
superhize committed Jul 8, 2024
2 parents 38c9dc6 + 2f353a0 commit 957704d
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 71 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ for more information and usages.
- Please use Regex instead of String comparison when it is likely Hypixel will change the message in the future.
- Do not use `fixedRateTimer` when possible and instead use `SecondPassedEvent` to safely execute the repeating event on
the main thread.
- When updating a config option variable, use the `ConfigUpdaterMigrator.ConfigFixEvent` with event.move(), when moving a value, and event.transform() when updating a value. [For Example](https://github.com/hannibal002/SkyHanni/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt#L241).
- When updating a config option variable, use the `ConfigUpdaterMigrator.ConfigFixEvent` with event.move() when moving a value, and event.transform() when updating a value. [For Example](https://github.com/hannibal002/SkyHanni/blob/e88f416c48f9659f89b7047d7629cd9a1d1535bc/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt#L276).

## Software Used in SkyHanni

Expand Down
4 changes: 2 additions & 2 deletions docs/DISCORD_FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ _Frequently Asked Questions_
> **12: Why can I still see the normal Scoreboard when using Custom Scoreboard?**
> Most of the time, this is a mod conflict.
> If you are using [Sidebar Mod](https://github.com/Alexdoru/SidebarMod), please remove this mod.
> If you are using [VanillaHUD](https://modrinth.com/mod/vanillahud), please disable its Scoreboard by clicking on the blue bar below "Scoreboard" in the OneConfig Menu.
> If you are using [VanillaHUD](https://modrinth.com/mod/vanillahud), please update to 2.2.7 or newer to resolve this issue.
> If you are using [Apec](https://github.com/BananaFructa/Apec/) and want to remove their Scoreboard, you need to remove Apec since they don't have an option to disable their Scoreboard.
> If you don't use any of these mods, make sure the option to "Hide Vanilla Scoreboard" is actually enabled.

*This FAQ was last updated on May 27th, 2024.
*This FAQ was last updated on June 26th, 2024.
If you believe there's something that should be added to this list, please tell us, so we can add it.*
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class MushroomPetPerkConfig {

public enum MushroomTextEntry implements HasLegacyId {
TITLE("§6Mooshroom Cow Perk", 0),
MUSHROOM_TIER("§7Mushroom Tier 8", 1),
// TODO change to mushroom milestone
MUSHROOM_TIER("§7Mushroom Milestone 8", 1),
NUMBER_OUT_OF_TOTAL("§e6,700§8/§e15,000", 2),
TIME("§7In §b12m 34s", 3),
PERCENTAGE("§7Percentage: §e12.34%", 4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ChocolateFactoryCustomReminderConfig {
public boolean enabled = false;

@Expose
@ConfigOption(name = "Always Custom Reminder", desc = "Always show the display always, even outside the chocolate factory.")
@ConfigOption(name = "Always Custom Reminder", desc = "Always show the display, even outside the chocolate factory.")
@ConfigEditorBoolean
@FeatureToggle
public boolean always = false;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ object HypixelData {
islandType = getIslandType(foundIsland, guesting)
}

// TODO dont send events when one of the arguments is none, at least when not on sb anymore
if (skyBlockIsland != islandType) {
IslandChangeEvent(islandType, skyBlockIsland).postAndCatch()
if (islandType == IslandType.UNKNOWN) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ object FarmingWeightDisplay {

val timeFormat = if (weightPerSecond != -1.0) {
val timeTillOvertake = try {
(weightUntilOvertake / weightPerSecond).minutes
(weightUntilOvertake / weightPerSecond).seconds
} catch (e: Exception) {
ErrorManager.logErrorWithData(
e,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ object GardenCropMilestoneDisplay {
}

if (overflowConfig.chat) {
if (currentTier >= 46 && currentTier == previousNext &&
if (currentTier > 46 && currentTier == previousNext &&
nextRealTier == currentTier + 1 && lastWarnedLevel != currentTier
) {
GardenCropMilestones.onOverflowLevelUp(crop, currentTier - 1, nextRealTier - 1)
Expand All @@ -246,7 +246,7 @@ object GardenCropMilestoneDisplay {
}

if (overflowConfig.chat) {
if (currentTier >= 46 && currentTier == previousNext &&
if (currentTier > 46 && currentTier == previousNext &&
nextRealTier == currentTier + 1 && lastWarnedLevel != currentTier
) {
GardenCropMilestones.onOverflowLevelUp(crop, currentTier - 1, nextRealTier - 1)
Expand Down Expand Up @@ -319,7 +319,7 @@ object GardenCropMilestoneDisplay {
lineMap[MushroomTextEntry.TITLE] = Renderable.string("§6Mooshroom Cow Perk")
lineMap[MushroomTextEntry.MUSHROOM_TIER] = Renderable.horizontalContainer(buildList {
addCropIconRenderable(mushroom)
addString("§7Mushroom Tier $nextTier")
addString("§7Mushroom Milestone $nextTier")
})

lineMap[MushroomTextEntry.NUMBER_OUT_OF_TOTAL] = Renderable.string("§e$haveFormat§8/§e$needFormat")
Expand All @@ -338,7 +338,7 @@ object GardenCropMilestoneDisplay {
val percentageFormat = LorenzUtils.formatPercentage(have.toDouble() / need.toDouble())
lineMap[MushroomTextEntry.PERCENTAGE] = Renderable.string("§7Percentage: §e$percentageFormat")

if (currentTier >= 46 && currentTier == previousMushNext && nextTier == currentTier + 1 && lastMushWarnedLevel != currentTier) {
if (currentTier > 46 && currentTier == previousMushNext && nextTier == currentTier + 1 && lastMushWarnedLevel != currentTier) {
GardenCropMilestones.onOverflowLevelUp(mushroom, currentTier - 1, nextTier - 1)
lastMushWarnedLevel = currentTier
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ object ChocolateFactoryAPI {
fun timeTowerChargeDuration() =
if (HoppityCollectionStats.hasFoundRabbit("Einstein")) 7.hours else 8.hours

private fun timeTowerMultiplier(): Double {
fun timeTowerMultiplier(): Double {
var multiplier = (profileStorage?.timeTowerLevel ?: 0) * 0.1
if (HoppityCollectionStats.hasFoundRabbit("Mu")) multiplier += 0.7
return multiplier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object ChocolateFactoryTooltip {

private fun chocPerTimeTower(): Int {
val profileStorage = profileStorage ?: return 0
val amountPerSecond = profileStorage.rawChocPerSecond * profileStorage.timeTowerLevel * .1
val amountPerSecond = profileStorage.rawChocPerSecond * ChocolateFactoryAPI.timeTowerMultiplier()
val amountPerHour = amountPerSecond * 60 * 60
return amountPerHour.toInt()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ object PowderTracker {
}

private fun MutableList<List<Any>>.addPerHour(
map: MutableMap<PowderChestReward, Long>,
map: Map<PowderChestReward, Long>,
reward: PowderChestReward,
info: ResourceInfo,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,10 @@ object QuickModMenuSwitch {
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
val modsJar = event.getConstant<ModGuiSwitcherJson>("ModGuiSwitcher")
mods = buildList {
out@ for ((name, mod) in modsJar.mods) {
for (path in mod.guiPath) {
try {
Class.forName(path)
add(Mod(name, mod.description, mod.command, mod.guiPath))
continue@out
} catch (_: Exception) {
}
}
}
mods = modsJar.mods.filter { mod ->
mod.value.guiPath.any { runCatching { Class.forName(it) }.isSuccess }
}.map { (name, mod) ->
Mod(name, mod.description, mod.command, mod.guiPath)
}
}

Expand Down Expand Up @@ -108,11 +101,21 @@ object QuickModMenuSwitch {
return config.javaClass.name
}
if (openGui == "cc.polyfrost.oneconfig.gui.OneConfigGui") {
/** TODO support different oneconfig mods:
* Partly Sane Skies
* Dankers SkyBlock Mod
* Dulkir
*/
val actualGui = Minecraft.getMinecraft().currentScreen
val currentPage = actualGui.javaClass.getDeclaredField("currentPage")
.makeAccessible()
.get(actualGui)
if (currentPage.javaClass.simpleName == "ModConfigPage") {
val optionPage = currentPage.javaClass.getDeclaredField("page")
.makeAccessible()
.get(currentPage)
val mod = optionPage.javaClass.getField("mod")
.makeAccessible()
.get(optionPage)
val modName = mod.javaClass.getField("name")
.get(mod) as String
return "cc.polyfrost.oneconfig.gui.OneConfigGui:$modName"
}
}

return openGui
Expand All @@ -132,7 +135,7 @@ object QuickModMenuSwitch {
Renderable.string(nameFormat + mod.name),
bypassChecks = true,
onClick = { open(mod) },
condition = { System.currentTimeMillis() > lastGuiOpen + 250 }
condition = { System.currentTimeMillis() > lastGuiOpen + 250 },
)
add(listOf(renderable, nameSuffix))
}
Expand All @@ -143,44 +146,8 @@ object QuickModMenuSwitch {
currentlyOpeningMod = mod.name
update()
try {
when (mod.command) {
"patcher" -> {
val patcher = Class.forName("club.sk1er.patcher.Patcher")
val instance = patcher.getDeclaredField("instance").get(null)
val config = instance.javaClass.getDeclaredMethod("getPatcherConfig").invoke(instance)
val gui = Class.forName("gg.essential.vigilance.Vigilant").getDeclaredMethod("gui").invoke(config)
val guiUtils = Class.forName("gg.essential.api.utils.GuiUtil")
for (method in guiUtils.declaredMethods) {
try {
method.invoke(null, gui)
return
} catch (_: Exception) {
}
}
ErrorManager.skyHanniError("Error trying to open the gui for mod " + mod.name + "!")
}

"hytil" -> {
val hytilsReborn = Class.forName("cc.woverflow.hytils.HytilsReborn")
val instance = hytilsReborn.getDeclaredField("INSTANCE").get(null)
val config = instance.javaClass.getDeclaredMethod("getConfig").invoke(instance)
val gui = Class.forName("gg.essential.vigilance.Vigilant").getDeclaredMethod("gui").invoke(config)
val guiUtils = Class.forName("gg.essential.api.utils.GuiUtil")
for (method in guiUtils.declaredMethods) {
try {
method.invoke(null, gui)
return
} catch (_: Exception) {
}
}
ChatUtils.chat("Error trying to open the gui for mod " + mod.name + "!")
}

else -> {
val thePlayer = Minecraft.getMinecraft().thePlayer
ClientCommandHandler.instance.executeCommand(thePlayer, "/${mod.command}")
}
}
val thePlayer = Minecraft.getMinecraft().thePlayer
ClientCommandHandler.instance.executeCommand(thePlayer, "/" + mod.command)
} catch (e: Exception) {
ErrorManager.logErrorWithData(e, "Error trying to open the gui for mod " + mod.name)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ object SkillProgress {
allDisplay = formatAllDisplay(drawAllDisplay())
etaDisplay = drawETADisplay()

if (event.repeatSeconds(2)) {
if (event.repeatSeconds(1)) {
update()
updateSkillInfo()
}
Expand Down Expand Up @@ -503,8 +503,7 @@ object SkillProgress {
xpInfo.xpGainQueue.removeLast()
}

var totalGain = 0f
for (f in xpInfo.xpGainQueue) totalGain += f
val totalGain = xpInfo.xpGainQueue.sum()

xpInfo.xpGainHour = totalGain * (60 * 60) / xpInfo.xpGainQueue.size
xpInfo.isActive = true
Expand Down

0 comments on commit 957704d

Please sign in to comment.