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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["1.21.1", "1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11", "26.1", "26.2"]
version: ["1.8.9"]

steps:
- uses: actions/checkout@v6
Expand Down
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
## 1.2.3
- Fixed the game crashing on launch if you live in a timezone with a fractional UTC offset (e.g. UTC+05:30)
- Fixed some invalid API responses causing the game to crash
## 1.3.0
- Added support for Minecraft 26.3
50 changes: 40 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import net.ornithemc.ploceus.api.PloceusGradleExtensionApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("dev.kikugie.loom-back-compat")
id("org.jetbrains.kotlin.jvm") version "2.4.10"
id("net.fabricmc.fabric-loom-remap") version "1.17-SNAPSHOT" apply false
id("ploceus") version "1.17.4" apply false
id("dev.deftu.gradle.bloom") version "0.2.0"
id("me.modmuss50.mod-publish-plugin") version "2.2.0"
}

val isOrnithe = stonecutter.current.version == "1.8.9"
val ploceus = if (isOrnithe) {
pluginManager.apply("net.fabricmc.fabric-loom-remap")
pluginManager.apply("ploceus")

configurations.configureEach {
exclude(group = "org.lwjgl.lwjgl")
}

extensions.getByType<PloceusGradleExtensionApi>().apply {
setIntermediaryGeneration(2)
}
} else {
null
}

val modid: String = sc.properties["mod.id"]
val modname: String = sc.properties["mod.name"]
val modversion: String = sc.properties["mod.version"]
val mcversion: String = sc.current.version
val mcDependencyVersion: String = sc.properties.getOrNull<String>("deps.minecraft") ?: mcversion
val versionrange: String = sc.properties["mod.mc_compat"]
val loaderversion: String = sc.properties["deps.fabric_loader"]
val oneconfigversion: String = sc.properties["deps.oneconfig"]
val loader = if (isOrnithe) "ornithe" else "fabric"

version = "$modversion+$mcversion"
base.archivesName = modid
Expand All @@ -25,7 +46,7 @@ val requiredJava: JavaVersion = when {
sc.current.parsed >= "1.20.5" -> JavaVersion.VERSION_21
sc.current.parsed >= "1.18" -> JavaVersion.VERSION_17
sc.current.parsed >= "1.17" -> JavaVersion.VERSION_16
else -> JavaVersion.VERSION_1_8
else -> JavaVersion.VERSION_25
}

val compatibleVersions: List<String> = sc.properties.rawOrNull("mod", "mc_releases")
Expand All @@ -37,6 +58,7 @@ repositories {
filter { groups.forEach(::includeGroup) }
}

mavenLocal()
mavenCentral()
google()
maven("https://repo.polyfrost.org/releases") { name = "Polyfrost Releases" }
Expand All @@ -45,6 +67,9 @@ repositories {
name = "Sonatype Snapshots"
content { includeGroup("net.kyori") }
}
maven("https://maven.cloverclient.com/releases") {
content { includeGroup("pl.tomgirl") }
}
strictMaven("https://maven.deftu.dev/releases", "Deftu", "dev.deftu")
strictMaven("https://maven.terraformersmc.com/", "TerraformersMC", "com.terraformersmc")
strictMaven("https://maven.fabricmc.net/", "FabricMC", "net.fabricmc")
Expand All @@ -53,20 +78,25 @@ repositories {
}

