Skip to content

Commit e68bd5f

Browse files
committed
Initial commit
0 parents  commit e68bd5f

32 files changed

+3491
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Automatically build the project and run any configured tests for every push
2+
# and submitted pull request. This can help catch issues that only occur on
3+
# certain platforms or Java versions, and provides a first line of defence
4+
# against bad commits.
5+
6+
name: build
7+
on: [pull_request, push]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
# Use these Java versions
14+
java: [21]
15+
# and run on both Linux and Windows
16+
os: [ubuntu-22.04, windows-2022]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- name: checkout repository
20+
uses: actions/checkout@v4
21+
- name: validate gradle wrapper
22+
uses: gradle/wrapper-validation-action@v2
23+
- name: setup jdk ${{ matrix.java }}
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: ${{ matrix.java }}
27+
distribution: 'microsoft'
28+
- name: make gradle wrapper executable
29+
if: ${{ runner.os != 'Windows' }}
30+
run: chmod +x ./gradlew
31+
- name: build
32+
run: ./gradlew chiseledBuild
33+
- name: capture build artifacts
34+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: Artifacts
38+
path: build/libs/

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# gradle
2+
3+
.gradle/
4+
build/
5+
out/
6+
classes/
7+
8+
# eclipse
9+
10+
*.launch
11+
12+
# idea
13+
14+
.idea/
15+
*.iml
16+
*.ipr
17+
*.iws
18+
19+
# vscode
20+
21+
.settings/
22+
.vscode/
23+
bin/
24+
.classpath
25+
.project
26+
27+
# macos
28+
29+
*.DS_Store
30+
31+
# fabric
32+
33+
run/
34+
35+
# java
36+
37+
hs_err_*.log
38+
replay_*.log
39+
*.hprof
40+
*.jfr

CHANGELOG.md

Whitespace-only changes.

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2019-present, Ilya "SpaiR" Prymshyts
4+
Copyright (c) 2025, IMS212
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ImGui for MC
2+
3+
This is a basic loader for our upgraded ImGui bindings that can be JiJ'd into any Fabric mod. No setup is needed, and ImGui can start being used immediately.
4+
5+
All context handling, window creation, and events are handled by the mod, with multi-viewports being enabled by default.

