Skip to content

Commit dba61fe

Browse files
Update mod to 1.19
- Added a `quilt.mod.json` - Added Quilt as a supported mod loader to minotaur and cursegradle - Some small changes to the code
1 parent ea12ea1 commit dba61fe

File tree

7 files changed

+83
-37
lines changed

7 files changed

+83
-37
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# SnowyLeavesPlus
22

3-
In Bedrock Edition, leaves turn white when it is snowing. SnowyLeavesPlus brings this feature to Java Edition! When it is snowing leaves will slowly turn whiter, and when it is not they will turn back to normal.
3+
In Bedrock Edition, leaves turn white when it is snowing.
4+
SnowyLeavesPlus brings this feature to Java Edition!
5+
When it is snowing, leaves will slowly turn white, and when it is not, they will turn back to normal.
46

57
## Installation
68

7-
You can install SnowyLeavesPlus by [downloading it](https://modrinth.com/mod/snowyleavesplus) and [Fabric API](https://modrinth.com/mod/fabric-api).
8-
Then put the mod jars in your `mods` folder and load Minecraft using [Fabric](https://fabricmc.net/use/installer/).
9-
You can also use a mod manager like [PolyMC](https://polymc.org/) or my own [Ferium](https://github.com/theRookieCoder/ferium).
9+
You can install SnowyLeavesPlus by [downloading](https://modrinth.com/mod/snowyleavesplus) it and [Fabric API](https://modrinth.com/mod/fabric-api).
10+
Then put the mod jars in your `mods` folder and load Minecraft using [Fabric](https://fabricmc.net/use/installer/) or [Quilt](https://quiltmc.org/install/).
11+
You can also use a mod manager like [GDLauncher](https://gdevs.io/), [PolyMC](https://polymc.org/), or my own [Ferium](https://github.com/gorilla-devs/ferium).
1012

1113
## Compiling from Source
1214

13-
Prerequisites: Java, JDK 17
15+
Prerequisites: JDK 17
1416

1517
1. Clone this repository by running `git clone https://github.com/theRookieCoder/SnowyLeavesPlus` or `gh repo clone theRookieCoder/SnowyLeavesPlus`
1618
2. Build the project by running `./gradlew build`

build.gradle

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
plugins {
22
id 'fabric-loom' version '0.12-SNAPSHOT'
3-
id 'com.modrinth.minotaur' version '2.+'
3+
id 'com.modrinth.minotaur' version '2.3.+'
44
id 'com.matthewprenger.cursegradle' version '1.4.+'
55
}
66

77
version = project.mod_version
88
group = project.maven_group
99

1010
dependencies {
11-
// Change versions in gradle.properties
12-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
11+
// Change these versions in gradle.properties
1312
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
13+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
1414
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
1515
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
1616
}
@@ -42,29 +42,32 @@ java {
4242
}
4343

4444
// TODO: Update this every release
45-
def changelog = "Fixed a bug where if the `snowiness` property could not be read, the game crashed"
45+
def changelog = "Update to 1.19"
4646

4747
import com.modrinth.minotaur.dependencies.ModDependency
4848
modrinth {
49-
token = System.getenv("MODRINTH_API_KEY")
50-
projectId = "of7wIinq"
51-
versionNumber = version
52-
versionType = "beta"
49+
token = System.getenv("MODRINTH_TOKEN")
5350
versionName = "SnowyLeavesPlus ${version}"
51+
versionNumber = version
52+
projectId = "of7wIinq"
5453
uploadFile = remapJar
54+
versionType = "beta"
5555
changelog
56+
loaders = ["fabric", "quilt"]
5657
gameVersions = [project.minecraft_version]
57-
loaders = ["fabric"]
58+
syncBodyFrom = rootProject.file("README.md").text
59+
// Required dependency, Fabric API
5860
dependencies = [new ModDependency("P7dR8mSH", "required")]
5961
}
6062

6163
curseforge {
62-
apiKey = System.getenv("CURSEFORGE_API_TOKEN")
64+
apiKey = System.getenv("CURSEFORGE_TOKEN")
6365
project {
6466
id = "611998"
6567
releaseType = "beta"
6668
addGameVersion(project.minecraft_version)
6769
addGameVersion("Fabric")
70+
addGameVersion("Quilt")
6871
mainArtifact(remapJar) {
6972
changelogType = "markdown"
7073
changelog

gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
org.gradle.jvmargs=-Xmx1G
1+
org.gradle.jvmargs=-Xmx2G
22

33
# Fabric Properties (https://fabricmc.net/develop)
4-
minecraft_version=1.18.2
5-
yarn_mappings=1.18.2+build.3
6-
loader_version=0.13.3
7-
fabric_version=0.50.0+1.18.2
4+
minecraft_version=1.19
5+
yarn_mappings=1.19+build.4
6+
loader_version=0.14.8
7+
fabric_version=0.56.0+1.19
88

99
# Mod Properties
10-
mod_version=0.1.1
11-
maven_group=io.github.theRookieCoder
10+
mod_version=0.1.2
11+
maven_group=io.github.therookiecoder
1212
archives_base_name=snowyleavesplus

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ public void onInitializeClient() {
1919
// Get the block's default colour
2020
int colour = getLeafBlockColour(state.getBlock(), world, pos);
2121
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-
};
22+
return whiten(colour, switch (state.get(SNOWINESS)) {
23+
case none -> 0;
24+
case low -> 0.25;
25+
case medium -> 0.5;
26+
case high -> 0.75;
27+
case full -> 1;
28+
});
29+
// If there is any error, return the default colour
2930
} catch(Exception e) {
3031
return colour;
3132
}
@@ -61,11 +62,12 @@ private int getLeafBlockColour(Block block, BlockRenderView world, BlockPos pos)
6162
/**
6263
* Whiten a colour based on a whiteness value
6364
* @param colour The colour to modify
64-
* @param whiteness The amount to whiten the colour by, a whiteness of 0 would return the same colour, and a
65-
* whiteness of 1 would return white (0x0ffffff)
65+
* @param whiteness The amount to whiten the colour by.
66+
* A whiteness of <code>0</code> would return the same colour, and a
67+
* whiteness of <code>1</code> would return white (<code>0xffffff</code>)
6668
* @return The whitened colour
6769
*/
68-
private int whiten(int colour, float whiteness) {
70+
private int whiten(int colour, double whiteness) {
6971
// Extract colour channels
7072
int red = (colour >> 16 & 0xff);
7173
int green = (colour >> 8 & 0xff);

src/main/java/io/github/therookiecoder/snowyleavesplus/mixin/LeavesBlockMixin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.minecraft.server.world.ServerWorld;
66
import net.minecraft.state.StateManager;
77
import net.minecraft.util.math.BlockPos;
8+
import net.minecraft.util.math.random.Random;
89
import net.minecraft.world.LightType;
910
import net.minecraft.world.biome.Biome;
1011
import org.spongepowered.asm.mixin.Mixin;
@@ -13,8 +14,6 @@
1314
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
1415
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1516

16-
import java.util.Random;
17-
1817
import static io.github.therookiecoder.snowyleavesplus.Snowiness.SNOWINESS;
1918

2019
@Mixin(LeavesBlock.class)

src/main/resources/fabric.mod.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": "snowyleavesplus",
44
"version": "${version}",
55
"name": "SnowyLeavesPlus",
6-
"description": "When it is snowing leaves will slowly turn whiter, and when it is not they will turn back to normal",
6+
"description": "When it is snowing, leaves will slowly turn white, and when it is not, they will turn back to normal",
77
"authors": ["theRookieCoder"],
88
"contact": {
99
"email": "ileshkt@gmail.com",
@@ -14,12 +14,14 @@
1414
"icon": "assets/snowyleavesplus/icon.png",
1515
"environment": "*",
1616
"entrypoints": {
17-
"client": ["io.github.therookiecoder.snowyleavesplus.SnowyLeavesPlusClient"]
17+
"client": [
18+
"io.github.therookiecoder.snowyleavesplus.SnowyLeavesPlusClient"
19+
]
1820
},
1921
"mixins": ["SnowyLeavesPlus.mixins.json"],
2022
"depends": {
2123
"fabricloader": "*",
2224
"fabric": "*",
23-
"minecraft": "1.18.2"
25+
"minecraft": "1.19"
2426
}
2527
}

src/main/resources/quilt.mod.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"schema_version": 1,
3+
"quilt_loader": {
4+
"group": "io.github.therookiecoder",
5+
"id": "snowyleavesplus",
6+
"version": "${version}",
7+
"entrypoints": {
8+
"client": "io.github.therookiecoder.snowyleavesplus.SnowyLeavesPlusClient"
9+
},
10+
"depends": [
11+
"fabricloader",
12+
"fabric",
13+
{
14+
"id": "minecraft",
15+
"versions": "1.19"
16+
}
17+
],
18+
"intermediate_mappings": "net.fabricmc:intermediary",
19+
"metadata": {
20+
"name": "SnowyLeavesPlus",
21+
"description": "When it is snowing, leaves will slowly turn white, and when it is not, they will turn back to normal",
22+
"contributors": {
23+
"Owner": "theRookieCoder"
24+
},
25+
"contact": {
26+
"email": "ileshkt@gmail.com",
27+
"sources": "https://github.com/theRookieCoder/SnowyLeavesPlus",
28+
"issues": "https://github.com/theRookieCoder/SnowyLeavesPlus/issues"
29+
},
30+
"license": "MPL-2.0",
31+
"icon": "assets/snowyleavesplus/icon.png"
32+
}
33+
},
34+
"mixin": "SnowyLeavesPlus.mixins.json",
35+
"minecraft": {
36+
"environment": "*"
37+
}
38+
}

0 commit comments

Comments
 (0)