Skip to content

Commit

Permalink
Merge remote-tracking branch 'hannibal002/beta' into petapi-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
martimavocado committed Oct 18, 2024
2 parents d951402 + 33a9608 commit 1376426
Show file tree
Hide file tree
Showing 174 changed files with 3,219 additions and 2,221 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: "PR Changelog Verification"

on:
pull_request_target:
types: [ opened, edited ]
types: [ opened, edited, ready_for_review ]

jobs:
verify-changelog:
if: github.event.pull_request.state == 'open' && '511310721' == github.repository_id
if: github.event.pull_request.state == 'open' && '511310721' == github.repository_id && github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
1 change: 1 addition & 0 deletions .idea/dictionaries/default_user.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import net.fabricmc.loom.task.RunGameTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import skyhannibuildsystem.ChangelogVerification
import skyhannibuildsystem.DownloadBackupRepo

plugins {
idea
Expand Down Expand Up @@ -96,6 +97,12 @@ val headlessLwjgl by configurations.creating {
isTransitive = false
isVisible = false
}

val includeBackupRepo by tasks.registering(DownloadBackupRepo::class) {
this.outputDirectory.set(layout.buildDirectory.dir("downloadedRepo"))
this.branch = "main"
}

tasks.runClient {
this.javaLauncher.set(
javaToolchains.launcherFor {
Expand Down Expand Up @@ -213,6 +220,7 @@ kotlin {

// Tasks:
tasks.processResources {
from(includeBackupRepo)
inputs.property("version", version)
filesMatching(listOf("mcmod.info", "fabric.mod.json")) {
expand("version" to version)
Expand Down
34 changes: 34 additions & 0 deletions buildSrc/src/main/kotlin/skyhannibuildsystem/DownloadBackupRepo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package skyhannibuildsystem

import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import java.net.URL

// Code taken from NotEnoughUpdates
abstract class DownloadBackupRepo : DefaultTask() {

@get:OutputDirectory
abstract val outputDirectory: DirectoryProperty

@get:Input
abstract var branch: String

@get:Internal
val repoFile get() = outputDirectory.get().asFile.resolve("assets/skyhanni/repo.zip")

@TaskAction
fun downloadRepo() {
val downloadUrl = URL("https://github.com/hannibal002/SkyHanni-Repo/archive/refs/heads/$branch.zip")
val file = repoFile
file.parentFile.mkdirs()
file.outputStream().use { out ->
downloadUrl.openStream().use { inp ->
inp.copyTo(out)
}
}
}
}
27 changes: 27 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
+ Shows your progress in the Warp Menu.
+ Can be automatically hidden when an island is complete.
+ Added the ability to block opening the Chocolate Factory when Booster Cookie is inactive. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2713)
+ Added a feature to block opening Hoppity's trade menu from Abiphone calls if you do not have coins in your purse. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2664)
+ Added the ability to prevent closing Meal Eggs that have Rabbit the Fish inside. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2712)

#### Inventory Features

Expand Down Expand Up @@ -66,6 +68,14 @@

+ Added support for detecting and handling Inquisitor spawn messages from other mods from chat. - hannibal2 (https://github.com/hannibal002/SkyHanni/pull/2720)

#### Fishing Improvements

+ Added an option to always display the Barn Fishing Timer anywhere. - NeoNyaa (https://github.com/hannibal002/SkyHanni/pull/2735)

#### Hoppity Improvements

+ Improved the Time Tower Usage Warning so it doesn't spam messages. - MTOnline (https://github.com/hannibal002/SkyHanni/pull/2730)

#### Misc Improvements

+ Added distance display to waypoints created by Patcher's Send Coords feature. - jani (https://github.com/hannibal002/SkyHanni/pull/2704)
Expand All @@ -88,12 +98,15 @@
+ Fixed the debug feature that allows you to add/remove stars being enabled by default. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2715)
+ Fixed displaying the Guardian warning text in the Experimentation Table even when using a Guardian Pet. - hannibal2 (https://github.com/hannibal002/SkyHanni/pull/2718)
+ Fixed locked Ultimate enchantments being hidden by Enchant Parsing. - martimavocado (https://github.com/hannibal002/SkyHanni/pull/2732)
+ Fixed Chest Value Display on Carpentry Chests. - fazfoxy (https://github.com/hannibal002/SkyHanni/pull/2743)
+ Fixed Compact Item Stars. - Empa, Fazfoxy (https://github.com/hannibal002/SkyHanni/pull/2741)

#### Combat Fixes

+ Fixed Ghost Counter display appearing while in incorrect areas on the map. - hannibal2 (https://github.com/hannibal002/SkyHanni/pull/2696)
+ Fixed Ashfang Blazes sometimes being highlighted with the wrong color. - Empa (https://github.com/hannibal002/SkyHanni/pull/2112)
+ Fixed Ashfang Reset Cooldown counting in the wrong direction. - Empa (https://github.com/hannibal002/SkyHanni/pull/2112)
+ Fixed Millennia-Aged Blaze not being highlighted by the Area Boss Highlight feature. - jani (https://github.com/hannibal002/SkyHanni/pull/2707)

#### Custom Scoreboard Fixes

Expand All @@ -102,6 +115,7 @@
#### Hoppity Fixes

+ Fixed the chocolate egg share message sometimes displaying the wrong location name. - martimavocado (https://github.com/hannibal002/SkyHanni/pull/2711)
+ Fixed El Dorado not receiving a compacted chat message. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2742)

#### Garden Fixes

Expand All @@ -119,6 +133,14 @@

+ Fixed /shtranslate not working in most cases. - Obsidian (https://github.com/hannibal002/SkyHanni/pull/2693)

#### Mining Fixes

+ Fixed a crash when attempting to edit the Flowstate Helper config. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2740)

#### Misc Fixes

+ Fixed SkyHanni messages being sent twice. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2736)

### Technical Details

+ Assigned 'backend' label to PRs with 'backend' in the title. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2690)
Expand All @@ -136,6 +158,11 @@
+ Added EntityLeaveWorldEvent. - Empa (https://github.com/hannibal002/SkyHanni/pull/2112)
+ Made command registration event-based. - j10a1n15, ThatGravyBoat (https://github.com/hannibal002/SkyHanni/pull/2642)
+ Added "line to the mob" handler. - Thunderblade73 (https://github.com/hannibal002/SkyHanni/pull/2717)
+ No longer use NEU GUI elements for the auto-update button. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2725)
+ Added SkyHanni notifications. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2630)
+ Moved Hoppity Warp Menu config to `HoppityWarpMenuConfig`. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2712)
+ Migrated some LorenzEvents without parameters to SkyHanniEvents. - Empa (https://github.com/hannibal002/SkyHanni/pull/2744)
+ Changed SkyHanniEvents without parameters to be objects. - Empa (https://github.com/hannibal002/SkyHanni/pull/2744)

## Version 0.27

Expand Down
2 changes: 2 additions & 0 deletions docs/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,8 @@ Use `/sh` or `/skyhanni` to open the SkyHanni config in game.
+ Shows your progress in the Warp Menu.
+ Can be automatically hidden when an island is complete.
+ Added the ability to block opening the Chocolate Factory when Booster Cookie is inactive. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2713)
+ Added a feature to block opening Hoppity's trade menu from Abiphone calls if you do not have coins in your purse. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2664)
+ Added the ability to prevent closing Meal Eggs that have Rabbit the Fish inside. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2712)

### The Carnival

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

allprojects {
group = "at.hannibal2.skyhanni"
version = "0.28.Beta.3"
version = "0.28.Beta.4"
repositories {
mavenCentral()
mavenLocal()
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 @@ -61,7 +61,7 @@ class SkyHanniMod {

CommandRegistrationEvent.post()

PreInitFinishedEvent().post()
PreInitFinishedEvent.post()
}

@Mod.EventHandler
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object CollectionAPI {
val internalName = incorrectCollectionNames[name] ?: NEUInternalName.fromItemName(name)
collectionValue[internalName] = counter
}
CollectionUpdateEvent().postAndCatch()
CollectionUpdateEvent.post()
}

if (inventoryName.endsWith(" Collections")) {
Expand All @@ -83,7 +83,7 @@ object CollectionAPI {
collectionValue[internalName] = counter
}
}
CollectionUpdateEvent().postAndCatch()
CollectionUpdateEvent.post()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/api/FmlEventApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object FmlEventApi {

@SubscribeEvent
fun onDisconnect(event: FMLNetworkEvent.ClientDisconnectionFromServerEvent) {
ClientDisconnectEvent().post()
ClientDisconnectEvent.post()
}

@SubscribeEvent
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import at.hannibal2.skyhanni.utils.NumberUtil.formatDouble
import at.hannibal2.skyhanni.utils.NumberUtil.formatLong
import at.hannibal2.skyhanni.utils.NumberUtil.formatLongOrUserError
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.SimpleTimeMark
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.google.gson.JsonPrimitive
object ConfigUpdaterMigrator {

val logger = LorenzLogger("ConfigMigration")
const val CONFIG_VERSION = 61
const val CONFIG_VERSION = 63
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
@@ -0,0 +1,19 @@
package at.hannibal2.skyhanni.config.core.elements

import net.minecraft.client.gui.Gui

abstract class GuiElement : Gui() {
abstract fun render(x: Int, y: Int)

abstract val width: Int

abstract val height: Int

open fun mouseClicked(mouseX: Int, mouseY: Int, mouseButton: Int) {}

fun mouseClickMove(mouseX: Int, mouseY: Int, clickedMouseButton: Int, timeSinceLastClick: Long) {}

fun otherComponentClick() {}

fun keyTyped(typedChar: Char, keyCode: Int) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package at.hannibal2.skyhanni.config.core.elements

import java.awt.Color

class GuiElementButton(text: String, colour: Int, private val callback: Runnable) : GuiElementText(text, colour) {

override val height: Int
get() = super.height + 5

override val width: Int
get() = super.width + 10

override fun mouseClicked(mouseX: Int, mouseY: Int, mouseButton: Int) {
callback.run()
}

override fun render(x: Int, y: Int) {
drawRect(x, y, x + width, y + super.height, Color.WHITE.rgb)
drawRect(x + 1, y + 1, x + width - 1, y + super.height - 1, Color.BLACK.rgb)
super.render(x + 5, y - 1)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package at.hannibal2.skyhanni.config.core.elements

import net.minecraft.client.Minecraft

open class GuiElementText(var text: String, private val colour: Int) : GuiElement() {

override val height: Int
get() = 18

override val width: Int
get() {
val fr = Minecraft.getMinecraft().fontRendererObj
return fr.getStringWidth(text)
}

override fun render(x: Int, y: Int) {
val fr = Minecraft.getMinecraft().fontRendererObj

fr.drawString(text, x, y + 6, colour)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorKeybind;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;
Expand Down Expand Up @@ -44,4 +45,14 @@ public class HoppityCallWarningConfig {
@ConfigOption(name = "Sounds", desc = "Click to open the list of available sounds.")
@ConfigEditorButton(buttonText = "OPEN")
public Runnable sounds = () -> OSUtils.openBrowser("https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/mapping-and-modding-tutorials/2213619-1-8-all-playsound-sound-arguments");

@Expose
@ConfigOption(name = "Ensure Coins Pre-Trade", desc = "Block opening Hoppity's abiphone trade menu if you do not have enough coins in your purse.")
@ConfigEditorBoolean
public boolean ensureCoins = true;

@Expose
@ConfigOption(name = "Coin Threshold", desc = "The amount of coins you need to have in your purse to be able to open Hoppity's abiphone trade menu.")
@ConfigEditorSlider(minValue = 250000, maxValue = 5000000, minStep = 250000)
public int coinThreshold = 5000000;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public class HoppityEggsConfig {
@Accordion
public HoppityEventSummaryConfig eventSummary = new HoppityEventSummaryConfig();

@Expose
@ConfigOption(name = "Warp Menu", desc = "")
@Accordion
public HoppityWarpMenuConfig warpMenu = new HoppityWarpMenuConfig();

@Expose
@ConfigOption(name = "Hoppity Waypoints", desc = "Toggle guess waypoints for Hoppity's Hunt.")
@ConfigEditorBoolean
Expand Down Expand Up @@ -213,13 +218,8 @@ public String toString() {
public boolean petWarning = false;

@Expose
@ConfigOption(name = "Show uniques in Warp Menu", desc = "Shows your unique eggs in the Warp Menu during the hoppity event.")
@ConfigOption(name = "Prevent Missing Fish the Rabbit", desc = "Prevent closing a Meal Egg's inventory if Fish the Rabbit is present.")
@ConfigEditorBoolean
@FeatureToggle
public boolean uniquesWarpMenu = true;

@Expose
@ConfigOption(name = "Hide when maxed", desc = "Stops the above feature from working when the island is complete.")
@ConfigEditorBoolean
public boolean uniquesWarpMenuHideMax = true;
public boolean preventMissingFish = true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package at.hannibal2.skyhanni.config.features.event.hoppity;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;

public class HoppityWarpMenuConfig {

@Expose
@ConfigOption(name = "Show uniques in Warp Menu", desc = "Shows your unique eggs in the Warp Menu during the hoppity event.")
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = true;

@Expose
@ConfigOption(name = "Hide when maxed", desc = "Stops the above feature from working when the island is complete.")
@ConfigEditorBoolean
public boolean hideWhenMaxed = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ public class BarnTimerConfig {
@FeatureToggle
public Property<Boolean> enabled = Property.of(true);

@Expose
@ConfigOption(
name = "Show Anywhere",
desc = "Show the Barn Fishing Timer whenever you fish up a sea creature, regardless of location."
)
@ConfigEditorBoolean
public boolean showAnywhere = false;

@Expose
@ConfigOption(
name = "Worm Fishing",
Expand Down
Loading

0 comments on commit 1376426

Please sign in to comment.