build.gradle.kts

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
plugins {
2+
`maven-publish`
3+
id("fabric-loom")
4+
//id("dev.kikugie.j52j")
5+
//id("me.modmuss50.mod-publish-plugin")
6+
}
7+
8+
class ModData {
9+
val id = property("mod.id").toString()
10+
val name = property("mod.name").toString()
11+
val version = property("mod.version").toString()
12+
val group = property("mod.group").toString()
13+
}
14+
15+
class ModDependencies {
16+
operator fun get(name: String) = property("deps.$name").toString()
17+
}
18+
19+
val mod = ModData()
20+
val deps = ModDependencies()
21+
val mcVersion = stonecutter.current.version
22+
val mcDep = property("mod.mc_dep").toString()
23+
24+
version = "${mod.version}+$mcVersion"
25+
group = mod.group
26+
base { archivesName.set(mod.id) }
27+
28+
loom {
29+
splitEnvironmentSourceSets()
30+
31+
mods {
32+
create("template") {
33+
sourceSet(sourceSets["main"])
34+
sourceSet(sourceSets["client"])
35+
}
36+
}
37+
38+
runs {
39+
getByName("client") {
40+
environmentVariable("__GL_THREADED_OPTIMIZATIONS", "0")
41+
}
42+
}
43+
}
44+
45+
repositories {
46+
fun strictMaven(url: String, alias: String, vararg groups: String) = exclusiveContent {
47+
forRepository { maven(url) { name = alias } }
48+
filter { groups.forEach(::includeGroup) }
49+
}
50+
strictMaven("https://www.cursemaven.com", "CurseForge", "curse.maven")
51+
strictMaven("https://api.modrinth.com/maven", "Modrinth", "maven.modrinth")
52+
mavenLocal()
53+
}
54+
55+
dependencies {
56+
minecraft("com.mojang:minecraft:$mcVersion")
57+
mappings(loom.officialMojangMappings())
58+
modImplementation("net.fabricmc:fabric-loader:${deps["fabric_loader"]}")
59+
include("io.github.spair:imgui-java-binding:1.90.9")
60+
implementation("io.github.spair:imgui-java-binding:1.90.9") {
61+
isTransitive = false
62+
}
63+
}
64+
65+
loom {
66+
decompilers {
67+
get("vineflower").apply { // Adds names to lambdas - useful for mixins
68+
options.put("mark-corresponding-synthetics", "1")
69+
}
70+
}
71+
72+
runConfigs.all {
73+
ideConfigGenerated(true)
74+
vmArgs("-Dmixin.debug.export=true")
75+
runDir = "../../run"
76+
}
77+
}
78+
79+
java {
80+
withSourcesJar()
81+
val java = if (stonecutter.eval(mcVersion, ">=1.20.6")) JavaVersion.VERSION_21 else JavaVersion.VERSION_17
82+
targetCompatibility = java
83+
sourceCompatibility = java
84+
}
85+
86+
tasks.processResources {
87+
inputs.property("id", mod.id)
88+
inputs.property("name", mod.name)
89+
inputs.property("version", mod.version)
90+
inputs.property("mcdep", mcDep)
91+
92+
val map = mapOf(
93+
"id" to mod.id,
94+
"name" to mod.name,
95+
"version" to mod.version,
96+
"mcdep" to mcDep
97+
)
98+
99+
filesMatching("fabric.mod.json") { expand(map) }
100+
}
101+
102+
tasks.register<Copy>("buildAndCollect") {
103+
group = "build"
104+
from(tasks.remapJar.get().archiveFile)
105+
into(rootProject.layout.buildDirectory.file("libs/${mod.version}"))
106+
dependsOn("build")
107+
}
108+
109+
/*
110+
publishMods {
111+
file = tasks.remapJar.get().archiveFile
112+
additionalFiles.from(tasks.remapSourcesJar.get().archiveFile)
113+
displayName = "${mod.name} ${mod.version} for $mcVersion"
114+
version = mod.version
115+
changelog = rootProject.file("CHANGELOG.md").readText()
116+
type = STABLE
117+
modLoaders.add("fabric")
118+
119+
dryRun = providers.environmentVariable("MODRINTH_TOKEN")
120+
.getOrNull() == null || providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null
121+
122+
modrinth {
123+
projectId = property("publish.modrinth").toString()
124+
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
125+
minecraftVersions.add(mcVersion)
126+
requires {
127+
slug = "fabric-api"
128+
}
129+
}
130+
131+
curseforge {
132+
projectId = property("publish.curseforge").toString()
133+
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
134+
minecraftVersions.add(mcVersion)
135+
requires {
136+
slug = "fabric-api"
137+
}
138+
}
139+
}
140+
*/
141+
/*
142+
publishing {
143+
repositories {
144+
maven("...") {
145+
name = "..."
146+
credentials(PasswordCredentials::class.java)
147+
authentication {
148+
create<BasicAuthentication>("basic")
149+
}
150+
}
151+
}
152+
153+
publications {
154+
create<MavenPublication>("mavenJava") {
155+
groupId = "${property("mod.group")}.${mod.id}"
156+
artifactId = mod.version
157+
version = mcVersion
158+
159+
from(components["java"])
160+
}
161+
}
162+
}
163+
*/

gradle.properties

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx4G
3+
org.gradle.parallel=true
4+
org.gradle.caching=true
5+
org.gradle.caching.debug=false
6+
org.gradle.configureondemand=true
7+
8+
# Mod properties
9+
mod.version=0.1.0
10+
mod.group=net.irisshaders
11+
mod.id=imguimc
12+
mod.name=ImGui for MC
13+
14+
# for fabric.mod.json
15+
mod.mc_dep=[VERSIONED]
16+
# for release title
17+
mod.mc_title=[VERSIONED]
18+
# for release metadata
19+
mod.mc_targets=[VERSIONED]
20+
21+
# Global dependencies
22+
deps.fabric_loader=0.16.13
23+
24+
25+
# Publishing
26+
publish.modrinth=...
27+
publish.curseforge=...

gradle/wrapper/gradle-wrapper.jar

42.4 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)