Update to 1.19

This commit is contained in:
Emma Cypress Pointer-Null
2022-06-17 17:35:39 -04:00
parent 56e5e5feab
commit 527c625871
6 changed files with 23 additions and 32 deletions

View File

@@ -1,18 +1,15 @@
plugins { plugins {
id 'fabric-loom' version '0.9.+' id 'fabric-loom' version '0.12.+'
id 'maven-publish' id 'maven-publish'
} }
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name archivesBaseName = project.archives_base_name
version = project.mod_version version = project.mod_version
group = project.maven_group group = project.maven_group
minecraft {
}
repositories { repositories {
maven { url "https://maven.terraformersmc.com" } maven { url "https://maven.terraformersmc.com" }
maven { url "https://maven.shedaniel.me" } maven { url "https://maven.shedaniel.me" }
@@ -45,8 +42,9 @@ processResources {
// ensure that the encoding is set to UTF-8, no matter what the system default is // ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly // this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) { tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8" it.options.encoding = "UTF-8"
it.options.release.set(17)
} }
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
@@ -64,13 +62,7 @@ jar {
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven from components.java
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
} }
} }

View File

@@ -2,19 +2,18 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/versions.html # check these on https://fabricmc.net/develop/
minecraft_version=1.17.1 minecraft_version=1.19
yarn_mappings=1.17.1+build.61 yarn_mappings=1.19+build.4
loader_version=0.11.7 loader_version=0.14.8
# Mod Properties # Mod Properties
mod_version = 1.1.0 mod_version = 1.2.0
maven_group = eu.midnightdust maven_group = eu.midnightdust
archives_base_name = timechanger archives_base_name = timechanger
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api fabric_version=0.56.0+1.19
fabric_version=0.40.1+1.17
cloth_config_version = 5.0.38 cloth_config_version = 7.0.72
mod_menu_version = 2.0.2 mod_menu_version = 4.0.0

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -5,7 +5,7 @@ import eu.midnightdust.timechanger.config.TimeChangerConfig;
import me.shedaniel.autoconfig.AutoConfig; import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer; import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
public class TimeChangerClient implements ClientModInitializer { public class TimeChangerClient implements ClientModInitializer {
@@ -15,7 +15,7 @@ public class TimeChangerClient implements ClientModInitializer {
public void onInitializeClient() { public void onInitializeClient() {
AutoConfig.register(TimeChangerConfig.class, JanksonConfigSerializer::new); AutoConfig.register(TimeChangerConfig.class, JanksonConfigSerializer::new);
TC_CONFIG = AutoConfig.getConfigHolder(TimeChangerConfig.class).getConfig(); TC_CONFIG = AutoConfig.getConfigHolder(TimeChangerConfig.class).getConfig();
ClientCommandManager.DISPATCHER.register(ClientCommandManager.literal("ctime") ClientCommandManager.getActiveDispatcher().register(ClientCommandManager.literal("ctime")
.then(CTimeCommand.command()) .then(CTimeCommand.command())
); );
} }

View File

@@ -5,11 +5,11 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import eu.midnightdust.timechanger.TimeChangerClient; import eu.midnightdust.timechanger.TimeChangerClient;
import eu.midnightdust.timechanger.config.TimeChangerConfig; import eu.midnightdust.timechanger.config.TimeChangerConfig;
import me.shedaniel.autoconfig.AutoConfig; import me.shedaniel.autoconfig.AutoConfig;
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.text.TranslatableText; import net.minecraft.text.Text;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.argument; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
public class CTimeCommand { public class CTimeCommand {
@@ -24,7 +24,7 @@ public class CTimeCommand {
TimeChangerClient.TC_CONFIG.custom_time = time; TimeChangerClient.TC_CONFIG.custom_time = time;
AutoConfig.getConfigHolder(TimeChangerConfig.class).save(); AutoConfig.getConfigHolder(TimeChangerConfig.class).save();
source.sendFeedback(new TranslatableText("command.timechanger.ctime.success").append(String.valueOf(time))); source.sendFeedback(Text.translatable("command.timechanger.ctime.success").append(String.valueOf(time)));
return 1; return 1;
} }