Skip to content

Commit 3d79c26

Browse files
Fully update to 1.19.4
Other small code changes too
1 parent c6219ba commit 3d79c26

File tree

10 files changed

+41
-47
lines changed

10 files changed

+41
-47
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ You can install SnowyLeavesPlus by downloading it from any of the following:
1414
[![GitHub Releases](https://img.shields.io/github/downloads/theRookieCoder/SnowyLeavesPlus/total?color=B2BEB5&style=for-the-badge&logo=github)](https://github.com/theRookieCoder/SnowyLeavesPlus/releases)
1515
[![CurseForge](https://cf.way2muchnoise.eu/full_snowyleavesplus_downloads.svg?badge_style=for_the_badge)](https://www.curseforge.com/minecraft/mc-mods/snowyleavesplus)
1616

17-
You will also need Fabric API. Put the mod files in your `mods` folder, and load Minecraft using [Fabric](https://fabricmc.net/use/installer) or [Quilt](https://quiltmc.org/en/install).
17+
You will also need (Quilted) Fabric API. Put the mod files in your `mods` folder, and load Minecraft using [Fabric](https://fabricmc.net/use/installer) or [Quilt](https://quiltmc.org/en/install).
1818

1919
You can also use a mod manager like [GDLauncher](https://gdlauncher.com), [Prism Launcher](https://prismlauncher.org), or my own [ferium](https://github.com/gorilla-devs/ferium).
2020

2121
## Compiling from Source
2222

2323
Prerequisites: JDK 17
2424

25-
1. Clone this repository by running `git clone https://github.com/theRookieCoder/SnowyLeavesPlus` or `gh repo clone theRookieCoder/SnowyLeavesPlus`
25+
1. Clone this repository by running `git clone https://github.com/theRookieCoder/SnowyLeavesPlus.git` or `gh repo clone theRookieCoder/SnowyLeavesPlus`
2626
2. Build the project by running `./gradlew build`
2727
3. The mod jar file can be found at `build/libs/`

build.gradle

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ java {
4141
withSourcesJar()
4242
}
4343

44-
// TODO: Update this every release
45-
def changelog = "Backport to 1.18.2"
46-
4744
import com.modrinth.minotaur.dependencies.ModDependency
4845
modrinth {
4946
token = System.getenv("MODRINTH_TOKEN")
@@ -52,32 +49,24 @@ modrinth {
5249
projectId = "of7wIinq"
5350
uploadFile = remapJar
5451
versionType = "beta"
55-
changelog
5652
loaders = ["fabric", "quilt"]
57-
gameVersions = ["1.19", "1.19.1", "1.19.2", "1.19.3"]
53+
gameVersions = ["1.19.4"]
5854
syncBodyFrom = rootProject.file("README.md").text
59-
// Required dependency Fabric API
60-
dependencies = [new ModDependency("P7dR8mSH", "required")]
55+
dependencies = [new ModDependency("fabric-api", "required")]
6156
}
6257

6358
curseforge {
6459
apiKey = System.getenv("CURSEFORGE_TOKEN")
6560
project {
6661
id = "611998"
6762
releaseType = "beta"
68-
addGameVersion("1.19")
69-
addGameVersion("1.19.1")
70-
addGameVersion("1.19.2")
71-
addGameVersion("1.19.3")
63+
addGameVersion("1.19.4")
7264
addGameVersion("Fabric")
7365
addGameVersion("Quilt")
7466
mainArtifact(remapJar) {
7567
changelogType = "markdown"
76-
changelog
7768
displayName = "SnowyLeavesPlus ${version}"
7869
}
79-
relations {
80-
requiredDependency("fabric-api")
81-
}
70+
relations { requiredDependency("fabric-api") }
8271
}
8372
}

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
org.gradle.jvmargs=-Xmx2G
22

33
# Fabric Properties (https://fabricmc.net/develop)
4-
minecraft_version=1.19.4-pre3
5-
yarn_mappings=1.19.4-pre3+build.1
4+
minecraft_version=1.19.4
5+
yarn_mappings=1.19.4+build.1
66
loader_version=0.14.17
7-
fabric_version=0.75.2+1.19.4
7+
fabric_version=0.75.3+1.19.4
88

99
# Mod Properties
1010
mod_version=0.1.5
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public enum Snowiness implements StringIdentifiable {
1010
high,
1111
full;
1212

13-
public static final EnumProperty<Snowiness> SNOWINESS = EnumProperty.of("snowiness", Snowiness.class);
13+
public static final EnumProperty<Snowiness> SNOWINESS =
14+
EnumProperty.of("snowiness", Snowiness.class);
1415

1516
@Override
1617
public String asString() {

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

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,29 @@ public void onInitializeClient() {
1919
// Get the block's default colour
2020
int colour = getLeafBlockColour(state.getBlock(), world, pos);
2121
try {
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-
});
22+
return whiten(colour,
23+
(double) state.get(SNOWINESS).ordinal() / Snowiness.values().length);
2924
// If there is any error, return the default colour
3025
} catch(Exception e) {
3126
return colour;
3227
}
3328
},
34-
Blocks.ACACIA_LEAVES,
35-
Blocks.AZALEA_LEAVES,
29+
Blocks.OAK_LEAVES,
30+
Blocks.SPRUCE_LEAVES,
3631
Blocks.BIRCH_LEAVES,
3732
Blocks.JUNGLE_LEAVES,
38-
Blocks.OAK_LEAVES,
33+
Blocks.ACACIA_LEAVES,
34+
Blocks.CHERRY_LEAVES,
3935
Blocks.DARK_OAK_LEAVES,
40-
Blocks.FLOWERING_AZALEA_LEAVES,
41-
Blocks.SPRUCE_LEAVES
36+
Blocks.MANGROVE_LEAVES,
37+
Blocks.AZALEA_LEAVES,
38+
Blocks.FLOWERING_AZALEA_LEAVES
4239
);
4340
}
4441

4542
/**
46-
* Derived from the colour providers registered by Minecraft
43+
* Based on code from Minecraft's registered colour providers.
44+
* @see net.minecraft.client.color.block.BlockColors
4745
* @param block The block to get the colour of
4846
* @param world The current world
4947
* @param pos The position of the block
@@ -54,8 +52,16 @@ private int getLeafBlockColour(Block block, BlockRenderView world, BlockPos pos)
5452
return FoliageColors.getBirchColor();
5553
} else if (block == Blocks.SPRUCE_LEAVES) {
5654
return FoliageColors.getSpruceColor();
55+
} else if (
56+
block == Blocks.OAK_LEAVES
57+
|| block == Blocks.JUNGLE_LEAVES
58+
|| block == Blocks.ACACIA_LEAVES
59+
|| block == Blocks.DARK_OAK_LEAVES
60+
|| block == Blocks.MANGROVE_LEAVES) {
61+
return world != null && pos != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor();
5762
} else {
58-
return world != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor();
63+
// TODO: Actually get the default colour
64+
return world != null && pos != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor();
5965
}
6066
}
6167

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void randomTickInject(
6666
world.isRaining()
6767
&& world.getBiome(pos).value().getPrecipitation(pos) == Biome.Precipitation.SNOW
6868
) {
69-
// And the block is at least somewhat exposed to the sky
69+
// And the block is (somewhat) exposed to the sky
7070
if (world.getLightLevel(LightType.SKY, pos) > 10) {
7171
// Make it more snowy
7272
world.setBlockState(pos, state.with(SNOWINESS, currentSnowiness.increaseSnowiness()));

src/main/resources/fabric.mod.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@
1212
},
1313
"license": "MPL-2.0",
1414
"icon": "assets/snowyleavesplus/icon.png",
15-
"environment": "*",
15+
"environment": "client",
1616
"entrypoints": {
17-
"client": [
18-
"io.github.therookiecoder.snowyleavesplus.SnowyLeavesPlusClient"
19-
]
17+
"client": ["io.github.therookiecoder.snowyleavesplus.SnowyLeavesPlusClient"]
2018
},
21-
"mixins": ["SnowyLeavesPlus.mixins.json"],
19+
"mixins": ["snowyleavesplus.mixins.json"],
2220
"depends": {
2321
"fabricloader": "*",
2422
"fabric-api": "*",
25-
"minecraft": "~1.19"
23+
"minecraft": "1.19.4"
2624
}
2725
}

src/main/resources/quilt.mod.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"fabric-api",
1313
{
1414
"id": "minecraft",
15-
"versions": "~1.19"
15+
"versions": "1.19.4"
1616
}
1717
],
1818
"intermediate_mappings": "net.fabricmc:intermediary",
@@ -31,8 +31,8 @@
3131
"icon": "assets/snowyleavesplus/icon.png"
3232
}
3333
},
34-
"mixin": "SnowyLeavesPlus.mixins.json",
34+
"mixin": "snowyleavesplus.mixins.json",
3535
"minecraft": {
36-
"environment": "*"
36+
"environment": "client"
3737
}
3838
}

src/main/resources/SnowyLeavesPlus.mixins.json renamed to src/main/resources/snowyleavesplus.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"minVersion": "0.8",
44
"package": "io.github.therookiecoder.snowyleavesplus.mixin",
55
"compatibilityLevel": "JAVA_17",
6-
"mixins": [
6+
"client": [
77
"BlockInvoker",
88
"LeavesBlockMixin"
99
],

0 commit comments

Comments
 (0)