Skip to content

Commit 4271c1c

Browse files
committed
0.2.4-1.21.5 Update (Wait for moulconfig to upload)
- Fixed Favorite Pets hiding active and exp shared pets in favorite mode. - Fixed Garden Map resetting visitors display when all pests cleared. - Fixed Favorite Contacts working inside levels menus. - Fixed debug message spam in console on startup.
1 parent dd08606 commit 4271c1c

File tree

7 files changed

+35
-25
lines changed

7 files changed

+35
-25
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies {
3434
modImplementation(libs.fabric.kotlin)
3535
modImplementation(libs.fabric.api)
3636
modRuntimeOnly(libs.devauth)
37-
implementation("org.reflections:reflections:0.10.2") // Might switch to something like ClassGraph
37+
implementation("org.reflections:reflections:0.10.2")
3838
include("org.reflections:reflections:0.10.2")
3939
modImplementation("org.javassist:javassist:3.28.0-GA")
4040
include("org.javassist:javassist:3.28.0-GA")

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Taken from Firmament
22
[versions]
3-
version = "Beta 0.2.3"
3+
version = "Beta 0.2.4"
44
minecraft = "1.21.5"
55
yarn_mappings="1.21.5+build.1"
66
loader_version="0.16.14"

src/main/kotlin/io/github/frostzie/skyfall/api/feature/FeatureManager.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ object FeatureManager {
2121
try {
2222
val reflections = Reflections("io.github.frostzie.skyfall.features")
2323
val featureClasses = reflections.getTypesAnnotatedWith(Feature::class.java)
24-
logger.info(" Found ${featureClasses.size} potential features.")
24+
logger.debug(" Found ${featureClasses.size} potential features.")
2525

2626
if (featureClasses.isNotEmpty()) {
2727
val classNames = featureClasses.joinToString(separator = ", ") { it.simpleName }
28-
logger.info(" Discovered features: [$classNames]")
28+
logger.debug(" Discovered features: [$classNames]")
2929
}
3030

3131
for (featureClass in featureClasses) {
@@ -51,7 +51,7 @@ object FeatureManager {
5151
}
5252
}
5353

54-
logger.info(" Feature '${annotation.name}' type: [${capabilities.joinToString()}]")
54+
logger.debug(" Feature '${annotation.name}' type: [${capabilities.joinToString()}]")
5555
} else {
5656
logger.warn("Class ${featureClass.simpleName} is annotated with @Feature but does not implement IFeature.")
5757
}
@@ -72,7 +72,7 @@ object FeatureManager {
7272
* Updates all discovered features - both new event system and legacy features
7373
*/
7474
fun updateFeatureStates() {
75-
logger.info(" Updating feature states...")
75+
logger.debug(" Updating feature states...")
7676
if (discoveredFeatures.isEmpty()) {
7777
logger.warn("No features were discovered. Cannot update states. Was initialize() called?")
7878
return
@@ -84,10 +84,10 @@ object FeatureManager {
8484
val isActuallyRunning = feature.isRunning
8585

8686
if (shouldBeRunning && !isActuallyRunning) {
87-
logger.info(" -> Starting feature: '$featureName'")
87+
logger.debug(" -> Starting feature: '$featureName'")
8888
feature.init() // This handles registration automatically based on feature type
8989
} else if (!shouldBeRunning && isActuallyRunning) {
90-
logger.info(" -> Stopping feature: '$featureName'")
90+
logger.debug(" -> Stopping feature: '$featureName'")
9191
feature.terminate() // This handles unregistration automatically
9292
}
9393
} catch (e: Exception) {
@@ -114,11 +114,11 @@ object FeatureManager {
114114

115115
activeFeatures.forEach { (type, features) ->
116116
val names = features.joinToString(", ") { (_, name) -> name }
117-
logger.info(" Active $type features: [$names]")
117+
logger.debug(" Active $type features: [$names]")
118118
}
119119

120120
if (activeFeatures.isEmpty()) {
121-
logger.info(" No features are currently enabled.")
121+
logger.debug(" No features are currently enabled.")
122122
}
123123
}
124124

src/main/kotlin/io/github/frostzie/skyfall/config/ConfigManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ object ConfigManager {
7171
fixedRateTimer(name = "skyfall-config-auto-save", period = 60_000L, initialDelay = 60_000L) {
7272
try {
7373
saveConfig("auto-save-60s")
74-
logger.info(" 60s Config Save.")
74+
logger.debug(" 60s Config Save.")
7575
} catch (e: Throwable) {
7676
logger.error("Error auto-saving config!", e)
7777
}

src/main/kotlin/io/github/frostzie/skyfall/features/inventory/FavoriteAbiContact.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ object FavoriteAbiContact : IEventFeature {
214214

215215
private fun isAbiPhoneContacts(screen: HandledScreen<*>): Boolean {
216216
val title = screen.title.string
217-
return title.contains("Abiphone") && !title.contains("Miscellaneous ➜ Abiphone")
217+
return title.contains("Abiphone") && !title.contains("Miscellaneous")
218218
}
219219

220220
fun isSlotInChestInventory(slot: Slot): Boolean {

src/main/kotlin/io/github/frostzie/skyfall/features/inventory/FavoritePet.kt

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import net.minecraft.entity.player.PlayerInventory
2626
import net.minecraft.text.Text
2727
import org.lwjgl.glfw.GLFW
2828
import java.io.File
29-
import java.io.FileReader
3029
import java.io.FileWriter
3130

3231
@Feature(name = "Favorite Pets")
@@ -79,12 +78,19 @@ object FavoritePet : IEventFeature {
7978
if (!isRunning) return@subscribe
8079

8180
val slot = event.slot ?: return@subscribe
81+
val stack = slot.stack
8282
val currentScreen = MinecraftClient.getInstance().currentScreen
8383
if (currentScreen is HandledScreen<*> && isPetMenu(currentScreen)) {
8484
if (isSlotInChestInventory(slot) && validSlotRanges.any { slot.index in it }) {
85-
if (favoredOnlyToggle && !slot.stack.isEmpty) {
86-
val itemUuid = ItemUtils.getUuid(slot.stack)
87-
if (itemUuid == null || !highlightedItems.contains(itemUuid)) {
85+
if (favoredOnlyToggle && !stack.isEmpty && PetUtils.isPet(stack)) {
86+
val itemUuid = ItemUtils.getUuid(stack)
87+
val config = SkyFall.feature.inventory.petMenu
88+
89+
val isFavorite = itemUuid != null && highlightedItems.contains(itemUuid)
90+
val isActive = config.activePet && PetUtils.isActivePet(stack)
91+
val isExpShared = config.showXPSharedPets && itemUuid != null && expSharedPets.contains(itemUuid)
92+
93+
if (!isFavorite && !isActive && !isExpShared) {
8894
event.cancel()
8995
}
9096
}
@@ -96,12 +102,19 @@ object FavoritePet : IEventFeature {
96102
if (!isRunning) return@subscribe
97103

98104
val slot = event.slot
105+
val stack = slot.stack
99106
val currentScreen = MinecraftClient.getInstance().currentScreen
100107
if (currentScreen is HandledScreen<*> && isPetMenu(currentScreen)) {
101108
if (isSlotInChestInventory(slot) && validSlotRanges.any { slot.index in it }) {
102-
if (favoredOnlyToggle && !slot.stack.isEmpty) {
103-
val itemUuid = ItemUtils.getUuid(slot.stack)
104-
if (itemUuid == null || !highlightedItems.contains(itemUuid)) {
109+
if (favoredOnlyToggle && !stack.isEmpty && PetUtils.isPet(stack)) {
110+
val itemUuid = ItemUtils.getUuid(stack)
111+
val config = SkyFall.feature.inventory.petMenu
112+
113+
val isFavorite = itemUuid != null && highlightedItems.contains(itemUuid)
114+
val isActive = config.activePet && PetUtils.isActivePet(stack)
115+
val isExpShared = config.showXPSharedPets && itemUuid != null && expSharedPets.contains(itemUuid)
116+
117+
if (!isFavorite && !isActive && !isExpShared) {
105118
event.hide()
106119
event.hideTooltip()
107120
}
@@ -332,13 +345,10 @@ object FavoritePet : IEventFeature {
332345
}
333346
}
334347

335-
// In FavoritePet.kt
336-
337348
private fun loadConfig() {
338-
// Ensure the config directory exists
339349
configFile.parentFile.mkdirs()
340350
if (!configFile.exists() || configFile.length() == 0L) {
341-
return // Nothing to load
351+
return
342352
}
343353

344354
try {

src/main/resources/fabric.mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": 1,
33
"id": "skyfall",
4-
"version": "0.2.3",
4+
"version": "0.2.4",
55
"name": "SkyFall",
66
"description": "QOL Hypixel Skyblock mod for newest versions of Minecraft",
77
"authors": [
@@ -28,7 +28,7 @@
2828
],
2929
"depends": {
3030
"fabricloader": "*",
31-
"minecraft": "*",
31+
"minecraft": "1.21.5",
3232
"java": ">=21",
3333
"fabric-api": "*",
3434
"fabric-language-kotlin": "*"

0 commit comments

Comments
 (0)