Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/01-sounds-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ body:
label: Minecraft version
description: Which Minecraft version were you using when the problem happened?
options:
- "26.1.2"
- "26.3"
validations:
required: true
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/02-sounds-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ body:
label: Minecraft version
description: Select a version only if your request is specific to it.
options:
- "26.1.2"
- "26.3"
validations:
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/03-mru-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ body:
label: Minecraft version
description: Which Minecraft version were you using when the problem happened?
options:
- "26.1.2"
- "26.2"
- "26.3"
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/04-mru-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body:
label: Minecraft version
description: Select a version only if your request is specific to it.
options:
- "26.1.2"
- "26.2"
- "26.3"
validations:
required: false
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/05-shields-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ body:
description: Which Minecraft version were you using when the problem happened?
options:
- "26.1.2"
- "26.2"
- "26.3"
validations:
required: true
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/05-shields-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ body:
description: Select a version only if your request is specific to it.
options:
- "26.1.2"
- "26.2"
- "26.3"
validations:
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/06-fog-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ body:
label: Minecraft version
description: Which Minecraft version were you using when the problem happened?
options:
- "26.1.2"
- "26.2"
- "26.3"
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/07-fog-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body:
label: Minecraft version
description: Select a version only if your request is specific to it.
options:
- "26.1.2"
- "26.2"
- "26.3"
validations:
required: false
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,24 @@ jobs:
path: build/artifacts/
if-no-files-found: error
retention-days: 30

datagen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: '25'
- uses: gradle/actions/setup-gradle@v6
with:
cache-read-only: ${{ github.event_name == 'pull_request' }}
- name: Run data generation
run: bash ./gradlew --no-daemon --build-cache runDatagenAll
- name: Check generated resources are up to date
run: |
if [ -n "$(git status --porcelain -- '*/src/generated')" ]; then
git status --short -- '*/src/generated'
echo '::error::Generated resources are out of date. Run ./gradlew runDatagenAll and commit the result.'
exit 1
fi
15 changes: 15 additions & 0 deletions build-logic/src/main/kotlin/imb11.fabric-mod.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ loom {
}
}

if (metadata.optional("mod.datagen").toBoolean()) {
// Generated data is shared by both loaders of a Minecraft version, see imb11.mod
fabricApi {
configureDataGeneration {
outputDirectory = requireNotNull(project.parent).file("src/generated/$targetMinecraftVersion")
addToResources = false
client = true
}
}

loom.runs.named("datagen") {
configName = "${metadata.required("mod.name")} - $targetMinecraftVersion - Fabric - Data Generation"
}
}