dependencies {
minecraft("com.mojang:minecraft:$mcversion")
loomx.applyMojangMappings()
minecraft("com.mojang:minecraft:$mcDependencyVersion")
if (isOrnithe) {
mappings(ploceus!!.layeredMappings {
mappings("net.ornithemc:feather-gen2:$mcversion+build.${sc.properties["feather_build"] as String}:v2") {
containsUnpick()
}
mappings(rootProject.file("mappings/feather-overrides.tiny"))
})
testCompileOnly("net.ornithemc.osl-gen2:entrypoints:${sc.properties["deps.osl_entrypoints"] as String}")
} else {
loomx.applyMojangMappings()
}

modImplementation("net.fabricmc:fabric-loader:$loaderversion")
modImplementation("org.polyfrost.oneconfig:$mcversion-fabric:$oneconfigversion")
modImplementation("org.polyfrost.oneconfig:$mcversion-$loader:$oneconfigversion")
for (module in arrayOf("config", "config-impl", "internal", "ui")) {
implementation("org.polyfrost.oneconfig:$module:$oneconfigversion")
}

// only some versions need Fabric API
sc.properties.getOrNull<String>("deps.fabric_api")?.let {
modImplementation("net.fabricmc.fabric-api:fabric-api:$it")
}

testImplementation("org.junit.jupiter:junit-jupiter:${sc.properties.get<String>("deps.junit")}")
testImplementation("net.fabricmc:fabric-loader-junit:$loaderversion")
}
Expand Down Expand Up @@ -189,7 +219,7 @@ publishMods {
changelog = changelogs
type = STABLE

modLoaders.add("fabric")
modLoaders.add(loader)

dryRun = modrinthId == null || modrinthToken == null

Expand Down
11 changes: 11 additions & 0 deletions mappings/feather-overrides.tiny
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tiny 2 0 intermediary named
c net/minecraft/unmapped/C_24384787 net/minecraft/client/renderer/LevelRenderer
c net/minecraft/unmapped/C_28105876 net/minecraft/world/level/biome/Biome
m ()Z m_07177229 hasPrecipitation
c net/minecraft/unmapped/C_32220415 net/minecraft/server/Bootstrap
m ()V m_84022598 bootStrap
c net/minecraft/unmapped/C_34399650 net/minecraft/client/multiplayer/ClientLevel
c net/minecraft/unmapped/C_64041439 net/minecraft/world/level/Level
m (F)F m_31573274 getSkyDarken
m (F)F m_77661568 getRainLevel
m (F)F m_10970845 getThunderLevel
5 changes: 3 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pluginManagement {
mavenCentral()
gradlePluginPortal()
maven("https://maven.fabricmc.net/")
maven("https://maven.ornithemc.net/releases")
maven("https://maven.kikugie.dev/releases") { name = "KikuGie Releases" }
maven("https://maven.kikugie.dev/snapshots") { name = "KikuGie Snapshots" }
maven("https://maven.deftu.dev/releases")
Expand All @@ -22,9 +23,9 @@ plugins {

stonecutter {
create(rootProject) {
versions("1.21.1", "1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11", "26.1", "26.2")
versions("1.8.9", "1.21.1", "1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11", "26.1", "26.2", "26.3")

vcsVersion = "26.2"
vcsVersion = "26.3"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
//?} else if >=1.21.4 {
/*import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import net.minecraft.client.renderer.WeatherEffectRenderer;
*///?} else {
*///?} elif >1.8.9 {
/*import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.core.BlockPos;
*///?} else {
/*import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.world.biome.source.BiomeSource;
*///?}
import net.minecraft.world.level.biome.Biome;
import org.polyfrost.polyweather.client.ClientWeatherManager;
Expand All @@ -22,10 +27,12 @@
@Mixin(ClientLevel.class)
//?} else if >=1.21.4 {
/*@Mixin(WeatherEffectRenderer.class)
*///?} else {
*///?} elif >1.8.9 {
/*@Mixin(LevelRenderer.class)
*///?}
*///?} else
//@Mixin(GameRenderer.class)
public class Mixin_AllowWeatherEverywhere {
//? if >1.8.9 {
//? if >=1.21.4 {
@ModifyReturnValue(method = "getPrecipitationAt", at = @At("RETURN"))
//?} else {
Expand All @@ -45,6 +52,7 @@ private Biome.Precipitation changeWeather(/*? if >=1.21.4 {*/ Biome.Precipitatio

return original/*? if <1.21.4 {*//*.call(instance, pos) *//*?}*/;
}
//?}

//? if <1.21.4 {
/*@WrapOperation(method = "renderSnowAndRain", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/biome/Biome;hasPrecipitation()Z"))
Expand All @@ -56,4 +64,15 @@ private boolean allowWeatherEverywhere(Biome instance, Operation<Boolean> origin
return original.call(instance);
}
*///?}

//? if =1.8.9 {
/*@WrapOperation(method = "renderSnowAndRain", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/biome/source/BiomeSource;adjustTemperatureForHeight(FI)F"))
private float changeWeather(BiomeSource instance, float temperature, int height, Operation<Float> original) {
if (PolyWeatherConfig.isEnabled()) {
return ClientWeatherManager.isSnowy() ? 0.0F : 0.15F;
}

return original.call(instance, temperature, height);
}
*///?}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.WeatherEffectRenderer;
import net.minecraft.server.level.ParticleStatus;
*///?} else {
*///?} elif >1.8.9 {
/*import net.minecraft.client.renderer.LevelRenderer;
*///?} else {
/*import net.minecraft.client.render.GameRenderer;
*///?}
import org.polyfrost.polyweather.client.ClientWeatherManager;
import org.polyfrost.polyweather.client.PolyWeatherConfig;
Expand All @@ -21,9 +23,10 @@
@Mixin(ClientLevel.class)
//?} else if >=1.21.4 {
/*@Mixin(WeatherEffectRenderer.class)
*///?} else {
*///?} elif >1.8.9 {
/*@Mixin(LevelRenderer.class)
*///?}
*///?} else
//@Mixin(GameRenderer.class)
public class Mixin_CancelGroundParticles {
@Inject(method = /*? if >=26.2 {*/ "tickWeatherEffects" /*?} else if >=1.21.4 {*/ /*"tickRainParticles" *//*?} else {*/ /*"tickRain" *//*?}*/, at = @At("HEAD"), cancellable = true)
private void cancelGroundParticles(/*? if >=1.21.4 <26.2 {*/ /*ClientLevel clientLevel, Camera camera, int m, ParticleStatus particleStatus, *//*?}*/ /*? if >=1.21.11 <26.2 {*/ /*int j, *//*?}*/ CallbackInfo ci) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import net.minecraft.world.attribute.WeatherAttributes;
import net.minecraft.world.level.Level;
//?} else {
//?} elif >1.8.9 {
/*import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.multiplayer.ClientLevel;
*///?} else {
/*import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.world.level.Level;
*///?}
import org.polyfrost.polyweather.client.ClientWeatherManager;
import org.polyfrost.polyweather.client.PolyWeatherConfig;
Expand All @@ -16,9 +20,10 @@

//? if >=1.21.11 {
@Mixin(WeatherAttributes.WeatherAccess.class)
//?} else {
//?} elif >1.8.9 {
/*@Mixin(ClientLevel.class)
*///?}
*///?} else
//@Mixin(Level.class)
public /*? if >=1.21.11 {*/ interface /*?} else {*//* class *//*?}*/ Mixin_FixWorldColors {
//? if >=1.21.11 {
@ModifyReturnValue(method = "from", at = @At("RETURN"))
Expand All @@ -38,7 +43,7 @@ public float thunderLevel() {
}
};
}
//?} else {
//?} elif >1.8.9 {
/*@WrapOperation(method = {"getSkyColor", "getSkyDarken", "getCloudColor"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientLevel;getRainLevel(F)F"))
private float modifyPrecipitationStrength(ClientLevel instance, float delta, Operation<Float> original) {
if (PolyWeatherConfig.isEnabled()) {
Expand All @@ -56,5 +61,23 @@ private float modifyThunderStrength(ClientLevel instance, float delta, Operation

return original.call(instance, delta);
}
*///?} else {
/*@WrapOperation(method = {"getSkyColor", "getSkyDarken", "getCloudColor"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;getRainLevel(F)F"))
private float modifyPrecipitationStrength(Level instance, float delta, Operation<Float> original) {
if (PolyWeatherConfig.isEnabled()) {
return ClientWeatherManager.getPrecipitationStrength(delta);
}

return original.call(instance, delta);
}

@WrapOperation(method = {"getSkyColor", "getSkyDarken", "getCloudColor"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;getThunderLevel(F)F"))
private float modifyThunderStrength(Level instance, float delta, Operation<Float> original) {
if (PolyWeatherConfig.isEnabled()) {
return ClientWeatherManager.getStormStrength(delta);
}

return original.call(instance, delta);
}
*///?}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
//?} else if >=1.21.4 {
/*import net.minecraft.client.renderer.WeatherEffectRenderer;
import net.minecraft.world.level.Level;
*///?} else {
*///?} elif >1.8.9 {
/*import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.LevelRenderer;
*///?} else {
/*import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.render.GameRenderer;
*///?}
import org.polyfrost.polyweather.client.ClientWeatherManager;
import org.polyfrost.polyweather.client.PolyWeatherConfig;
Expand All @@ -19,9 +22,10 @@

//? if >=1.21.4 {
@Mixin(WeatherEffectRenderer.class)
//?} else {
//?} elif >1.8.9 {
/*@Mixin(LevelRenderer.class)
*///?}
*///?} else
//@Mixin(GameRenderer.class)
public class Mixin_ModifyPrecipitationStrength {
@WrapOperation(method = /*? if >=1.21.10 {*/ "extractRenderState" /*?} else if >=1.21.4 {*/ /*"render(Lnet/minecraft/world/level/Level;Lnet/minecraft/client/renderer/MultiBufferSource;IFLnet/minecraft/world/phys/Vec3;)V" *//*?} else {*/ /*"renderSnowAndRain" *//*?}*/, at = @At(value = "INVOKE", target = /*? if >=26.2 {*/ "Lnet/minecraft/client/multiplayer/ClientLevel;getRainLevel(F)F" /*?} else if >=1.21.4 {*/ /*"Lnet/minecraft/world/level/Level;getRainLevel(F)F" *//*?} else {*/ /*"Lnet/minecraft/client/multiplayer/ClientLevel;getRainLevel(F)F" *//*?}*/))
private float modifyPrecipitationStrength(/*? if >=26.2 {*/ ClientLevel /*?} else if >=1.21.4 {*/ /*Level *//*?} else {*/ /*ClientLevel *//*?}*/ instance, float delta, Operation<Float> original) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import net.minecraft.client.renderer.fog.environment.AtmosphericFogEnvironment;
//?} else if >=1.21.8 {
/*import net.minecraft.client.renderer.fog.environment.AirBasedFogEnvironment;
*///?} else {
*///?} elif >1.8.9 {
/*import net.minecraft.client.renderer.FogRenderer;
*///?} else {
/*import net.minecraft.client.render.GameRenderer;
import net.minecraft.world.level.Level;
*///?}
import org.polyfrost.polyweather.client.ClientWeatherManager;
import org.polyfrost.polyweather.client.PolyWeatherConfig;
Expand All @@ -19,12 +22,18 @@
@Mixin(AtmosphericFogEnvironment.class)
//?} else if >=1.21.8 {
/*@Mixin(AirBasedFogEnvironment.class)
*///?} else {
*///?} elif >1.8.9 {
/*@Mixin(FogRenderer.class)
*///?}
*///?} else
//@Mixin(GameRenderer.class)
public class Mixin_ModifyThunderStrength {
//? if >1.8.9 {
@WrapOperation(method = /*? if >=1.21.8 {*/ "getBaseColor" /*?} else if >=1.21.4 {*/ /*"computeFogColor" *//*?} else {*/ /*"setupColor" *//*?}*/, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientLevel;getThunderLevel(F)F"))
private static float modifyThunderStrength(ClientLevel instance, float delta, Operation<Float> original) {
//?} else {
/*@WrapOperation(method = "setupClearColor", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;getThunderLevel(F)F"))
private static float modifyThunderStrength(Level instance, float delta, Operation<Float> original) {
*///?}
if (PolyWeatherConfig.isEnabled()) {
return ClientWeatherManager.getStormStrength(delta);
}
Expand Down
Loading