Skip to content

Commit b37f928

Browse files
committed
update to 1.21.1
1 parent a98957b commit b37f928

29 files changed

+265
-767
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
## Changelog
2-
- update dependencies
3-
- (Fabric) try fix nightconfig issue
2+
- update to 1.21.1

build.gradle

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "architectury-plugin" version "3.4-SNAPSHOT"
3-
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
3+
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
44
id "com.github.johnrengelman.shadow" version "8.+" apply false
55
id "com.hypherionmc.modutils.modpublisher" version "2.+" apply false
66
}
@@ -9,28 +9,21 @@ architectury {
99
minecraft = rootProject.minecraft_version
1010
}
1111

12+
allprojects {
13+
version = "${rootProject.mod_version}+mc${rootProject.minecraft_version}"
14+
group = rootProject.maven_group
15+
}
16+
1217
subprojects {
18+
apply plugin: "java"
19+
apply plugin: "maven-publish"
20+
apply plugin: "architectury-plugin"
1321
apply plugin: "dev.architectury.loom"
1422
apply plugin: "com.github.johnrengelman.shadow"
1523
apply plugin: "com.hypherionmc.modutils.modpublisher"
1624

17-
dependencies {
18-
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
19-
mappings loom.layered {
20-
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
21-
mappings "dev.architectury:yarn-mappings-patch-neoforge:${rootProject.mappings_patch}"
22-
}
23-
}
24-
}
2525

