Skip to content

Commit

Permalink
Merge pull request #50 from hannibal002/beta
Browse files Browse the repository at this point in the history
merge with upstream
  • Loading branch information
RayDeeUx authored Jan 3, 2024
2 parents 84c77fe + c6fd060 commit 5abb0b9
Show file tree
Hide file tree
Showing 38 changed files with 277 additions and 171 deletions.
54 changes: 51 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,78 @@

#### Fishing Features

+ Show sack item amount to the visitor shopping list. - CalMWolfs

#### Fishing Features

+ Added Sea Creature Tracker. - hannibal2
+ Allows to only show single variants, e.g. water or lava or winter.

### Changed

#### Garden Changes

+ Renamed Visitor Items Needed to Visitor Shopping List. - hannibal2
+ Added biofuel support to the Composter Overlay get from sack logic. - obsidian
+ Updated max reforge fortune for Fungi Cutter. - alexia
+ Hypixel has increased the base rarity to Epic.

#### Rift Changes

+ Rift time now updates correctly in wizard tower and instantly updates the format when toggling max time or
percentage. - hannibal2

#### Fishing Fixes
#### Fishing Changes

+ Fixed Reindrake mob, Frosty NPC and frosty the snow blaster shop counting as sea creatures in the barn fishing
timer. - hannibal2
+ Odger highlight feature tells in description that it is only useful for users without abiphone. - hannibal2

#### Bingo Changes

+ Show the guide text when hovering over the missing bingo goal list. - hannibal2

#### Inventory Changes

+ Removed flawless gemstones from sack display. - CalMWolfs
+ Hypixel removed them from sacks.

### Fixes

#### Garden Fixes

+ Fixed mushrooms being counted with Common/Uncommon Mooshroom Cow Pet. - alexia
+ Fixed progress to maxed milestone appearing twice in the crop milestone menu when having milestone 20. - Empa
+ Fixed max crop milestone display being too long in the crop milestone menu. - obsidian
+ Fixed Mooshroom Cow Perk counter when farming sugar cane/cactus with Mooshroom Cow. - alexia

#### Rift Fixes

+ Fixed vampire slayer damage indicator not working during Derpy. - hannibal2

#### Fishing Fixes

+ Fixed Reindrake mob, Frosty NPC and frosty the snow blaster shop counting as sea creatures in the barn fishing
timer. - hannibal2

#### Invenory Fixes

+ Fixed hide non-clickable items not working in some bazaar pages. - hannibal2
+ Fixed rogue sword ability taking into account mage cooldown reduction. - Empa

#### Bingo Fixes

+ Fixed detecting bingo profile while visiting other players bingo island. - hannibal2

#### Misc Fixes

+ Maybe fixed Tia Relay Helper. - Thunderblade73

### Technical Changes

+ Migrate Hypixel API to v2. - hannibal2
+ Added SackDataUpdateEvent. - CalMWolfs
+ Fixing a mac crash in dev environment automatically. - CalMWolfs
+ Bingo repo change: Make note of an alternative title, and create a guide field for the actual guide text. - hannibal2
+ Moved Tia Relay Helper chat messages into repo patterns. - Thunderblade73

## Version 0.22

Expand Down
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,14 @@ All data sent is anonymonized and opt-in.
### Mixin

A system to inject code into the original Minecraft code.
This library is not part of SkyHanni itself; it comes preinstalled with Forge.
This library is not part of SkyHanni or Forge, but we bundle it.

For more information, see https://github.com/SpongePowered/Mixin.
It allows to easily modify methods in Minecraft itself, without conflicting with other mods.

For more information, see https://github.com/SpongePowered/Mixin or [our existing mixins](https://github.com/hannibal002/SkyHanni/tree/beta/src/main/java/at/hannibal2/skyhanni/mixins/transformers).

When creating new Mixins, try to keep the code inside of the mixin as small as possible, and calling a hook as soon as
possible.

### Repo

