diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-02 06:12:23 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-02 06:12:23 +0700 |
commit | d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051 (patch) | |
tree | 9bb9b53e2823f73084780673763504f4098bae69 /versions/src/main/kotlin/cc/polyfrost/oneconfig | |
parent | d2b1d57120bb51e76191302a58d935afe52b89df (diff) | |
download | OneConfig-d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051.tar.gz OneConfig-d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051.tar.bz2 OneConfig-d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051.zip |
Separate Minecraft dependant and non-dependant code
Diffstat (limited to 'versions/src/main/kotlin/cc/polyfrost/oneconfig')
-rw-r--r-- | versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt | 9 | ||||
-rw-r--r-- | versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/GuiUtilsDSL.kt | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt b/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt new file mode 100644 index 0000000..c8c18e4 --- /dev/null +++ b/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt @@ -0,0 +1,9 @@ +package cc.polyfrost.oneconfig.utils.dsl + +import cc.polyfrost.oneconfig.libs.universal.UMinecraft + +/** + * Gets the current [net.minecraft.client.Minecraft] instance. + */ +val mc + get() = UMinecraft.getMinecraft()
\ No newline at end of file diff --git a/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/GuiUtilsDSL.kt b/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/GuiUtilsDSL.kt new file mode 100644 index 0000000..c70f686 --- /dev/null +++ b/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/GuiUtilsDSL.kt @@ -0,0 +1,11 @@ +package cc.polyfrost.oneconfig.utils.dsl + +import cc.polyfrost.oneconfig.utils.gui.GuiUtils +import net.minecraft.client.gui.GuiScreen + +/** + * Displays a screen after the specified amount of ticks. + * + * @param ticks the amount of ticks to wait for before displaying the screen. + */ +fun GuiScreen.openScreen(ticks: Int = 1) = GuiUtils.displayScreen(this, ticks)
\ No newline at end of file |