26-
allprojects {
27-
apply plugin: "java"
28-
apply plugin: "architectury-plugin"
29-
apply plugin: "maven-publish"
30-
31-
archivesBaseName = rootProject.archives_base_name
32-
version = "${rootProject.mod_version}+mc${rootProject.minecraft_version}"
33-
group = rootProject.maven_group
26+
archivesBaseName = "${rootProject.archives_base_name}-${project.name}"
3427

3528
repositories {
3629
maven { url = "https://maven.gegy.dev" }
@@ -39,15 +32,48 @@ allprojects {
3932
maven { url = "https://maven.terraformersmc.com/releases/" }
4033
}
4134

42-
tasks.withType(JavaCompile) {
35+
dependencies {
36+
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
37+
mappings loom.layered {
38+
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
39+
mappings "dev.architectury:yarn-mappings-patch-neoforge:${rootProject.mappings_patch}"
40+
}
41+
42+
implementation("com.electronwill.night-config:core:3.8.0")
43+
implementation("com.electronwill.night-config:toml:3.8.0")
44+
}
45+
46+
tasks.withType(JavaCompile).configureEach {
4347
options.encoding = "UTF-8"
4448
options.release = 21
4549
}
4650

4751
java {
52+
toolchain {
53+
languageVersion = JavaLanguageVersion.of(21)
54+
}
55+
4856
sourceCompatibility = JavaVersion.VERSION_21
4957
targetCompatibility = JavaVersion.VERSION_21
5058

5159
withSourcesJar()
5260
}
61+
62+
// Configure Maven publishing.
63+
publishing {
64+
publications {
65+
mavenJava(MavenPublication) {
66+
artifactId = base.archivesName.get()
67+
from components.java
68+
}
69+
}
70+
71+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
72+
repositories {
73+
// Add repositories to publish to here.
74+
// Notice: This block does NOT have the same function as the block in the top level.
75+
// The repositories here will be used for publishing your artifact, not for
76+
// retrieving dependencies.
77+
}
78+
}
5379
}

common/build.gradle

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,6 @@ loom {
99
dependencies {
1010
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
1111
// Do NOT use other classes from fabric loader
12-
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
13-
modImplementation "maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric"
14-
15-
implementation "com.electronwill.night-config:core:3.6.6"
16-
implementation "com.electronwill.night-config:toml:3.6.6"
17-
}
18-
19-
publishing {
20-
publications {
21-
mavenCommon(MavenPublication) {
22-
artifactId = rootProject.archives_base_name
23-
from components.java
24-
}
25-
}
26-
27-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
28-
repositories {
29-
// Add repositories to publish to here.
30-
}
12+
modImplementation("net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}")
13+
modImplementation("maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric")
3114
}

common/src/main/java/org/thinkingstudio/ryoamiclights/RyoamicLightsCompat.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ public static boolean isLilTaterReloadedInstalled() {
4242
* @return {@code true} if Sodium is installed, else {@code false}
4343
*/
4444
public static boolean isSodiumInstalled() {
45-
return ModPlatform.isModLoaded("sodium") != ModPlatform.isModLoaded("embeddium");
45+
return ModPlatform.isModLoaded("sodium");
46+
}
47+
48+
/**
49+
* Returns whether Embeddium is installed.
50+
*
51+
* @return {@code true} if Embeddium is installed, else {@code false}
52+
*/
53+
public static boolean isEmbeddiumInstalled() {
54+
return ModPlatform.isModLoaded("embeddium");
4655
}
4756

4857
/**

common/src/main/java/org/thinkingstudio/ryoamiclights/mixin/WorldMixin.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
package org.thinkingstudio.ryoamiclights.mixin;
1212

13+
import com.llamalad7.mixinextras.sugar.Local;
1314
import org.thinkingstudio.ryoamiclights.DynamicLightSource;
1415
import org.thinkingstudio.ryoamiclights.RyoamicLights;
1516
import net.minecraft.block.entity.BlockEntity;
1617
import net.minecraft.util.math.BlockPos;
17-
import net.minecraft.util.profiler.Profiler;
1818
import net.minecraft.world.World;
1919
import net.minecraft.world.chunk.BlockEntityTickInvoker;
2020
import org.jetbrains.annotations.Nullable;
@@ -23,9 +23,6 @@
2323
import org.spongepowered.asm.mixin.injection.At;
2424
import org.spongepowered.asm.mixin.injection.Inject;
2525
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
26-
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
27-
28-
import java.util.Iterator;
2926

3027
@Mixin(World.class)
3128
public abstract class WorldMixin {
@@ -37,10 +34,13 @@ public abstract class WorldMixin {
3734

3835
@Inject(
3936
method = "tickBlockEntities",
40-
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/BlockEntityTickInvoker;tick()V", shift = At.Shift.BEFORE),
41-
locals = LocalCapture.CAPTURE_FAILEXCEPTION
37+
at = @At(
38+
value = "INVOKE",
39+
target = "Lnet/minecraft/world/chunk/BlockEntityTickInvoker;tick()V",
40+
shift = At.Shift.BEFORE
41+
)
4242
)
43-
private void onBlockEntityTick(CallbackInfo ci, Profiler profiler, Iterator iterator, boolean isRemoved, BlockEntityTickInvoker blockEntityTickInvoker) {
43+
private void onBlockEntityTick(CallbackInfo ci, @Local boolean isRemoved, @Local BlockEntityTickInvoker blockEntityTickInvoker) {
4444
if (this.isClient() && RyoamicLights.get().config.getBlockEntitiesLightSource().get() && !isRemoved) {
4545
var blockEntity = this.getBlockEntity(blockEntityTickInvoker.getPos());
4646
if (blockEntity != null)

common/src/main/java/org/thinkingstudio/ryoamiclights/util/SodiumDynamicLightHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static int getLightmap(BlockPos pos, int word, int lightmap) {
2626
return lightmap;
2727

2828
// Equivalent to world.getBlockState(pos).isOpaqueFullCube(world, pos)
29-
if (/*LightDataAccess.unpackFO(word)*/ (word >>> 30 & 1) != 0)
29+
if ((word >>> 30 & 1) != 0)
3030
return lightmap;
3131

3232
double dynamic = RyoamicLights.get().getDynamicLightLevel(pos);

fabric/CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
## Changelog
2-
- update dependencies
3-
- (Fabric) try fix nightconfig issue
2+
- update to 1.21.1

fabric/build.gradle

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,35 @@ loom {
77
accessWidenerPath = project(":common").loom.accessWidenerPath
88
}
99

10-
project.archivesBaseName = rootProject.archivesBaseName + "-fabric"
11-
1210
configurations {
13-
common
14-
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
11+
common {
12+
canBeResolved = true
13+
canBeConsumed = false
14+
}
1515
compileClasspath.extendsFrom common
1616
runtimeClasspath.extendsFrom common
1717
developmentFabric.extendsFrom common
18+
// Files in this configuration will be bundled into your mod using the Shadow plugin.
19+
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
20+
shadowBundle {
21+
canBeResolved = true
22+
canBeConsumed = false
23+
}
1824
}
1925

2026
dependencies {
21-
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
22-
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
23-
modApi "maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric"
24-
modCompileOnly "maven.modrinth:indium:${project.indium_version}"
27+
modImplementation("net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}")
28+
modApi("net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}")
29+
modApi("maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric")
30+
modCompileOnly("maven.modrinth:indium:${project.indium_version}")
2531

2632
modCompileOnly("com.terraformersmc:modmenu:${rootProject.mod_menu_version}") { transitive false }
2733

28-
implementation 'com.electronwill.night-config:core:3.6.6'
29-
implementation 'com.electronwill.night-config:toml:3.6.6'
30-
shadowCommon 'com.electronwill.night-config:core:3.6.6'
31-
shadowCommon 'com.electronwill.night-config:toml:3.6.6'
34+
shadowBundle("com.electronwill.night-config:core:3.8.0")
35+
shadowBundle("com.electronwill.night-config:toml:3.8.0")
3236

3337
common(project(path: ":common", configuration: "namedElements")) { transitive false }
34-
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
38+
shadowBundle(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
3539
}
3640

3741
processResources {
@@ -43,49 +47,15 @@ processResources {
4347
}
4448

4549
shadowJar {
46-
exclude "architectury.common.json"
47-
4850
relocate "com.electronwill.nightconfig", "${rootProject.maven_group}.shadow.nightconfig"
4951

50-
configurations = [project.configurations.shadowCommon]
52+
configurations = [project.configurations.shadowBundle]
5153
archiveClassifier.set("dev-shadow")
5254
}
5355

5456
remapJar {
55-
injectAccessWidener = true
56-
input.set shadowJar.archiveFile
57-
dependsOn shadowJar
58-
archiveClassifier.set(null)
59-
}
60-
61-
jar {
62-
archiveClassifier.set("dev")
63-
}
64-
65-
sourcesJar {
66-
def commonSources = project(":common").sourcesJar
67-
dependsOn commonSources
68-
from commonSources.archiveFile.map { zipTree(it) }
69-
}
70-
71-
components.java {
72-
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
73-
skip()
74-
}
75-
}
76-
77-
publishing {
78-
publications {
79-
mavenFabric(MavenPublication) {
80-
artifactId = rootProject.archives_base_name + "-" + project.name
81-
from components.java
82-
}
83-
}
84-
85-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
86-
repositories {
87-
// Add repositories to publish to here.
88-
}
57+
injectAccessWidener.set(true)
58+
inputFile.set(shadowJar.archiveFile)
8959
}
9060

9161
publisher {
@@ -100,7 +70,7 @@ publisher {
10070
setChangelog(file("CHANGELOG.md").getText("UTF-8"))
10171
setVersion("${rootProject.version}-fabric")
10272
setDisplayName("[Fabric] ${rootProject.version}")
103-
setGameVersions("1.21")
73+
setGameVersions("1.21", "1.21.1")
10474
setLoaders("fabric")
10575
setCurseEnvironment("client")
10676
setArtifact(remapJar)

fabric/src/main/java/org/thinkingstudio/fork/nightconfigfixes/NightConfigFixes.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)