tasks.named<ProcessResources>("processResources") {
exclude("META-INF/neoforge.mods.toml", "META-INF/mods.toml", "META-INF/accesstransformer.cfg", "interfaces.json")
}
7 changes: 5 additions & 2 deletions build-logic/src/main/kotlin/imb11.mod.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,20 @@ val resourceProperties = mapOf(
tasks.named<ProcessResources>("processResources") {
dependsOn("stonecutterGenerate")
inputs.properties(resourceProperties)
exclude(".cache/**")
filesMatching(listOf("fabric.mod.json", "META-INF/neoforge.mods.toml")) {
expand(resourceProperties)
}
}

tasks.named("sourcesJar") {
tasks.named<Jar>("sourcesJar") {
dependsOn("stonecutterGenerate")
exclude(".cache/**")
}

// Fabric datagen output for this Minecraft version, shared by both loaders
sourceSets.named("main") {
resources.srcDir("src/main/generated")
resources.srcDir(moduleDirectory.dir("src/generated/$minecraftVersion"))
}

jsonlang {
Expand Down
15 changes: 15 additions & 0 deletions build-logic/src/main/kotlin/imb11.root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ targetProjects.forEach { node ->
}
}

// Data generation only runs on Fabric; NeoForge reads the same per-version output
val datagenTasks = modProjects
.filter { readModMetadata(it.layout.projectDirectory).optional("mod.datagen").toBoolean() }
.map { mod ->
mod.tasks.register("runDatagen") {
group = "fabric"
dependsOn(mod.childProjects.values.filter { it.name.endsWith("-fabric") }.map { "${it.path}:runDatagen" })
}
}

tasks.register("runDatagenAll") {
group = "fabric"
dependsOn(datagenTasks)
}

tasks.register("publishAllMods") {
group = "publishing"
dependsOn(buildAll)
Expand Down
15 changes: 1 addition & 14 deletions fog/build.fabric.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
implementation(mcLibrary("yacl-fabric"))
implementation(mcLibrary("modmenu"))
compileOnly(mcLibrary("iris-fabric"))
if (minecraftVersion == "26.1.2" || minecraftVersion == "26.2") {
if (minecraftVersion == "26.2") {
compileOnly(mcLibrary("polytone-fabric"))
add(polytoneLibraries.name, mcLibrary("polytone-fabric"))
compileOnly(files(provider {
Expand All @@ -40,16 +40,3 @@ loom {
}
}
}

fabricApi {
configureDataGeneration {
outputDirectory = project.parent!!.file("src/main/generated")
addToResources = false
client = true
}
}

loom.runs.named("datagen") {
configName = "Fog - ${project.minecraftVersion} - Fabric - Data Generation"
runDir(rootProject.file("run/fog/${project.minecraftVersion}/fabric/datagen").relativeTo(project.projectDir).invariantSeparatorsPath)
}
2 changes: 1 addition & 1 deletion fog/build.neoforge.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
implementation(project(mruProject.path))
implementation(mcLibrary("yacl-neoforge"))
compileOnly(mcLibrary("iris-neoforge"))
if (minecraftVersion == "26.1.2" || minecraftVersion == "26.2") {
if (minecraftVersion == "26.2") {
compileOnly(mcLibrary("polytone-neoforge"))
add(polytoneLibraries.name, mcLibrary("polytone-neoforge"))
compileOnly(files(provider {
Expand Down
1 change: 1 addition & 0 deletions fog/mod.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod.version=1.12.0
mod.group=dev.imb11.fog
mod.required=mru
mod.environment=client
mod.datagen=true
publish.modrinth=WuGVWUF2
publish.curseforge=815438
publish.dependencies.fabric=fabric-api,yacl,mru
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#BDDBE1",
"night": "#526C72"
},
"end_multiplier": 1.0,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#BCA199",
"night": "#140c07"
},
"end_multiplier": 1.0,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#CBCABD",
"night": "#11110e"
},
"end_multiplier": 1.0,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#D1C8AB",
"night": "#827D6A"
},
"end_multiplier": 1.0,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#291d26",
"night": "#291d26"
},
"end_multiplier": 0.5,
"start_multiplier": 0.5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#5B9071",
"night": "#171E23"
},
"end_multiplier": 0.35,
"start_multiplier": 0.15
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#DFEBF4",
"night": "#687782"
},
"end_multiplier": 1.0,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#BDC8C2",
"night": "#5A6459"
},
"end_multiplier": 1.0,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#36292B",
"night": "#36292B"
},
"end_multiplier": 0.01,
"start_multiplier": 0.8
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#700f18",
"night": "#700f18"
},
"end_multiplier": 0.01,
"start_multiplier": 0.8
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#330808",
"night": "#330808"
},
"end_multiplier": 0.01,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#005157",
"night": "#005157"
},
"end_multiplier": 0.01,
"start_multiplier": 1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#7EBAA2",
"night": "#1A2122"
},
"end_multiplier": 1.0,
"start_multiplier": 0.75
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"colors": {
"day": "#0f4c4c",
"night": "#0f4c4c"
},
"end_multiplier": 0.01,
"start_multiplier": 0.8
}

This file was deleted.

2 changes: 1 addition & 1 deletion fog/src/main/java/dev/imb11/fog/api/FogColors.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FogColors {
return new FogColors("#b9d2fd", "#000000");
}

var camera = Minecraft.getInstance().gameRenderer.getMainCamera();
var camera = Minecraft.getInstance().gameRenderer.mainCamera();
var color = world.environmentAttributes().getValue(EnvironmentAttributes.FOG_COLOR, camera.position());
Vec3 dayColor = new Color(color).asVec3d();
return new FogColors(Color.from(dayColor).asHex(), Color.from(dayColor.scale(0.2D)).asHex());
Expand Down
4 changes: 2 additions & 2 deletions fog/src/main/java/dev/imb11/fog/client/FogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void onEndTick(@NotNull ClientLevel clientWorld) {
}

@NotNull Color newMoonColor = Color.from(FogConfig.getInstance().newMoonColor);
float blendFactor = switch (world.environmentAttributes().getValue(EnvironmentAttributes.MOON_PHASE, Minecraft.getInstance().gameRenderer.getMainCamera().position()).index()) {
float blendFactor = switch (world.environmentAttributes().getValue(EnvironmentAttributes.MOON_PHASE, Minecraft.getInstance().gameRenderer.mainCamera().position()).index()) {
case 0 -> 0.0f;
case 1, 7 -> 0.25f;
case 2, 6 -> 0.5f;
Expand Down Expand Up @@ -262,7 +262,7 @@ private float[] blendFogColorWithSunriseSunsetColors(@NotNull Minecraft client,
return new float[]{red, green, blue};
}

var probe = client.gameRenderer.getMainCamera().attributeProbe();
var probe = client.gameRenderer.mainCamera().attributeProbe();
var sunsetColor = probe.getValue(EnvironmentAttributes.SUNRISE_SUNSET_COLOR, tickDelta);
//? if <26.3 {
float alpha = ARGB.alphaFloat(sunsetColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static boolean shouldUsePolytone() {
return null;
}

var camera = client.gameRenderer.getMainCamera();
var camera = client.gameRenderer.mainCamera();
var position = camera.position();
var biome = level.getBiomeManager().getNoiseBiomeAtPosition(position.x, position.y, position.z).value();
var effects = Polytone.BIOME_MODIFIERS.modifiersByBiome().get(biome);
Expand Down
Loading
Loading