Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
plugins {
id 'fabric-loom' version "${loom_version}"
id 'net.fabricmc.fabric-loom' version "${loom_version}"
id 'maven-publish'
id 'io.freefair.lombok' version '8.10'
id 'io.freefair.lombok' version '9.5.0'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(25)
}
}
base {
archivesName = project.archives_base_name
}

lombok {
version = project.lombok_version
}

version = "${project.minecraft_version}-${project.mod_version}"
group = project.maven_group

Expand All @@ -22,7 +26,9 @@ if (file("extra.properties").exists()) {
}

repositories {
mavenLocal()
mavenCentral()
maven { url 'https://api.modrinth.com/maven' }
mavenLocal() // only used to build the mod locally
maven { url 'https://masa.dy.fi/maven' }
maven { url 'https://jitpack.io' }
Expand All @@ -42,11 +48,10 @@ repositories {
dependencies {
implementation 'org.projectlombok:lombok:1.18.28'
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
modImplementation files("../malilib-fabric-1.21.11-0.27.8.jar")
modImplementation files("../AdvancedChatCore-1.21.11-1.5.17-alpha.1.jar")
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
implementation "maven.modrinth:malilib:${project.malilib_version}"
implementation "com.arematics:advancedchatcore:${project.advancedchat_version}"
}

processResources {
Expand All @@ -59,7 +64,8 @@ processResources {

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 21
it.options.release = 25
it.options.compilerArgs << "-Xmaxerrs" << "10000"
}

java {
Expand All @@ -73,11 +79,11 @@ jar {
publishing {
publications {
mavenJava(MavenPublication) {
artifact(remapJar) {
builtBy remapJar
artifact(jar) {
builtBy jar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
builtBy sourcesJar
}
}
}
Expand Down
18 changes: 10 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
org.gradle.jvmargs=-Xmx1G

# https://fabricmc.net/develop
minecraft_version=1.21.11
yarn_mappings=1.21.11+build.4
loader_version=0.17.3
loom_version=1.15.5
fabric_api_version=0.136.0+1.21.11
minecraft_version=26.2
loader_version=0.19.3
loom_version=1.17.+
fabric_api_version=0.156.0+26.2

mod_version=1.6.0
mod_version=1.7.2-alpha.1
maven_group=com.arematics
archives_base_name=AdvancedChatLog

advancedchat_version=1.21.11-1.6.0
advancedchat_version=26.2-1.7.2-alpha.1
# https://jitpack.io/#sakura-ryoko/malilib
malilib_version=0.27.8
malilib_version=0.29.3
# 1.18.42+ is required for JDK 25
lombok_version=1.18.46
modmenu_version=20.0.1
3 changes: 3 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#This file is generated by updateDaemonJvm
#Minecraft 26.2 requires the Gradle daemon itself to run on Java 25.
toolchainVersion=25
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 5 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ pluginManagement {
mavenCentral()
}
}

// Lets Gradle download a JDK 25 toolchain automatically, so no system JDK 25 is required.
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.text.Text;
import net.minecraft.network.chat.Component;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LoggerContext;
Expand Down Expand Up @@ -74,7 +74,7 @@ private static void setupLogger() {
loggerContext.updateLoggers();
}

public static void logChatMessage(Text text) {
public static void logChatMessage(Component text) {
if (ChatLogData.isLoading()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import lombok.Getter;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;

@Environment(EnvType.CLIENT)
public class ChatLogData implements IChatMessageProcessor {
Expand All @@ -45,7 +45,7 @@ private void add(ChatMessage message) {
LogChatMessage log = new LogChatMessage(message);
messages.add(0, log);
AdvancedChatLog.logChatMessage(message.getOriginalText());
Screen screen = MinecraftClient.getInstance().currentScreen;
Screen screen = Minecraft.getInstance().gui.screen();
if (screen instanceof ChatLogScreen) {
((ChatLogScreen) screen).add(log);
}
Expand All @@ -63,7 +63,7 @@ public void onMessageUpdate(ChatMessage message, UpdateType type) {
if (type != UpdateType.NEW) {
return;
}
int width = MinecraftClient.getInstance().getWindow().getScaledWidth() - 20;
int width = Minecraft.getInstance().getWindow().getGuiScaledWidth() - 20;
add(message.shallowClone(width));
while (messages.size()
> ChatLogConfigStorage.General.STORED_LINES.config.getIntegerValue()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import fi.dy.masa.malilib.hotkeys.KeyAction;
import fi.dy.masa.malilib.hotkeys.KeybindSettings;
import fi.dy.masa.malilib.util.FileUtils;
import fi.dy.masa.malilib.util.JsonUtils;
import fi.dy.masa.malilib.util.data.json.JsonUtils;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.config.ConfigStorage;
import io.github.darkkronicle.advancedchatcore.config.SaveableConfig;
Expand Down Expand Up @@ -206,16 +206,16 @@ public static void saveFromFile() {
@Override
public void load() {
LogUtils.getLogger().info("[AdvancedChatLog] Loading...");
long time = Util.getMeasuringTimeMs();
long time = Util.getMillis();
loadFromFile();
LogUtils.getLogger().info("[AdvancedChatLog] Load completed in {}ms", Util.getMeasuringTimeMs() - time);
LogUtils.getLogger().info("[AdvancedChatLog] Load completed in {}ms", Util.getMillis() - time);
}

@Override
public void save() {
LogUtils.getLogger().info("[AdvancedChatLog] Saving...");
long time = Util.getMeasuringTimeMs();
long time = Util.getMillis();
saveFromFile();
LogUtils.getLogger().info("[AdvancedChatLog] Save completed in {}ms", Util.getMeasuringTimeMs() - time);
LogUtils.getLogger().info("[AdvancedChatLog] Save completed in {}ms", Util.getMillis() - time);
}
}
Loading