Skip to content

Commit

Permalink
update to 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Aug 18, 2024
1 parent a98957b commit b37f928
Show file tree
Hide file tree
Showing 29 changed files with 265 additions and 767 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
## Changelog
- update dependencies
- (Fabric) try fix nightconfig issue
- update to 1.21.1
62 changes: 44 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id "com.github.johnrengelman.shadow" version "8.+" apply false
id "com.hypherionmc.modutils.modpublisher" version "2.+" apply false
}
Expand All @@ -9,28 +9,21 @@ architectury {
minecraft = rootProject.minecraft_version
}

allprojects {
version = "${rootProject.mod_version}+mc${rootProject.minecraft_version}"
group = rootProject.maven_group
}

subprojects {
apply plugin: "java"
apply plugin: "maven-publish"
apply plugin: "architectury-plugin"
apply plugin: "dev.architectury.loom"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "com.hypherionmc.modutils.modpublisher"

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered {
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
mappings "dev.architectury:yarn-mappings-patch-neoforge:${rootProject.mappings_patch}"
}
}
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"

archivesBaseName = rootProject.archives_base_name
version = "${rootProject.mod_version}+mc${rootProject.minecraft_version}"
group = rootProject.maven_group
archivesBaseName = "${rootProject.archives_base_name}-${project.name}"

repositories {
maven { url = "https://maven.gegy.dev" }
Expand All @@ -39,15 +32,48 @@ allprojects {
maven { url = "https://maven.terraformersmc.com/releases/" }
}

tasks.withType(JavaCompile) {
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered {
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
mappings "dev.architectury:yarn-mappings-patch-neoforge:${rootProject.mappings_patch}"
}

implementation("com.electronwill.night-config:core:3.8.0")
implementation("com.electronwill.night-config:toml:3.8.0")
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release = 21
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

withSourcesJar()
}

// Configure Maven publishing.
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = base.archivesName.get()
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
21 changes: 2 additions & 19 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,6 @@ loom {
dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modImplementation "maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric"

implementation "com.electronwill.night-config:core:3.6.6"
implementation "com.electronwill.night-config:toml:3.6.6"
}

publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archives_base_name
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
modImplementation("net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}")
modImplementation("maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric")
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ public static boolean isLilTaterReloadedInstalled() {
* @return {@code true} if Sodium is installed, else {@code false}
*/
public static boolean isSodiumInstalled() {
return ModPlatform.isModLoaded("sodium") != ModPlatform.isModLoaded("embeddium");
return ModPlatform.isModLoaded("sodium");
}

/**
* Returns whether Embeddium is installed.
*
* @return {@code true} if Embeddium is installed, else {@code false}
*/
public static boolean isEmbeddiumInstalled() {
return ModPlatform.isModLoaded("embeddium");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

package org.thinkingstudio.ryoamiclights.mixin;

import com.llamalad7.mixinextras.sugar.Local;
import org.thinkingstudio.ryoamiclights.DynamicLightSource;
import org.thinkingstudio.ryoamiclights.RyoamicLights;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.world.World;
import net.minecraft.world.chunk.BlockEntityTickInvoker;
import org.jetbrains.annotations.Nullable;
Expand All @@ -23,9 +23,6 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

import java.util.Iterator;

@Mixin(World.class)
public abstract class WorldMixin {
Expand All @@ -37,10 +34,13 @@ public abstract class WorldMixin {

@Inject(
method = "tickBlockEntities",
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/BlockEntityTickInvoker;tick()V", shift = At.Shift.BEFORE),
locals = LocalCapture.CAPTURE_FAILEXCEPTION
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/chunk/BlockEntityTickInvoker;tick()V",
shift = At.Shift.BEFORE
)
)
private void onBlockEntityTick(CallbackInfo ci, Profiler profiler, Iterator iterator, boolean isRemoved, BlockEntityTickInvoker blockEntityTickInvoker) {
private void onBlockEntityTick(CallbackInfo ci, @Local boolean isRemoved, @Local BlockEntityTickInvoker blockEntityTickInvoker) {
if (this.isClient() && RyoamicLights.get().config.getBlockEntitiesLightSource().get() && !isRemoved) {
var blockEntity = this.getBlockEntity(blockEntityTickInvoker.getPos());
if (blockEntity != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static int getLightmap(BlockPos pos, int word, int lightmap) {
return lightmap;

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

double dynamic = RyoamicLights.get().getDynamicLightLevel(pos);
Expand Down
3 changes: 1 addition & 2 deletions fabric/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
## Changelog
- update dependencies
- (Fabric) try fix nightconfig issue
- update to 1.21.1
72 changes: 21 additions & 51 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,35 @@ loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
}

project.archivesBaseName = rootProject.archivesBaseName + "-fabric"

configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
common {
canBeResolved = true
canBeConsumed = false
}
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentFabric.extendsFrom common
// Files in this configuration will be bundled into your mod using the Shadow plugin.
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
shadowBundle {
canBeResolved = true
canBeConsumed = false
}
}

dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
modApi "maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric"
modCompileOnly "maven.modrinth:indium:${project.indium_version}"
modImplementation("net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}")
modApi("net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}")
modApi("maven.modrinth:obsidianui:${rootProject.obsidianui_version}-fabric")
modCompileOnly("maven.modrinth:indium:${project.indium_version}")

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

implementation 'com.electronwill.night-config:core:3.6.6'
implementation 'com.electronwill.night-config:toml:3.6.6'
shadowCommon 'com.electronwill.night-config:core:3.6.6'
shadowCommon 'com.electronwill.night-config:toml:3.6.6'
shadowBundle("com.electronwill.night-config:core:3.8.0")
shadowBundle("com.electronwill.night-config:toml:3.8.0")

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
shadowBundle(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
}

processResources {
Expand All @@ -43,49 +47,15 @@ processResources {
}

shadowJar {
exclude "architectury.common.json"

relocate "com.electronwill.nightconfig", "${rootProject.maven_group}.shadow.nightconfig"

configurations = [project.configurations.shadowCommon]
configurations = [project.configurations.shadowBundle]
archiveClassifier.set("dev-shadow")
}

remapJar {
injectAccessWidener = true
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set(null)
}

jar {
archiveClassifier.set("dev")
}

sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

publishing {
publications {
mavenFabric(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
injectAccessWidener.set(true)
inputFile.set(shadowJar.archiveFile)
}

publisher {
Expand All @@ -100,7 +70,7 @@ publisher {
setChangelog(file("CHANGELOG.md").getText("UTF-8"))
setVersion("${rootProject.version}-fabric")
setDisplayName("[Fabric] ${rootProject.version}")
setGameVersions("1.21")
setGameVersions("1.21", "1.21.1")
setLoaders("fabric")
setCurseEnvironment("client")
setArtifact(remapJar)
Expand Down

This file was deleted.

Loading

0 comments on commit b37f928

Please sign in to comment.