Skip to content

Commit

Permalink
Merge branch 'beta' into present-waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 committed Dec 8, 2023
2 parents c5899fa + a28e7e3 commit a5a820a
Show file tree
Hide file tree
Showing 58 changed files with 861 additions and 125 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/generate-constants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Read the Javadoc of RepoPatternDump for more info

name: RepoPattern

env:
data_repo: hannibal002/SkyHanni-REPO

on:
push:
workflow_dispatch:

permissions: { }

jobs:
regexes:
runs-on: ubuntu-latest
name: "Generate regexes"
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Generate Repo Patterns using Gradle
run: |
./gradlew generateRepoPatterns --stacktrace
- uses: actions/upload-artifact@v3
name: Upload generated repo regexes
with:
name: Repo Regexes
path: build/regexes/constants.json
publish-regexes:
runs-on: ubuntu-latest
needs: regexes
name: "Publish regexes"
if: ${{ 'push' == github.event_name && 'beta' == github.ref_name }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ env.data_repo }}
branch: main
- uses: actions/download-artifact@v3
name: Upload generated repo regexes
with:
name: Repo Regexes
- name: Commit generated regex
run: |
mkdir -p constants/
mv constants.json constants/regexes.json
git config user.name 'github-actions[bot]'
git config user.email '[email protected]'
git add constants/regexes.json
git commit -m "Update regexes based on https://github.com/hannibal002/Skyhanni/commit/$GITHUB_SHA"
- name: Publish new repository
run: |
git config --unset-all http.https://github.com/.extraheader
git remote add restream https://user:${{secrets.REPO_PAT}}@github.com/${{env.data_repo}}
git push restream HEAD:main
20 changes: 12 additions & 8 deletions DISCORD_FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ _Frequently Asked Questions_
> To make the mod work, you need to use the latest version from <#1123201092193366027>.
> **3: How can I resize the GUI?**
> Do `/sh gui` to open the position editor. Then hover over a element and scroll your mouse wheel to change the size of a single gui element.
> Do `/sh scale` to change the global gui scale of all elements at once.
> Do `/sh gui` to open the position editor. Then hover over an element and scroll your mouse wheel to change the size of a single GUI element.
> Do `/sh scale` to change the global GUI scale of all elements at once.
> **4: My Garden Crop Milestones are not accurate. What should I do?**
> To sync your Crop Milestones with SkyHanni, open /cropmilestones once.
Expand All @@ -19,15 +19,19 @@ _Frequently Asked Questions_
> **6: Will SkyHanni support Minecraft versions 1.19 or 1.20? (Foraging Update)**
> The Foraging update isn't expected to release for several months.
> Thus, we'll wait for other mods in the community to update for Minecraft versions 1.19 or 1.20.
> Switching from 1.8.9 to 1.19 should only take a couple of days, and we plan to discontinue support for 1.8.9 afterward since we won't support multiple versions at once.
> Switching from 1.8.9 to 1.19 will take some time, and we plan to discontinue support for 1.8.9 afterward since we won't support multiple versions at once.
> **7: Does the barn fishing timer work on the Crimson Isle?**
> No, the barn fishing timer is not supported in the Crimson Isle in Hypixel Skyblock because it would disrupt other fishers due to competition for the maximum sea creature cap, potentially leading to conflicts and stealing of sea creatures.
> **8: My Jacob Contest Display crops are wrong, how do I fix this?**
> **7: My Jacob Contest Display crops are wrong, how do I fix this?**
> 1. Close your minecraft.
> 2. Delete ".minecraft\config\skyhanni\jacob_contests.json".
> 3. Open minecraft.
*This FAQ was last updated on december 05th, 2023.
> **8: How can I get bigger crop hit boxes?**
> Use [Patcher](<https://sk1er.club/mods/patcher>) to have 1.12 hit boxes in 1.8.9.
> **9: Why does my Item Tracker feature not track this item?**
> Check if the item goes directly into your sacks. If it does, enable the sack pickup chat message from Hypixel.
> You can use SkyHanni's own setting to still hide the message from chat.
*This FAQ was last updated on December 08th, 2023.
If you believe there's something that should be added to this list, please tell us, so we can add it.*
36 changes: 36 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.ByteArrayOutputStream

plugins {
idea
Expand All @@ -13,6 +14,16 @@ plugins {
group = "at.hannibal2.skyhanni"
version = "0.22.Beta.8"

val gitHash by lazy {
val baos = ByteArrayOutputStream()
exec {
standardOutput = baos
commandLine("git", "rev-parse", "--short", "HEAD")
isIgnoreExitValue = true
}
baos.toByteArray().decodeToString().trim()
}

// Toolchains:
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand Down Expand Up @@ -51,6 +62,11 @@ val devenvMod: Configuration by configurations.creating {
isVisible = false
}

val headlessLwjgl by configurations.creating {
isTransitive = false
isVisible = false
}

dependencies {
minecraft("com.mojang:minecraft:1.8.9")
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9")
Expand All @@ -63,7 +79,9 @@ dependencies {
exclude(module = "gson")
because("Different version conflicts with Minecraft's Log4j")
}
compileOnly(libs.jbAnnotations)

headlessLwjgl(libs.headlessLwjgl)

shadowImpl("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
isTransitive = false
Expand Down Expand Up @@ -149,6 +167,24 @@ tasks.processResources {
}
}

val generateRepoPatterns by tasks.creating(JavaExec::class) {
javaLauncher.set(javaToolchains.launcherFor(java.toolchain))
mainClass.set("net.fabricmc.devlaunchinjector.Main")
workingDir(project.file("run"))
classpath(sourceSets.main.map { it.runtimeClasspath }, sourceSets.main.map { it.output })
jvmArgs(
"-Dfabric.dli.config=${project.file(".gradle/loom-cache/launch.cfg").absolutePath}",
"-Dfabric.dli.env=client",
"-Dfabric.dli.main=net.minecraft.launchwrapper.Launch",
"-Dorg.lwjgl.opengl.Display.allowSoftwareOpenGL=true",
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006",
"-javaagent:${headlessLwjgl.singleFile.absolutePath}"
)
val outputFile = project.file("build/regexes/constants.json")
environment("SKYHANNI_DUMP_REGEXES", "${gitHash}:${outputFile.absolutePath}")
environment("SKYHANNI_DUMP_REGEXES_EXIT", "true")
}

tasks.compileJava {
dependsOn(tasks.processResources)
}
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[versions]
libautoupdate = "1.0.3"
moulconfig = "2.5.0"
headlessLwjgl = "1.7.2"
jbAnnotations = "24.1.0"

[libraries]
moulconfig = { module = "org.notenoughupdates.moulconfig:legacy", version.ref = "moulconfig" }
libautoupdate = { module = "moe.nea:libautoupdate", version.ref = "libautoupdate" }
headlessLwjgl = { module = "com.github.3arthqu4ke.HeadlessMc:headlessmc-lwjgl", version.ref = "headlessLwjgl" }
jbAnnotations = { module = "org.jetbrains:annotations", version.ref = "jbAnnotations" }
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ pluginManagement {
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.6.0")
}

rootProject.name = "SkyHanni"
4 changes: 4 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.KnownFeaturesJson
import at.hannibal2.skyhanni.data.repo.RepoManager
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.PreInitFinishedEvent
import at.hannibal2.skyhanni.features.anvil.AnvilCombineHelper
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
import at.hannibal2.skyhanni.features.bazaar.BazaarBestSellMethod
Expand Down Expand Up @@ -327,6 +328,7 @@ import at.hannibal2.skyhanni.utils.KeyboardManager
import at.hannibal2.skyhanni.utils.MinecraftConsoleFilter.Companion.initLogging
import at.hannibal2.skyhanni.utils.NEUVersionCheck.checkIfNeuIsLoaded
import at.hannibal2.skyhanni.utils.TabListData
import at.hannibal2.skyhanni.utils.repopatterns.RepoPatternManager
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -661,6 +663,7 @@ class SkyHanniMod {
loadModule(DungeonFinderFeatures())
loadModule(PabloHelper())
loadModule(FishingBaitWarnings())
loadModule(RepoPatternManager)
loadModule(PestSpawn())
loadModule(PestSpawnTimer)
loadModule(PestFinder())
Expand All @@ -682,6 +685,7 @@ class SkyHanniMod {
loadModule(TestShowSlotNumber())
loadModule(SkyHanniDebugsAndTests)
loadModule(HotSwapDetection)
PreInitFinishedEvent().postAndCatch()
}

@Mod.EventHandler
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.KnownFeaturesJson
import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity
import at.hannibal2.skyhanni.features.misc.update.UpdateManager
import at.hannibal2.skyhanni.utils.KotlinTypeAdapterFactory
import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzRarity
import at.hannibal2.skyhanni.utils.LorenzUtils
Expand Down Expand Up @@ -49,6 +50,7 @@ class ConfigManager {
.excludeFieldsWithoutExposeAnnotation()
.serializeSpecialFloatingPointValues()
.registerTypeAdapterFactory(PropertyTypeAdapterFactory())
.registerTypeAdapterFactory(KotlinTypeAdapterFactory())
.registerTypeAdapter(UUID::class.java, object : TypeAdapter<UUID>() {
override fun write(out: JsonWriter, value: UUID) {
out.value(value.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.data.ChatManager
import at.hannibal2.skyhanni.data.GardenCropMilestonesCommunityFix
import at.hannibal2.skyhanni.data.GuiEditManager
import at.hannibal2.skyhanni.data.PartyAPI
import at.hannibal2.skyhanni.data.TitleManager
import at.hannibal2.skyhanni.features.bingo.card.BingoCardDisplay
import at.hannibal2.skyhanni.features.bingo.card.nextstephelper.BingoNextStepHelper
import at.hannibal2.skyhanni.features.chat.Translator
Expand Down Expand Up @@ -55,6 +56,7 @@ import at.hannibal2.skyhanni.utils.APIUtil
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.SoundUtils
import at.hannibal2.skyhanni.utils.TabListData
import at.hannibal2.skyhanni.utils.repopatterns.RepoPatternGui
import net.minecraft.client.Minecraft
import net.minecraft.command.ICommandSender
import net.minecraft.event.ClickEvent
Expand Down Expand Up @@ -265,6 +267,7 @@ object Commands {
}

private fun developersCodingHelp() {
registerCommand("shrepopatterns", "See where regexes are loaded from") { RepoPatternGui.open() }
registerCommand("shtest", "Unused test command.") { SkyHanniDebugsAndTests.testCommand(it) }
registerCommand("shdebugwaypoint", "Mark a waypoint on that location") { SkyHanniDebugsAndTests.waypoint(it) }
registerCommand("shdebugtablist", "Set your clipboard as a fake tab list.") { TabListData.toggleDebugCommand() }
Expand Down Expand Up @@ -316,6 +319,10 @@ object Commands {
"shplaysound",
"Play the specified sound effect at the given pitch and volume."
) { SoundUtils.command(it) }
registerCommand(
"shsendtitle",
"Display a title on the screen with the specified settings."
) { TitleManager.command(it) }
registerCommand(
"shconfigmanagerreset",
"Reloads the config manager and rendering processors of MoulConfig. This §cWILL RESET §7your config, but also updating the java config files (names, description, orderings and stuff)."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public class DevConfig {
@Accordion
public DebugConfig debug = new DebugConfig();

@Expose
@ConfigOption(name = "RepoPattern", desc = "")
@Accordion
public RepoPatternConfig repoPattern = new RepoPatternConfig();

@Expose
@ConfigOption(name = "Slot Number", desc = "Show slot number in inventory while pressing this key.")
@ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package at.hannibal2.skyhanni.config.features.dev;

import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.observer.Property;

public class RepoPatternConfig {
@Expose
@ConfigOption(name = "Force Local Loading", desc = "Force loading local patterns.")
@ConfigEditorBoolean
public Property<Boolean> forceLocal = Property.of(false);

@Expose
@ConfigOption(name = "Tolerate Duplicate Usages", desc = "Don't crash when two or more code locations use the same RepoPattern key")
@ConfigEditorBoolean
public boolean tolerateDuplicateUsage = false;

@Expose
@ConfigOption(name = "Tolerate Late Registration", desc = "Don't crash when a RepoPattern is obtained after preinitialization.")
@ConfigEditorBoolean
public boolean tolerateLateRegistration = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.features.garden.CropType;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown;
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
import io.github.moulberry.moulconfig.annotations.ConfigOption;

import java.util.ArrayList;
import java.util.List;

public class NextJacobContestConfig {
@Expose
@ConfigOption(name = "Show Jacob's Contest", desc = "Show the current or next Jacob's farming contest time and crops.")
Expand Down Expand Up @@ -54,6 +59,14 @@ public class NextJacobContestConfig {
@ConfigEditorBoolean
public boolean warnPopup = false;

@Expose
@ConfigOption(
name = "Warn For",
desc = "Only warn for these crops."
)
@ConfigEditorDraggableList
public List<CropType> warnFor = new ArrayList<>(CropType.getEntries());

@Expose
public Position pos = new Position(-200, 10, false, true);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,47 @@
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind;
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import org.lwjgl.input.Keyboard;

public class PestFinderConfig {

@Expose
@ConfigOption(
name = "Display",
desc = "Show a display with all know pest locations."
name = "Display",
desc = "Show a display with all know pest locations."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean showDisplay = true;

@Expose
@ConfigOption(
name = "Show Plot in World",
desc = "Mark infected plot names and world border in the world."
name = "Show Plot in World",
desc = "Mark infected plot names and world border in the world."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean showPlotInWorld = true;

@Expose
@ConfigOption(
name = "Only With Vacuum",
desc = "Only show the pest display and waypoints while holding a vacuum in the hand."
name = "Only With Vacuum",
desc = "Only show the pest display and waypoints while holding a vacuum in the hand."
)
@ConfigEditorBoolean
public boolean onlyWithVacuum = true;

@Expose
@ConfigOption(
name = "Show For Seconds",
desc = "Show plots border for a given amount of seconds after holding a vacuum.\n" +
"§e0 = Always show when holding vacuum"
)
@ConfigEditorSlider(minStep = 1, minValue = 0, maxValue = 10)
public int showBorderForSeconds = 1;

@Expose
public Position position = new Position(-350, 200, 1.3f);

Expand Down
Loading

0 comments on commit a5a820a

Please sign in to comment.