Expand All @@ -143,7 +148,7 @@ at [DiscordRPCManager.kt](https://github.com/hannibal002/SkyHanni/blob/beta/src/

### Auto Updater

We use the [auto update library](https://repo.nea.moe/#/releases/moe/nea/libautoupdate) from nea.
We use the [auto update library](https://github.com/nea89o/libautoupdate) from nea89.

## Additional Useful Developement Tools

Expand Down
1 change: 1 addition & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ Use `/sh` or `/skyhanni` to open the SkyHanni config in game.
+ If you don't want to share anything, you can disable the chat message in the config with /sh copy milestone data.
+ Garden Vacuum Pests in Pest bag to item number as stack size. - hannibal2
+ Enable via /sh vacuum.
+ Show sack item amount to the visitor shopping list. - CalMWolfs

### Garden Pests

Expand Down
8 changes: 7 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.apache.commons.lang3.SystemUtils
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.ByteArrayOutputStream

Expand All @@ -12,7 +13,7 @@ plugins {
}

group = "at.hannibal2.skyhanni"
version = "0.23.Beta.1"
version = "0.23.Beta.3"

val gitHash by lazy {
val baos = ByteArrayOutputStream()
Expand Down Expand Up @@ -153,6 +154,11 @@ loom {
defaultRefmapName.set("mixins.skyhanni.refmap.json")
}
runConfigs {
"client" {
if (SystemUtils.IS_OS_MAC_OSX) {
vmArgs.remove("-XstartOnFirstThread")
}
}
"server" {
isIdeConfigGenerated = false
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ import org.apache.logging.log4j.Logger
clientSideOnly = true,
useMetadata = true,
guiFactory = "at.hannibal2.skyhanni.config.ConfigGuiForgeInterop",
version = "0.23.Beta.1",
version = "0.23.Beta.3",
)
class SkyHanniMod {
@Mod.EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.google.gson.JsonPrimitive

object ConfigUpdaterMigrator {
val logger = LorenzLogger("ConfigMigration")
const val CONFIG_VERSION = 17
const val CONFIG_VERSION = 18
fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? {
if (chain.isEmpty()) return this
if (this !is JsonObject) return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ public class TrophyFishingConfig {
public boolean filletTooltip = true;

@Expose
@ConfigOption(name = "Odger Waypoint", desc = "Show the Odger waypoint when Trophy Fishes are in the inventory and no lava rod in hand.")
@ConfigOption(
name = "Odger Waypoint",
desc = "Show the Odger waypoint when Trophy Fishes are in the inventory and no lava rod in hand. " +
"§cOnly useful for users without abiohone contact."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean odgerLocation = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public String toString() {
@Expose
@ConfigOption(name = "Retrieve From", desc = "Change where to retrieve the materials from in the composter overlay: The Bazaar or Sacks.")
@ConfigEditorDropdown()
public RetrieveFromEntry retrieveFrom = RetrieveFromEntry.BAZAAR;
public RetrieveFromEntry retrieveFrom = RetrieveFromEntry.SACKS;

public enum RetrieveFromEntry implements HasLegacyId {
BAZAAR("Bazaar", 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigOption;

public class NeedsConfig {
public class ShoppingListConfig {
@Expose
@ConfigOption(name = "Items Needed", desc = "Show all items needed for the visitors.")
@ConfigOption(name = "Enable", desc = "Show all items required for the visitors.")
@ConfigEditorBoolean
@FeatureToggle
// TODO rename "enabled"
public boolean display = true;

@Expose
// TODO renmae "postion"
public Position pos = new Position(180, 170, false, true);

@Expose
@ConfigOption(name = "Only when Close", desc = "Only show the needed items when close to the visitors.")
@ConfigOption(name = "Only when Close", desc = "Only show the shopping list when close to the visitors.")
@ConfigEditorBoolean
public boolean onlyWhenClose = false;

Expand All @@ -28,10 +30,16 @@ public class NeedsConfig {
public boolean inBazaarAlley = true;

@Expose
@ConfigOption(name = "Show Price", desc = "Show the coin price in the items needed list.")
@ConfigOption(name = "Show Price", desc = "Show the coin price in the shopping list.")
@ConfigEditorBoolean
public boolean showPrice = true;

@Expose
@ConfigOption(name = "Show Sack Count", desc = "Show the amount of this item that you already have in your sacks. " +
"§eOnly updates on sack change messages.")
@ConfigEditorBoolean
public boolean showSackCount = true;

@Expose
@ConfigOption(name = "Item Preview", desc = "Show the base type for the required items next to new visitors. §cNote that some visitors may require any crop.")
@ConfigEditorBoolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class VisitorConfig {
public TimerConfig timer = new TimerConfig();

@Expose
@ConfigOption(name = "Visitor Items Needed", desc = "")
@ConfigOption(name = "Visitor Shopping List", desc = "")
@Accordion
public NeedsConfig needs = new NeedsConfig();
public ShoppingListConfig shoppingList = new ShoppingListConfig();

@Expose
@ConfigOption(name = "Visitor Inventory", desc = "")
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.TabListData
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import com.google.gson.JsonObject
import io.github.moulberry.notenoughupdates.NotEnoughUpdates
import net.minecraft.client.Minecraft
Expand All @@ -25,9 +26,10 @@ import net.minecraftforge.fml.common.network.FMLNetworkEvent
import kotlin.concurrent.thread

class HypixelData {
// TODO USE SH-REPO
private val tabListProfilePattern = "§e§lProfile: §r§a(?<profile>.*)".toPattern()
private val lobbyTypePattern = "(?<lobbyType>.*lobby)\\d+".toPattern()
private val group = RepoPattern.group("data.hypixeldata")
private val tabListProfilePattern by group.pattern("tablistprofile", "§e§lProfile: §r§a(?<profile>.*)")
private val lobbyTypePattern by group.pattern("lobbytype", "(?<lobbyType>.*lobby)\\d+")
private val islandNamePattern by group.pattern("islandname", "§b§l(Area|Dungeon): §r§7(?<island>.*)")

private var lastLocRaw = 0L

Expand Down Expand Up @@ -188,7 +190,7 @@ class HypixelData {
bingo = false

for (line in ScoreboardData.sidebarLinesFormatted) {
if (BingoAPI.getRank(line) != null) {
if (BingoAPI.getRankFromScoreboard(line) != null) {
bingo = true
}
when (line) {
Expand All @@ -209,8 +211,8 @@ class HypixelData {
var newIsland = ""
var guesting = false
for (line in TabListData.getTabList()) {
if (line.startsWith("§b§lArea: ")) {
newIsland = line.split(": ")[1].removeColor()
islandNamePattern.matchMatcher(line) {
newIsland = group("island")
}
if (line == " Status: §r§9Guest") {
guesting = true
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/data/IslandType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum class IslandType(val displayName: String, val modeName: String = "null") {
CATACOMBS("Catacombs", "dungeon"),

HUB("Hub", "village"),
DARK_AUCTION("Dark Auction"),
THE_FARMING_ISLANDS("The Farming Islands"),
CRYSTAL_HOLLOWS("Crystal Hollows"),
THE_PARK("The Park", "floating_islands_1"),
Expand All @@ -20,7 +21,7 @@ enum class IslandType(val displayName: String, val modeName: String = "null") {
GARDEN("Garden"),
GARDEN_GUEST("Garden Guest"),
SPIDER_DEN("Spider's Den"),
WINTER("Jerry's Workshop"), //todo confirm
WINTER("Jerry's Workshop"),
THE_RIFT("The Rift"),

NONE(""),
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.SackChangeEvent
import at.hannibal2.skyhanni.events.SackDataUpdateEvent
import at.hannibal2.skyhanni.features.fishing.FishingAPI
import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity
import at.hannibal2.skyhanni.features.inventory.SackDisplay
Expand Down Expand Up @@ -140,12 +141,6 @@ object SackAPI {
gem.finePrice = internalName.sackPrice(stored)
if (savingSacks) setSackItem(internalName, stored.formatNumber())
}

"Flawless" -> {
gem.flawless = stored
gem.flawlessPrice = internalName.sackPrice(stored)
if (savingSacks) setSackItem(internalName, stored.formatNumber())
}
}
gemstoneItem[name] = gem
}
Expand Down Expand Up @@ -300,18 +295,18 @@ object SackAPI {
private fun saveSackData() {
ProfileStorageData.sackProfiles?.sackContents = sackData
SkyHanniMod.configManager.saveConfig(ConfigFileType.SACKS, "saving-data")

SackDataUpdateEvent().postAndCatch()
}

data class SackGemstone(
var internalName: NEUInternalName = NEUInternalName.NONE,
var rough: String = "0",
var flawed: String = "0",
var fine: String = "0",
var flawless: String = "0",
var roughPrice: Long = 0,
var flawedPrice: Long = 0,
var finePrice: Long = 0,
var flawlessPrice: Long = 0,
)

data class SackRune(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@

public class BingoJson {
@Expose
public Map<String, BingoTip> bingo_tips;
public Map<String, BingoData> bingo_tips;

public static class BingoTip {
public static class BingoData {
@Expose
public String difficulty;

@Expose
public List<String> note;

@Expose
public List<String> guide;

@Expose
public String found;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package at.hannibal2.skyhanni.events

class SackDataUpdateEvent : LorenzEvent()
12 changes: 4 additions & 8 deletions src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
import at.hannibal2.skyhanni.utils.StringUtils.equalsIgnoreColor
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraft.client.gui.inventory.GuiChest
Expand Down Expand Up @@ -119,14 +120,9 @@ class BazaarApi {
}

private fun checkIfInBazaar(event: InventoryFullyOpenedEvent): Boolean {
val returnItem = event.inventorySize - 5
for ((slot, item) in event.inventoryItems) {
if (slot == returnItem && item.name?.removeColor().let { it == "Go Back" }) {
val lore = item.getLore()
if (lore.getOrNull(0)?.removeColor().let { it == "To Bazaar" }) {
return true
}
}
val items = event.inventorySize.let { listOf(it - 5, it - 6) }.mapNotNull { event.inventoryItems[it] }
if (items.any { it.name.equalsIgnoreColor("Go Back") && it.getLore().firstOrNull() == "§7To Bazaar" }) {
return true
}

if (event.inventoryName.startsWith("Bazaar ➜ ")) return true
Expand Down
Loading

0 comments on commit 5abb0b9

Please sign in to comment.