Skip to content

Commit 9aba80a

Browse files
Fixed a bug where if the snowiness property could not be read, the game crashed
1 parent 289794d commit 9aba80a

File tree

3 files changed

+48
-21
lines changed

3 files changed

+48
-21
lines changed

build.gradle

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'fabric-loom' version '0.12-SNAPSHOT'
3-
// id 'com.modrinth.minotaur' version '2.+'
3+
id 'com.modrinth.minotaur' version '2.+'
4+
id 'com.matthewprenger.cursegradle' version '1.4.+'
45
}
56

67
version = project.mod_version
@@ -40,15 +41,37 @@ java {
4041
withSourcesJar()
4142
}
4243

43-
//import com.modrinth.minotaur.dependencies.ModDependency
44-
//modrinth {
45-
// token = System.getenv("MODRINTH_API_KEY")
46-
// projectId = "_"
47-
// versionNumber = version
48-
// versionType = "beta"
49-
// versionName = "SnowyLeavesPlus ${version}"
50-
// uploadFile = remapJar
51-
// gameVersions = [project.minecraft_version]
52-
// loaders = ["fabric"]
53-
// dependencies = [new ModDependency("P7dR8mSH", "required")]
54-
//}
44+
// TODO: Update this every release
45+
def changelog = "Fixed a bug where if the `snowiness` property could not be read, the game crashed"
46+
47+
import com.modrinth.minotaur.dependencies.ModDependency
48+
modrinth {
49+
token = System.getenv("MODRINTH_API_KEY")
50+
projectId = "of7wIinq"
51+
versionNumber = version
52+
versionType = "beta"
53+
versionName = "SnowyLeavesPlus ${version}"
54+
uploadFile = remapJar
55+
changelog
56+
gameVersions = [project.minecraft_version]
57+
loaders = ["fabric"]
58+
dependencies = [new ModDependency("P7dR8mSH", "required")]
59+
}
60+
61+
curseforge {
62+
apiKey = System.getenv("CURSEFORGE_API_TOKEN")
63+
project {
64+
id = "611998"
65+
releaseType = "beta"
66+
addGameVersion(project.minecraft_version)
67+
addGameVersion("Fabric")
68+
mainArtifact(jar) {
69+
changelogType = "markdown"
70+
changelog
71+
displayName = "SnowyLeavesPlus ${version}"
72+
}
73+
relations {
74+
requiredDependency("fabric-api")
75+
}
76+
}
77+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ loader_version=0.13.3
77
fabric_version=0.50.0+1.18.2
88

99
# Mod Properties
10-
mod_version=0.1.0
10+
mod_version=0.1.1
1111
maven_group=io.github.theRookieCoder
1212
archives_base_name=snowyleavesplus

src/main/java/io/github/therookiecoder/snowyleavesplus/SnowyLeavesPlusClient.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ public void onInitializeClient() {
1818
(state, world, pos, index) -> {
1919
// Get the block's default colour
2020
int colour = getLeafBlockColour(state.getBlock(), world, pos);
21-
return switch (state.get(SNOWINESS)) {
22-
case none -> colour;
23-
case low -> whiten(colour, 0.25f);
24-
case medium -> whiten(colour, 0.5f);
25-
case high -> whiten(colour, 0.75f);
26-
case full -> 0xffffff;
27-
};
21+
try {
22+
return switch (state.get(SNOWINESS)) {
23+
case none -> colour;
24+
case low -> whiten(colour, 0.25f);
25+
case medium -> whiten(colour, 0.5f);
26+
case high -> whiten(colour, 0.75f);
27+
case full -> 0xffffff;
28+
};
29+
} catch(Exception e) {
30+
return colour;
31+
}
2832
},
2933
Blocks.ACACIA_LEAVES,
3034
Blocks.AZALEA_LEAVES,

0 commit comments

Comments
 (0)