Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
1eb2e5ee6c | |||
b6c4223da5 | |||
e10f66a0c0 | |||
c3f5be60ed | |||
3373405b9c | |||
13e816401b | |||
82c40c3047 | |||
91d881392e | |||
![]() |
89dcc87487 |
@ -1,73 +0,0 @@
|
|||||||
kotlin version: 2.0.0
|
|
||||||
error message: Daemon compilation failed: null
|
|
||||||
java.lang.Exception
|
|
||||||
at org.jetbrains.kotlin.daemon.common.CompileService$CallResult$Error.get(CompileService.kt:69)
|
|
||||||
at org.jetbrains.kotlin.daemon.common.CompileService$CallResult$Error.get(CompileService.kt:65)
|
|
||||||
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemon(GradleKotlinCompilerWork.kt:240)
|
|
||||||
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemonOrFallbackImpl(GradleKotlinCompilerWork.kt:159)
|
|
||||||
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:111)
|
|
||||||
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction.execute(GradleCompilerRunnerWithWorkers.kt:76)
|
|
||||||
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
|
|
||||||
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
|
|
||||||
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
|
|
||||||
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
|
|
||||||
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
|
|
||||||
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
|
|
||||||
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
|
|
||||||
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:209)
|
|
||||||
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
|
|
||||||
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
|
|
||||||
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
|
|
||||||
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
|
|
||||||
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
|
|
||||||
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
|
|
||||||
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
|
|
||||||
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
|
|
||||||
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:174)
|
|
||||||
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
|
|
||||||
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)
|
|
||||||
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)
|
|
||||||
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
|
|
||||||
at org.gradle.internal.Factories$1.create(Factories.java:31)
|
|
||||||
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:264)
|
|
||||||
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:128)
|
|
||||||
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:133)
|
|
||||||
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
|
|
||||||
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
|
|
||||||
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
|
|
||||||
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
|
|
||||||
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
|
|
||||||
at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
|
|
||||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
|
|
||||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
|
|
||||||
at java.base/java.lang.Thread.run(Thread.java:833)
|
|
||||||
Caused by: java.nio.file.NoSuchFileException: C:\Users\illyum\AppData\Local\Temp\kotlin-backups14211537242402827334\7.backup -> O:\Kotlin Programming\sbt\build\classes\java\main\com\github\itzilly\sbt\KeyInputHandler.class
|
|
||||||
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
|
|
||||||
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
|
|
||||||
at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:403)
|
|
||||||
at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293)
|
|
||||||
at java.base/java.nio.file.Files.move(Files.java:1432)
|
|
||||||
at org.jetbrains.kotlin.incremental.RecoverableCompilationTransaction.revertChanges(CompilationTransaction.kt:231)
|
|
||||||
at org.jetbrains.kotlin.incremental.RecoverableCompilationTransaction.close(CompilationTransaction.kt:256)
|
|
||||||
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.tryCompileIncrementally(IncrementalCompilerRunner.kt:747)
|
|
||||||
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:120)
|
|
||||||
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:676)
|
|
||||||
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:92)
|
|
||||||
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1661)
|
|
||||||
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
|
||||||
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
|
|
||||||
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
|
||||||
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
|
|
||||||
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
|
|
||||||
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
|
|
||||||
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
|
|
||||||
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
|
|
||||||
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
|
|
||||||
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
|
|
||||||
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
|
|
||||||
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
|
|
||||||
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
|
|
||||||
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
|
|
||||||
... 3 more
|
|
||||||
|
|
||||||
|
|
10
CHANGELOG.md
Normal file
10
CHANGELOG.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## [1.4.0] - 2024-07-23
|
||||||
|
|
||||||
|
### Chore
|
||||||
|
|
||||||
|
- Remove comments
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- *(chestesp)* Add initial implementation, halfway done
|
||||||
|
|
@ -1,4 +1,5 @@
|
|||||||
import org.apache.commons.lang3.SystemUtils
|
import org.apache.commons.lang3.SystemUtils
|
||||||
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
idea
|
idea
|
||||||
@ -9,25 +10,24 @@ plugins {
|
|||||||
kotlin("jvm") version "2.0.0"
|
kotlin("jvm") version "2.0.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
//Constants:
|
|
||||||
|
|
||||||
val baseGroup: String by project
|
val baseGroup: String by project
|
||||||
val mcVersion: String by project
|
val mcVersion: String by project
|
||||||
val version: String by project
|
val versionBase: String by project
|
||||||
val mixinGroup = "$baseGroup.mixin"
|
val buildNumber: String by project
|
||||||
val modid: String by project
|
val modid: String by project
|
||||||
|
val mixinGroup = "$baseGroup.mixin"
|
||||||
|
|
||||||
|
group = baseGroup
|
||||||
|
version = "$versionBase-b$buildNumber"
|
||||||
|
|
||||||
// Toolchains:
|
|
||||||
java {
|
java {
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
|
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minecraft configuration:
|
|
||||||
loom {
|
loom {
|
||||||
log4jConfigs.from(file("log4j2.xml"))
|
log4jConfigs.from(file("log4j2.xml"))
|
||||||
launchConfigs {
|
launchConfigs {
|
||||||
"client" {
|
"client" {
|
||||||
// If you don't want mixins, remove these lines
|
|
||||||
property("mixin.debug", "true")
|
property("mixin.debug", "true")
|
||||||
arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
|
arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
|
||||||
}
|
}
|
||||||
@ -35,7 +35,6 @@ loom {
|
|||||||
runConfigs {
|
runConfigs {
|
||||||
"client" {
|
"client" {
|
||||||
if (SystemUtils.IS_OS_MAC_OSX) {
|
if (SystemUtils.IS_OS_MAC_OSX) {
|
||||||
// This argument causes a crash on macOS
|
|
||||||
vmArgs.remove("-XstartOnFirstThread")
|
vmArgs.remove("-XstartOnFirstThread")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,10 +42,8 @@ loom {
|
|||||||
}
|
}
|
||||||
forge {
|
forge {
|
||||||
pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter())
|
pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter())
|
||||||
// If you don't want mixins, remove this lines
|
|
||||||
mixinConfig("mixins.$modid.json")
|
mixinConfig("mixins.$modid.json")
|
||||||
}
|
}
|
||||||
// If you don't want mixins, remove these lines
|
|
||||||
mixin {
|
mixin {
|
||||||
defaultRefmapName.set("mixins.$modid.refmap.json")
|
defaultRefmapName.set("mixins.$modid.refmap.json")
|
||||||
}
|
}
|
||||||
@ -62,12 +59,9 @@ sourceSets.main {
|
|||||||
kotlin.destinationDirectory.set(java.destinationDirectory)
|
kotlin.destinationDirectory.set(java.destinationDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dependencies:
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://repo.spongepowered.org/maven/")
|
maven("https://repo.spongepowered.org/maven/")
|
||||||
// If you don't want to log in with your real minecraft account, remove this line
|
|
||||||
maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1")
|
maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,30 +76,24 @@ dependencies {
|
|||||||
|
|
||||||
shadowImpl(kotlin("stdlib-jdk8"))
|
shadowImpl(kotlin("stdlib-jdk8"))
|
||||||
|
|
||||||
// If you don't want mixins, remove these lines
|
|
||||||
shadowImpl("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
|
shadowImpl("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
|
||||||
isTransitive = false
|
isTransitive = false
|
||||||
}
|
}
|
||||||
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT")
|
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT")
|
||||||
|
|
||||||
// If you don't want to log in with your real minecraft account, remove this line
|
|
||||||
runtimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.2.1")
|
runtimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.2.1")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tasks:
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile::class) {
|
tasks.withType(JavaCompile::class) {
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(org.gradle.jvm.tasks.Jar::class) {
|
tasks.withType(org.gradle.jvm.tasks.Jar::class) {
|
||||||
archiveBaseName.set(modid)
|
archiveBaseName.set(modid)
|
||||||
|
archiveVersion.set("$version")
|
||||||
manifest.attributes.run {
|
manifest.attributes.run {
|
||||||
this["FMLCorePluginContainsFMLMod"] = "true"
|
this["FMLCorePluginContainsFMLMod"] = "true"
|
||||||
this["ForceLoadAsMod"] = "true"
|
this["ForceLoadAsMod"] = "true"
|
||||||
|
|
||||||
// If you don't want mixins, remove these lines
|
|
||||||
this["TweakClass"] = "org.spongepowered.asm.launch.MixinTweaker"
|
this["TweakClass"] = "org.spongepowered.asm.launch.MixinTweaker"
|
||||||
this["MixinConfigs"] = "mixins.$modid.json"
|
this["MixinConfigs"] = "mixins.$modid.json"
|
||||||
}
|
}
|
||||||
@ -124,7 +112,6 @@ tasks.processResources {
|
|||||||
rename("(.+_at.cfg)", "META-INF/$1")
|
rename("(.+_at.cfg)", "META-INF/$1")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val remapJar by tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar") {
|
val remapJar by tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar") {
|
||||||
archiveClassifier.set("")
|
archiveClassifier.set("")
|
||||||
from(tasks.shadowJar)
|
from(tasks.shadowJar)
|
||||||
@ -145,12 +132,13 @@ tasks.shadowJar {
|
|||||||
println("Copying dependencies into mod: ${it.files}")
|
println("Copying dependencies into mod: ${it.files}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you want to include other dependencies and shadow them, you can relocate them in here
|
|
||||||
fun relocate(name: String) = relocate(name, "$baseGroup.deps.$name")
|
fun relocate(name: String) = relocate(name, "$baseGroup.deps.$name")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.assemble.get().dependsOn(tasks.remapJar)
|
tasks.assemble {
|
||||||
|
dependsOn(tasks.remapJar)
|
||||||
|
dependsOn("incrementBuildNumber")
|
||||||
|
}
|
||||||
|
|
||||||
tasks.register<Copy>("illyExtractMappings") {
|
tasks.register<Copy>("illyExtractMappings") {
|
||||||
from("O:/.gradle")
|
from("O:/.gradle")
|
||||||
@ -160,7 +148,6 @@ tasks.register<Copy>("illyExtractMappings") {
|
|||||||
tasks.register("illyApplyMappings") {
|
tasks.register("illyApplyMappings") {
|
||||||
dependsOn("illyExtractMappings")
|
dependsOn("illyExtractMappings")
|
||||||
doLast {
|
doLast {
|
||||||
// throw GradleException("${layout.buildDirectory.d}/mcp_mappings")
|
|
||||||
val mappingsDir = file("O:/Kotlin Programming/sbt/build/mcp_mappings")
|
val mappingsDir = file("O:/Kotlin Programming/sbt/build/mcp_mappings")
|
||||||
if (mappingsDir.exists()) {
|
if (mappingsDir.exists()) {
|
||||||
project.ext.set("mappingsPath", mappingsDir.absolutePath)
|
project.ext.set("mappingsPath", mappingsDir.absolutePath)
|
||||||
@ -176,3 +163,19 @@ tasks.withType<JavaCompile> {
|
|||||||
options.compilerArgs.add("-Amap=O:/Kotlin Programming/sbt/build/mcp_mappings")
|
options.compilerArgs.add("-Amap=O:/Kotlin Programming/sbt/build/mcp_mappings")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 🔁 Auto-increment build number each assemble
|
||||||
|
tasks.register("incrementBuildNumber") {
|
||||||
|
doLast {
|
||||||
|
val propsFile = file("gradle.properties")
|
||||||
|
val props = Properties()
|
||||||
|
props.load(propsFile.inputStream())
|
||||||
|
|
||||||
|
val current = props.getProperty("buildNumber")?.toIntOrNull() ?: 1
|
||||||
|
val next = current + 1
|
||||||
|
props.setProperty("buildNumber", next.toString())
|
||||||
|
props.store(propsFile.outputStream(), null)
|
||||||
|
|
||||||
|
println("🔢 Build number incremented to $next")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
36
cliff.toml
Normal file
36
cliff.toml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# cliff.toml
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
title = "Changelog"
|
||||||
|
description = "All notable changes to this project will be documented in this file."
|
||||||
|
repository_url = "http://localhost:3001/illyum/sbt-stash"
|
||||||
|
template = """
|
||||||
|
# {{version}} - {{date}}
|
||||||
|
{% for group, commits in commits | group_by(attribute="group") %}
|
||||||
|
### {{group | upper_first}}
|
||||||
|
{% for commit in commits %}
|
||||||
|
- {{ commit.message | upper_first }} ({% if commit.breaking %}! {% endif %}{{ commit.hash }})
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
"""
|
||||||
|
|
||||||
|
[git]
|
||||||
|
commit_parsers = [
|
||||||
|
{ message = "^\\(Chore\\)", group = "Chore" },
|
||||||
|
{ message = "^\\(BugFix\\)", group = "Bug Fixes" },
|
||||||
|
{ message = "^\\(Feat\\)", group = "Features" },
|
||||||
|
{ message = "^\\(Docs\\)", group = "Documentation" },
|
||||||
|
{ message = "^\\(Refactor\\)", group = "Refactor" },
|
||||||
|
{ message = "^\\(Test\\)", group = "Tests" },
|
||||||
|
{ message = "^\\(Style\\)", group = "Styling" },
|
||||||
|
{ message = "^\\(Perf\\)", group = "Performance" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[git.tag]
|
||||||
|
pattern = "^v[0-9]+"
|
||||||
|
|
||||||
|
[git.commit]
|
||||||
|
conventional = false
|
||||||
|
|
||||||
|
[git.filters]
|
||||||
|
exclude_merge_commits = true
|
33
docs/CONTRIBUTING.md
Normal file
33
docs/CONTRIBUTING.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Contributing to This Project
|
||||||
|
|
||||||
|
Thank you for your interest in contributing to this project! Please read the following guidelines to understand how you can contribute.
|
||||||
|
|
||||||
|
## Private Repository
|
||||||
|
|
||||||
|
This is a **private repository**. While you're welcome to file issues and suggest ideas, please note that this project is primarily a personal endeavor. Contributions from the community are appreciated, but they might not always be incorporated.
|
||||||
|
|
||||||
|
## Filing Issues
|
||||||
|
|
||||||
|
If you encounter any issues or have suggestions for improvements, feel free to [open an issue](https://github.com/your-repo/issues) (or email me). Please be as detailed as possible when describing the problem or idea. I appreciate your input!
|
||||||
|
|
||||||
|
## Contributing Fixes
|
||||||
|
|
||||||
|
If you have a fix that you'd like to contribute:
|
||||||
|
- Please do **not** submit a pull request directly.
|
||||||
|
- Instead, email the developer at [developer@itzilly.com](mailto:developer@itzilly.com) with details about your fix.
|
||||||
|
- If the fix aligns with the project's goals and standards, you'll receive guidance on how to proceed.
|
||||||
|
|
||||||
|
## Suggesting Ideas
|
||||||
|
|
||||||
|
I welcome ideas and suggestions! However, please keep in mind:
|
||||||
|
- This project is more of a personal project, so while all ideas are welcome, not every suggestion will be implemented.
|
||||||
|
- Feel free to suggest ideas by [opening an issue](https://github.com/404) and detailing your thoughts.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
Please remember to be respectful and constructive when engaging with this project. At the end of the day, this is just my project.
|
||||||
|
|
||||||
|
Thank you for your understanding and for contributing to this project!
|
||||||
|
|
||||||
|
# Note for persons with a Gitea account
|
||||||
|
If you have access to an account with elevated permissions on this repo, you're welcome to commit code/make pull requests.
|
55
docs/DEVELOPER_NOTICE.md
Normal file
55
docs/DEVELOPER_NOTICE.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# Developer Notice
|
||||||
|
|
||||||
|
Welcome to my project! This is primarily a personal project, and while I'm happy to have others take an interest, it's important to follow the guidelines below to ensure consistency and maintainability. (This is mostly for my reference)
|
||||||
|
|
||||||
|
|
||||||
|
## Conventional Commits
|
||||||
|
|
||||||
|
I use [Conventional Commits](https://www.conventionalcommits.org/) for all commit messages. This means that every commit should follow this format:
|
||||||
|
|
||||||
|
```
|
||||||
|
<type>(<scope>): <description>
|
||||||
|
```
|
||||||
|
- **Type:** The type of change you're committing. Common types include `feat` (new feature), `fix` (bug fix), `docs` (documentation only changes), `style` (code style, formatting, etc.), `refactor` (refactoring code), `test` (adding or updating tests), and `chore` (other changes that don't modify src or test files).
|
||||||
|
- **Scope:** An optional field that describes the part of the codebase the change affects (e.g., `api`, `config`, `ui`).
|
||||||
|
- **Description:** A brief description of the change.
|
||||||
|
|
||||||
|
Example commit message:
|
||||||
|
|
||||||
|
```
|
||||||
|
feat(api): add new endpoint for user data
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
chore(release): bump version to 1.4.3
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
style(ui): clean up redundant CSS classes in header component
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
fix(auth): resolve login redirect loop issue
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
merge(pr-45): integrate feature-x from pull request #45
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Branching Strategy
|
||||||
|
|
||||||
|
Branches are primarily for adding new features. However, while the project is in pre-release, it's okay to work on minor features directly on the `main` branch. Just make sure you:
|
||||||
|
|
||||||
|
- Commit all changes for the feature at once.
|
||||||
|
- Avoid having partial changes spread across multiple commits. Each commit should represent a complete and functional piece of work.
|
||||||
|
|
||||||
|
## Versioning
|
||||||
|
|
||||||
|
The versioning scheme I use is simple:
|
||||||
|
|
||||||
|
- **Patch version:** Bumped when small, incremental changes or bug fixes are made. For example, `x.x.y` to `x.x.y + 1`.
|
||||||
|
- **Minor version:** Typically, if a feature is added or updated, the version may stay the same until the project exits pre-release. Version `2.x.x` will be used if the project ever gets out of pre-release.
|
||||||
|
- **Major version:** Reserved for significant changes, like command updates, configuration overhauls, or substantial new features.
|
||||||
|
|
||||||
|
Remember, this is my project, so while I'm open to contributions and suggestions, I maintain the final say on what gets merged or included. Thanks for your understanding and contributions!
|
@ -1,6 +1,8 @@
|
|||||||
|
#Sat Apr 19 14:54:37 MDT 2025
|
||||||
|
versionBase=1.5.0
|
||||||
loom.platform=forge
|
loom.platform=forge
|
||||||
|
baseGroup=com.github.itzilly.sbt
|
||||||
|
mcVersion=1.8.9
|
||||||
org.gradle.jvmargs=-Xmx2g
|
org.gradle.jvmargs=-Xmx2g
|
||||||
baseGroup = com.github.itzilly.sbt
|
buildNumber=107
|
||||||
mcVersion = 1.8.9
|
modid=sbt
|
||||||
modid = sbt
|
|
||||||
version = 1.4.4
|
|
||||||
|
@ -7,7 +7,7 @@ pluginManagement {
|
|||||||
maven("https://maven.fabricmc.net")
|
maven("https://maven.fabricmc.net")
|
||||||
maven("https://maven.minecraftforge.net/")
|
maven("https://maven.minecraftforge.net/")
|
||||||
maven("https://repo.spongepowered.org/maven/")
|
maven("https://repo.spongepowered.org/maven/")
|
||||||
maven("https://repo.sk1er.club/repository/maven-releases/")
|
maven("https://repo.essential.gg/repository/maven-releases/")
|
||||||
}
|
}
|
||||||
resolutionStrategy {
|
resolutionStrategy {
|
||||||
eachPlugin {
|
eachPlugin {
|
||||||
|
@ -12,6 +12,13 @@ object STBKeyBinds {
|
|||||||
lateinit var findGemstones: KeyBinding
|
lateinit var findGemstones: KeyBinding
|
||||||
lateinit var clearGemstones: KeyBinding
|
lateinit var clearGemstones: KeyBinding
|
||||||
|
|
||||||
|
lateinit var toggleLeftWalk: KeyBinding
|
||||||
|
lateinit var toggleRightWalk: KeyBinding
|
||||||
|
lateinit var toggleForwardWalk: KeyBinding
|
||||||
|
lateinit var toggleBackwardWalk: KeyBinding
|
||||||
|
|
||||||
|
lateinit var toggleLeftMouse: KeyBinding
|
||||||
|
|
||||||
fun init() {
|
fun init() {
|
||||||
searchForChests = KeyBinding("key.xraySearch", Keyboard.KEY_F10, "key.categories.sbt")
|
searchForChests = KeyBinding("key.xraySearch", Keyboard.KEY_F10, "key.categories.sbt")
|
||||||
ClientRegistry.registerKeyBinding(searchForChests)
|
ClientRegistry.registerKeyBinding(searchForChests)
|
||||||
@ -30,5 +37,23 @@ object STBKeyBinds {
|
|||||||
|
|
||||||
clearGemstones = KeyBinding("key.clearGemstones", Keyboard.KEY_K, "key.categories.sbt")
|
clearGemstones = KeyBinding("key.clearGemstones", Keyboard.KEY_K, "key.categories.sbt")
|
||||||
ClientRegistry.registerKeyBinding(clearGemstones)
|
ClientRegistry.registerKeyBinding(clearGemstones)
|
||||||
|
|
||||||
|
// -----------------------
|
||||||
|
// Macro Toggle
|
||||||
|
// -----------------------
|
||||||
|
toggleLeftWalk = KeyBinding("key.toggleLeftWalk", Keyboard.KEY_LEFT, "key.categories.sbt")
|
||||||
|
ClientRegistry.registerKeyBinding(toggleLeftWalk)
|
||||||
|
|
||||||
|
toggleRightWalk = KeyBinding("key.toggleRightWalk", Keyboard.KEY_RIGHT, "key.categories.sbt")
|
||||||
|
ClientRegistry.registerKeyBinding(toggleRightWalk)
|
||||||
|
|
||||||
|
toggleForwardWalk = KeyBinding("key.toggleForwardWalk", Keyboard.KEY_UP, "key.categories.sbt")
|
||||||
|
ClientRegistry.registerKeyBinding(toggleForwardWalk)
|
||||||
|
|
||||||
|
toggleBackwardWalk = KeyBinding("key.toggleBackwardWalk", Keyboard.KEY_DOWN, "key.categories.sbt")
|
||||||
|
ClientRegistry.registerKeyBinding(toggleBackwardWalk)
|
||||||
|
|
||||||
|
toggleLeftMouse = KeyBinding("key.toggleLeftMouse", Keyboard.KEY_PRIOR, "key.categories.sbt")
|
||||||
|
ClientRegistry.registerKeyBinding(toggleLeftMouse)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package com.github.itzilly.sbt
|
package com.github.itzilly.sbt
|
||||||
|
|
||||||
import com.github.itzilly.sbt.features.ChestEsp
|
import com.github.itzilly.sbt.features.ChestEsp
|
||||||
|
import com.github.itzilly.sbt.features.FarmHelper
|
||||||
import com.github.itzilly.sbt.features.GemstoneFinder
|
import com.github.itzilly.sbt.features.GemstoneFinder
|
||||||
import com.github.itzilly.sbt.features.GrottoFinder
|
import com.github.itzilly.sbt.features.GrottoFinder
|
||||||
import com.github.itzilly.sbt.features.router.RouteBuilder
|
import com.github.itzilly.sbt.features.router.RouteBuilder
|
||||||
@ -41,6 +42,7 @@ class SkyBlockTweaks {
|
|||||||
MinecraftForge.EVENT_BUS.register(GrottoFinder)
|
MinecraftForge.EVENT_BUS.register(GrottoFinder)
|
||||||
MinecraftForge.EVENT_BUS.register(ChestEsp)
|
MinecraftForge.EVENT_BUS.register(ChestEsp)
|
||||||
MinecraftForge.EVENT_BUS.register(GemstoneFinder)
|
MinecraftForge.EVENT_BUS.register(GemstoneFinder)
|
||||||
|
MinecraftForge.EVENT_BUS.register(FarmHelper)
|
||||||
|
|
||||||
ClientCommandHandler.instance.registerCommand(SBTCommand())
|
ClientCommandHandler.instance.registerCommand(SBTCommand())
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,105 @@
|
|||||||
package com.github.itzilly.sbt.features
|
package com.github.itzilly.sbt.features
|
||||||
|
|
||||||
|
import com.github.itzilly.sbt.STBKeyBinds.toggleLeftWalk;
|
||||||
|
import com.github.itzilly.sbt.features.gardener.CaneMacroer
|
||||||
|
import com.github.itzilly.sbt.util.Chatterbox
|
||||||
import net.minecraft.client.Minecraft
|
import net.minecraft.client.Minecraft
|
||||||
|
import net.minecraft.client.gui.Gui
|
||||||
|
import net.minecraft.client.gui.GuiChat
|
||||||
|
import net.minecraftforge.client.event.RenderGameOverlayEvent
|
||||||
|
import net.minecraftforge.common.MinecraftForge
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent
|
import net.minecraftforge.fml.common.gameevent.InputEvent
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent
|
||||||
|
import org.lwjgl.input.Keyboard
|
||||||
|
|
||||||
|
|
||||||
object FarmHelper {
|
object FarmHelper {
|
||||||
|
|
||||||
// private val mc: Minecraft = Minecraft.getMinecraft()
|
private val mc: Minecraft = Minecraft.getMinecraft()
|
||||||
// private var isPressingD = false
|
|
||||||
// private var isPressingMouse = false
|
private var isToggledLeft = false
|
||||||
// @SubscribeEvent
|
private var isToggledRight = false
|
||||||
// fun onPlayerTick(event: PlayerTickEvent) {
|
private var isToggledForward = false
|
||||||
// if (event.player === mc.thePlayer) {
|
private var isToggledBack = false
|
||||||
// if (isPressingD) {
|
private var isToggledAttack = false
|
||||||
// mc.thePlayer.moveStrafing = 1.0f // Simulate holding 'd'
|
|
||||||
// }
|
private var ignoreNextKeyUp = false
|
||||||
// if (isPressingMouse) {
|
private var lastToggleKeyCode = -1
|
||||||
// mc.gameSettings.keyBindAttack.setPressed(true) // Simulate mouse button down
|
|
||||||
// }
|
@SubscribeEvent
|
||||||
// }
|
fun onTick(event: TickEvent.ClientTickEvent) {
|
||||||
// }
|
if (mc.gameSettings.keyBindForward.isKeyDown) isToggledForward = false
|
||||||
|
if (mc.gameSettings.keyBindLeft.isKeyDown) isToggledLeft = false
|
||||||
|
if (mc.gameSettings.keyBindRight.isKeyDown) isToggledRight = false
|
||||||
|
if (mc.gameSettings.keyBindBack.isKeyDown) isToggledBack = false
|
||||||
|
if (mc.gameSettings.keyBindAttack.isKeyDown) isToggledAttack = false
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
fun onKeyInput(event: InputEvent.KeyInputEvent) {
|
||||||
|
val key = Keyboard.getEventKey()
|
||||||
|
val isPressed = Keyboard.getEventKeyState()
|
||||||
|
|
||||||
|
if (toggleLeftWalk.isPressed) {
|
||||||
|
Chatterbox.say("Enabled macro!")
|
||||||
|
CaneMacroer.isMacroToggled = true
|
||||||
|
MinecraftForge.EVENT_BUS.register(CaneMacroer)
|
||||||
|
CaneMacroer.mc.displayGuiScreen(GuiChat(""))
|
||||||
|
|
||||||
|
lastToggleKeyCode = key
|
||||||
|
ignoreNextKeyUp = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isPressed && ignoreNextKeyUp && key == lastToggleKeyCode) {
|
||||||
|
ignoreNextKeyUp = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CaneMacroer.isMacroToggled) {
|
||||||
|
Chatterbox.say("Macro disabled by input!")
|
||||||
|
CaneMacroer.isMacroToggled = false
|
||||||
|
CaneMacroer.stop()
|
||||||
|
MinecraftForge.EVENT_BUS.unregister(CaneMacroer)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// if (toggleLeftWalk.isPressed) isToggledLeft = !isToggledLeft
|
||||||
|
// if (toggleRightWalk.isPressed) isToggledRight = !isToggledRight
|
||||||
|
// if (toggleForwardWalk.isPressed) isToggledForward = !isToggledForward
|
||||||
|
// if (toggleBackwardWalk.isPressed) isToggledBack = !isToggledBack
|
||||||
|
// if (toggleLeftMouse.isPressed) isToggledAttack = !isToggledAttack
|
||||||
//
|
//
|
||||||
// @SubscribeEvent
|
// if (isToggledLeft) (mc.gameSettings.keyBindLeft as KeyBindingAccessor).setPressed(true)
|
||||||
// fun onKeyInput(event: KeyInputEvent) {
|
// if (isToggledRight) (mc.gameSettings.keyBindRight as KeyBindingAccessor).setPressed(true)
|
||||||
// if (mc.currentScreen == null) {
|
// if (isToggledForward) (mc.gameSettings.keyBindForward as KeyBindingAccessor).setPressed(true)
|
||||||
// if (event.getKey() === GLFW.GLFW_KEY_P && event.getAction() === GLFW.GLFW_PRESS) {
|
// if (isToggledBack) (mc.gameSettings.keyBindBack as KeyBindingAccessor).setPressed(true)
|
||||||
// isPressingD = !isPressingD // Toggle 'd' key
|
// if (isToggledAttack) (mc.gameSettings.keyBindAttack as KeyBindingAccessor).setPressed(true)
|
||||||
// }
|
}
|
||||||
// if (event.getKey() === GLFW.GLFW_KEY_O && event.getAction() === GLFW.GLFW_PRESS) {
|
|
||||||
// isPressingMouse = !isPressingMouse // Toggle mouse button
|
@SubscribeEvent
|
||||||
// mc.gameSettings.keyBindAttack.setPressed(isPressingMouse) // Set initial state
|
fun onRenderOverlay(event: RenderGameOverlayEvent.Text) {
|
||||||
// }
|
val x = 10f
|
||||||
// }
|
var y = 10f
|
||||||
// }
|
|
||||||
|
val toggledKeys = mutableListOf<String>()
|
||||||
|
if (isToggledForward) toggledKeys.add("W")
|
||||||
|
if (isToggledLeft) toggledKeys.add("A")
|
||||||
|
if (isToggledBack) toggledKeys.add("S")
|
||||||
|
if (isToggledRight) toggledKeys.add("D")
|
||||||
|
if (isToggledAttack) toggledKeys.add("Attack")
|
||||||
|
|
||||||
|
if (toggledKeys.isEmpty()) return
|
||||||
|
|
||||||
|
val boxWidth = 60
|
||||||
|
val boxHeight = 10 + toggledKeys.size * 10
|
||||||
|
|
||||||
|
Gui.drawRect((x - 2).toInt(), (y - 2).toInt(), (x + boxWidth).toInt(), (y + boxHeight).toInt(), 0x90000000.toInt())
|
||||||
|
|
||||||
|
for (label in toggledKeys) {
|
||||||
|
mc.fontRendererObj.drawStringWithShadow("[$label]", x, y, 0xFFFFFF)
|
||||||
|
y += 10f
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.github.itzilly.sbt.features
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft
|
||||||
|
import net.minecraft.client.settings.GameSettings
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent
|
||||||
|
|
||||||
|
object MacroInterface {
|
||||||
|
private val gs: GameSettings = Minecraft.getMinecraft().gameSettings
|
||||||
|
private var running: Boolean = false
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
private fun onClientTick(event: TickEvent.PlayerTickEvent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun stop() {
|
||||||
|
running = false
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.github.itzilly.sbt.features.gardener
|
||||||
|
|
||||||
|
import com.github.itzilly.sbt.mixin.KeyBindingAccessor
|
||||||
|
import com.github.itzilly.sbt.util.Chatterbox
|
||||||
|
import net.minecraft.client.Minecraft
|
||||||
|
import net.minecraft.client.gui.GuiChat
|
||||||
|
import net.minecraft.client.settings.KeyBinding
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent
|
||||||
|
|
||||||
|
|
||||||
|
object CaneMacroer {
|
||||||
|
var isMacroToggled: Boolean = false
|
||||||
|
val mc = Minecraft.getMinecraft()
|
||||||
|
val allowedScreens = listOf(GuiChat::class.java)
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
fun onTick(event: ClientTickEvent) {
|
||||||
|
if (event.phase != TickEvent.Phase.END) return
|
||||||
|
if (!isMacroToggled) return
|
||||||
|
|
||||||
|
val currentScreen = mc.currentScreen
|
||||||
|
|
||||||
|
if (currentScreen != null && allowedScreens.none { it.isInstance(currentScreen) }) {
|
||||||
|
Chatterbox.say("Macro stopped: Invalid screen")
|
||||||
|
stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val mop = mc.objectMouseOver
|
||||||
|
|
||||||
|
if (mop == null || mop.typeOfHit?.name != "BLOCK") return
|
||||||
|
|
||||||
|
val blockPos = mop.blockPos
|
||||||
|
val facing = mop.sideHit
|
||||||
|
|
||||||
|
val player = mc.thePlayer
|
||||||
|
val blockCenter = blockPos.add(0.5, 0.5, 0.5)
|
||||||
|
val distanceSq = player.getDistanceSq(blockCenter.x.toDouble(), blockCenter.y.toDouble(), blockCenter.z.toDouble())
|
||||||
|
|
||||||
|
if (distanceSq > 25) {
|
||||||
|
Chatterbox.say("Macro stopped: Too far from block")
|
||||||
|
stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isEntityBlockingView()) {
|
||||||
|
Chatterbox.say("Macro stopped: Entity in the way")
|
||||||
|
stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
pressKey(mc.gameSettings.keyBindForward.keyCode)
|
||||||
|
mc.playerController.onPlayerDamageBlock(blockPos, facing)
|
||||||
|
player.swingItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun stop() {
|
||||||
|
KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.keyCode, false)
|
||||||
|
KeyBinding.setKeyBindState(mc.gameSettings.keyBindAttack.keyCode, false)
|
||||||
|
isMacroToggled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun pressKey(keyCode: Int) {
|
||||||
|
KeyBinding.setKeyBindState(keyCode, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun isEntityBlockingView(): Boolean {
|
||||||
|
val lookVec = mc.thePlayer.lookVec
|
||||||
|
val eyePos = mc.thePlayer.getPositionEyes(1f)
|
||||||
|
|
||||||
|
val entities = mc.theWorld.getEntitiesWithinAABBExcludingEntity(
|
||||||
|
mc.thePlayer,
|
||||||
|
mc.thePlayer.entityBoundingBox.expand(lookVec.xCoord * 5, lookVec.yCoord * 5, lookVec.zCoord * 5)
|
||||||
|
)
|
||||||
|
|
||||||
|
return entities.any {
|
||||||
|
it.canBeCollidedWith() &&
|
||||||
|
it.entityBoundingBox.isVecInside(eyePos)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,199 @@
|
|||||||
|
package com.github.itzilly.sbt.features.gardener
|
||||||
|
|
||||||
|
import com.github.itzilly.sbt.util.Chatterbox
|
||||||
|
import net.minecraft.client.gui.*
|
||||||
|
|
||||||
|
class MacroMakerGui : GuiScreen() {
|
||||||
|
private var selectedTaskIndex: Int = -1
|
||||||
|
private var draggedTaskIndex: Int = -1
|
||||||
|
private var dragOffsetY: Int = 0
|
||||||
|
|
||||||
|
private val macro = Macro("Example Macro")
|
||||||
|
|
||||||
|
enum class ButtonId(val id: Int) {
|
||||||
|
SAVE_MACRO(0),
|
||||||
|
CANCEL(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initGui() {
|
||||||
|
this.buttonList.clear()
|
||||||
|
buttonList.add(GuiButton(ButtonId.SAVE_MACRO.id, width / 2 - 100, height - 40, 90, 20, "Save Macro"))
|
||||||
|
buttonList.add(GuiButton(ButtonId.CANCEL.id, width / 2 + 10, height - 40, 90, 20, "Cancel"))
|
||||||
|
|
||||||
|
macro.tasks.add(MoveTask("W", true))
|
||||||
|
macro.tasks.add(MouseTask("Left Click"))
|
||||||
|
macro.tasks.add(ChatCommandTask("/spawn"))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun actionPerformed(button: GuiButton) {
|
||||||
|
when (button.id) {
|
||||||
|
ButtonId.SAVE_MACRO.id -> {
|
||||||
|
Chatterbox.say("Saved macro!")
|
||||||
|
Close()
|
||||||
|
}
|
||||||
|
ButtonId.CANCEL.id -> Close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) {
|
||||||
|
drawDefaultBackground()
|
||||||
|
|
||||||
|
val thirdWidth = width / 3
|
||||||
|
drawRect(0, 0, thirdWidth, height, 0xFF202020.toInt())
|
||||||
|
drawRect(thirdWidth, 0, thirdWidth * 2, height, 0xFF303030.toInt())
|
||||||
|
drawRect(thirdWidth * 2, 0, width, height, 0xFF202020.toInt())
|
||||||
|
|
||||||
|
drawCenteredString(fontRendererObj, "Macro Maker", width / 2, 10, 0xFFFFFF)
|
||||||
|
|
||||||
|
drawLeftPanel(mouseX, mouseY)
|
||||||
|
drawMiddlePanel(mouseX, mouseY)
|
||||||
|
drawRightPanel()
|
||||||
|
|
||||||
|
super.drawScreen(mouseX, mouseY, partialTicks)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun drawLeftPanel(mouseX: Int, mouseY: Int) {
|
||||||
|
drawString(fontRendererObj, "Editing: ${macro.name}", 10, 20, 0xFFFFFF)
|
||||||
|
drawString(fontRendererObj, "Add Task:", 10, 40, 0xAAAAAA)
|
||||||
|
|
||||||
|
val taskButtons = listOf(
|
||||||
|
Triple("+ Move", 60, { macro.tasks.add(MoveTask("W", false)) }),
|
||||||
|
Triple("+ Mouse", 80, { macro.tasks.add(MouseTask("Right Click")) }),
|
||||||
|
Triple("+ Command", 100, { macro.tasks.add(ChatCommandTask("/say Hello")) })
|
||||||
|
)
|
||||||
|
|
||||||
|
for ((label, y, _) in taskButtons) {
|
||||||
|
drawString(fontRendererObj, label, 10, y, 0x00FF00)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouseClickedX in 10..100 && mouseClickedY != -1) {
|
||||||
|
for ((_, y, action) in taskButtons) {
|
||||||
|
if (mouseClickedY in y..(y + 10)) {
|
||||||
|
action.invoke()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mouseClickedX = -1
|
||||||
|
mouseClickedY = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun drawMiddlePanel(mouseX: Int, mouseY: Int) {
|
||||||
|
val thirdWidth = width / 3
|
||||||
|
val taskStartY = 40
|
||||||
|
val taskHeight = 20
|
||||||
|
|
||||||
|
for ((index, task) in macro.tasks.withIndex()) {
|
||||||
|
val y = taskStartY + index * (taskHeight + 5)
|
||||||
|
if (draggedTaskIndex == index) continue // skip rendering the dragged one
|
||||||
|
val color = if (index == selectedTaskIndex) 0xFF4444 else 0xFFFFFF
|
||||||
|
drawRect(thirdWidth + 10, y, thirdWidth * 2 - 10, y + taskHeight, 0xFF404040.toInt())
|
||||||
|
drawString(fontRendererObj, "${task.name} - ${task.getPreview()}", thirdWidth + 15, y + 6, color)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw the dragged task following the mouse
|
||||||
|
if (draggedTaskIndex != -1) {
|
||||||
|
val task = macro.tasks[draggedTaskIndex]
|
||||||
|
val y = mouseY - dragOffsetY
|
||||||
|
drawRect(thirdWidth + 10, y, thirdWidth * 2 - 10, y + taskHeight, 0xFF606060.toInt())
|
||||||
|
drawString(fontRendererObj, "${task.name} - ${task.getPreview()}", thirdWidth + 15, y + 6, 0xFFFF00)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun drawRightPanel() {
|
||||||
|
val selected = macro.tasks.getOrNull(selectedTaskIndex) ?: return
|
||||||
|
val startX = width - 180
|
||||||
|
val startY = 20
|
||||||
|
val boxWidth = 160
|
||||||
|
val boxHeight = 80
|
||||||
|
|
||||||
|
// Box with outline
|
||||||
|
drawRect(startX - 2, startY - 2, startX + boxWidth + 2, startY + boxHeight + 2, 0xFFFFFFFF.toInt())
|
||||||
|
drawRect(startX, startY, startX + boxWidth, startY + boxHeight, 0xFF101010.toInt())
|
||||||
|
|
||||||
|
drawString(fontRendererObj, "Task Properties", startX + 5, startY + 5, 0xFFFFFF)
|
||||||
|
|
||||||
|
when (selected) {
|
||||||
|
is MoveTask -> {
|
||||||
|
drawString(fontRendererObj, "Direction: ${selected.direction}", startX + 5, startY + 25, 0xCCCCCC)
|
||||||
|
drawString(fontRendererObj, "Hold: ${selected.hold}", startX + 5, startY + 40, 0xCCCCCC)
|
||||||
|
}
|
||||||
|
is MouseTask -> {
|
||||||
|
drawString(fontRendererObj, "Action: ${selected.action}", startX + 5, startY + 25, 0xCCCCCC)
|
||||||
|
}
|
||||||
|
is ChatCommandTask -> {
|
||||||
|
drawString(fontRendererObj, "Command:", startX + 5, startY + 25, 0xCCCCCC)
|
||||||
|
drawString(fontRendererObj, selected.command, startX + 5, startY + 40, 0x00FFAA)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var mouseClickedX = -1
|
||||||
|
private var mouseClickedY = -1
|
||||||
|
|
||||||
|
override fun mouseClicked(mouseX: Int, mouseY: Int, mouseButton: Int) {
|
||||||
|
mouseClickedX = mouseX
|
||||||
|
mouseClickedY = mouseY
|
||||||
|
|
||||||
|
val thirdWidth = width / 3
|
||||||
|
val taskStartY = 40
|
||||||
|
val taskHeight = 25
|
||||||
|
|
||||||
|
for ((index, _) in macro.tasks.withIndex()) {
|
||||||
|
val y = taskStartY + index * taskHeight
|
||||||
|
if (mouseX in (thirdWidth + 10)..(thirdWidth * 2 - 10) && mouseY in y..(y + 20)) {
|
||||||
|
selectedTaskIndex = index
|
||||||
|
draggedTaskIndex = index
|
||||||
|
dragOffsetY = mouseY - y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.mouseClicked(mouseX, mouseY, mouseButton)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun mouseClickMove(mouseX: Int, mouseY: Int, clickedMouseButton: Int, timeSinceLastClick: Long) {
|
||||||
|
super.mouseClickMove(mouseX, mouseY, clickedMouseButton, timeSinceLastClick)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun mouseReleased(mouseX: Int, mouseY: Int, state: Int) {
|
||||||
|
if (draggedTaskIndex != -1) {
|
||||||
|
val thirdWidth = width / 3
|
||||||
|
val taskStartY = 40
|
||||||
|
val taskHeight = 25
|
||||||
|
val newIndex = ((mouseY - taskStartY) / taskHeight).coerceIn(0, macro.tasks.size - 1)
|
||||||
|
if (newIndex != draggedTaskIndex) {
|
||||||
|
val task = macro.tasks.removeAt(draggedTaskIndex)
|
||||||
|
macro.tasks.add(newIndex, task)
|
||||||
|
selectedTaskIndex = newIndex
|
||||||
|
}
|
||||||
|
draggedTaskIndex = -1
|
||||||
|
}
|
||||||
|
|
||||||
|
super.mouseReleased(mouseX, mouseY, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Close() {
|
||||||
|
mc.displayGuiScreen(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sealed class MacroTask(val name: String) {
|
||||||
|
abstract fun getPreview(): String
|
||||||
|
}
|
||||||
|
|
||||||
|
class MoveTask(var direction: String, var hold: Boolean) : MacroTask("Move") {
|
||||||
|
override fun getPreview(): String = if (hold) "Hold $direction" else "Tap $direction"
|
||||||
|
}
|
||||||
|
|
||||||
|
class MouseTask(val action: String) : MacroTask("Mouse") {
|
||||||
|
override fun getPreview(): String = action
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChatCommandTask(var command: String) : MacroTask("Command") {
|
||||||
|
override fun getPreview(): String = command
|
||||||
|
}
|
||||||
|
|
||||||
|
data class Macro(
|
||||||
|
val name: String,
|
||||||
|
val tasks: MutableList<MacroTask> = mutableListOf()
|
||||||
|
)
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.github.itzilly.sbt.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(KeyBinding.class)
|
||||||
|
public interface KeyBindingAccessor {
|
||||||
|
@Accessor("pressed")
|
||||||
|
void setPressed(boolean pressed);
|
||||||
|
}
|
@ -1,16 +0,0 @@
|
|||||||
package com.github.itzilly.sbt.mixin;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiMainMenu;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
@Mixin(GuiMainMenu.class)
|
|
||||||
public class MixinGuiMainMenu {
|
|
||||||
|
|
||||||
@Inject(method = "initGui", at = @At("HEAD"))
|
|
||||||
public void onInitGui(CallbackInfo ci) {
|
|
||||||
System.out.println("Hello from Main Menu!");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +1,14 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"modid": "${modid}",
|
"modid": "${modid}",
|
||||||
"name": "Xample Mod",
|
"name": "SkyBlock Tweaks",
|
||||||
"description": "A mod that is used as an example.",
|
"description": "Utilities for making Hypixel Skyblock more bearable",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
"mcversion": "${mcversion}",
|
"mcversion": "${mcversion}",
|
||||||
"url": "https://github.com/romangraef/Forge1.8.9Template/",
|
"url": "http://itzilly.com/illyum/illyum/sbt-stash/",
|
||||||
"updateUrl": "",
|
"updateUrl": "",
|
||||||
"authorList": [
|
"authorList": [
|
||||||
"You"
|
"itzilly"
|
||||||
],
|
],
|
||||||
"credits": "",
|
"credits": "",
|
||||||
"logoFile": "",
|
"logoFile": "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user