Skip to content

Commit

Permalink
Merge branch 'QuiltMC:develop' into heipiao233-patch-chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
heipiao233 authored Apr 14, 2024
2 parents b901180 + bc70813 commit 460f345
Show file tree
Hide file tree
Showing 113 changed files with 5,932 additions and 2,570 deletions.
16 changes: 11 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ sourceSets {
}

configurations {
include
include {
transitive = false
}

implementation {
extendsFrom include
Expand Down Expand Up @@ -107,19 +109,23 @@ dependencies {
/*include*/ api "org.quiltmc:quilt-json5:${project.quilt_json5}"
include "org.quiltmc:quilt-loader-sat4j:${project.quilt_loader_sat4j}"

include "org.quiltmc.quilt-config.serializers:toml:${project.quilt_config}"
include "org.quiltmc.quilt-config.serializers:json5:${project.quilt_config}"
api "org.quiltmc:quilt-config:${project.quilt_config}"

include "com.electronwill.night-config:core:${project.night_config}"
include "com.electronwill.night-config:toml:${project.night_config}"
api "org.quiltmc:quilt-config:${project.quilt_config}"
shadow "com.electronwill.night-config:core:${project.night_config}"
shadow "com.electronwill.night-config:toml:${project.night_config}"

development "io.github.llamalad7:mixinextras-fabric:$mixin_extras"

// also must update in minecraft AND minecraft test
compileOnly "org.quiltmc.chasm:chasm:${project.quilt_chasm}"
compileOnly "org.quiltmc.chasm:chassembly:${project.quilt_chasm}"


shadow "com.electronwill.night-config:core:${project.night_config}"
shadow "com.electronwill.night-config:toml:${project.night_config}"
shadow "org.quiltmc.quilt-config.serializers:toml:${project.quilt_config}"
shadow "org.quiltmc.quilt-config.serializers:json5:${project.quilt_config}"
shadow "org.quiltmc.parsers:json:${project.quilt_parsers}"
include "org.quiltmc.parsers:json:${project.quilt_parsers}"
include "com.unascribed:flexver-java:${project.flexver}"
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ group = org.quiltmc
description = The mod loading component of Quilt
url = https://github.com/quiltmc/quilt-loader
# Don't forget to change this in QuiltLoaderImpl as well
quilt_loader = 0.23.0
quilt_loader = 0.25.0-beta.4

# Fabric & Quilt Libraries
asm = 9.6
sponge_mixin = 0.12.5+mixin.0.8.5
tiny_mappings_parser = 0.3.0+build.17
tiny_remapper = 0.8.6
tiny_remapper = 0.10.1
access_widener = 2.1.0
quilt_json5 = 1.0.4+final
quilt_parsers = 0.2.0
quilt_loader_sat4j = 2.3.5.1
quilt_config = 1.1.0
quilt_config = 1.3.0
quilt_chasm = 0.1.0-20230126.045734-27

# Other Libraries
Expand All @@ -27,4 +27,4 @@ junit_bom = 5.9.3
proguard_gradle = 7.3.2
github_api = 1.315
flexver = 1.1.0
mixin_extras = 0.3.2
mixin_extras = 0.3.5
2 changes: 1 addition & 1 deletion minecraft/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {

dependencies {
api project(":")

implementation project(":").sourceSets.main.output
// log4j wrapper
compileOnly 'org.apache.logging.log4j:log4j-api:2.8.1'
// slf4j wrapper
Expand Down
1 change: 1 addition & 0 deletions minecraft/minecraft-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies {

implementation project(":minecraft")
implementation project(":minecraft").sourceSets.main.output
implementation project(":")
implementation project(":").sourceSets.main.output
// so that it works on runtime
implementation "org.quiltmc.chasm:chassembly:${project.quilt_chasm}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.fabricmc.minecraft.test.server_only;

import org.quiltmc.loader.api.minecraft.DedicatedServerOnly;

@DedicatedServerOnly
public class TestMixinGuiHelper {

public static void help() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @org.quiltmc.loader.api.minecraft.DedicatedServerOnly
//@org.quiltmc.loader.api.minecraft.DedicatedServerOnly
//@org.quiltmc.loader.api.Requires({"trinkets", "quilt_loader", "minecraft", "buildcraft"})
// Uncomment the above line to test out package based stripping.
package net.fabricmc.minecraft.test.server_only;
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ protected static String getRelease(String version) {
int year = Integer.parseInt(matcher.group(1));
int week = Integer.parseInt(matcher.group(2));

if (year >= 23 && week >= 51) {
if (year == 23 && week >= 51 || year >= 24) {
return "1.20.5";
} else if (year == 23 && week >= 40 && week <= 46) {
return "1.20.3";
Expand Down Expand Up @@ -324,9 +324,9 @@ protected static String getRelease(String version) {
} else if (year == 14 && week >= 2 && week <= 34) {
return "1.8";
} else if (year == 13 && week >= 47 && week <= 49) {
return "1.7.4";
return "1.7.3";
} else if (year == 13 && week >= 36 && week <= 43) {
return "1.7.2";
return "1.7";
} else if (year == 13 && week >= 16 && week <= 26) {
return "1.6";
} else if (year == 13 && week >= 11 && week <= 12) {
Expand All @@ -336,11 +336,11 @@ protected static String getRelease(String version) {
} else if (year == 12 && week >= 49 && week <= 50) {
return "1.4.6";
} else if (year == 12 && week >= 32 && week <= 42) {
return "1.4.2";
return "1.4";
} else if (year == 12 && week >= 15 && week <= 30) {
return "1.3.1";
return "1.3";
} else if (year == 12 && week >= 3 && week <= 8) {
return "1.2.1";
return "1.2";
} else if (year == 11 && week >= 47 || year == 12 && week <= 1) {
return "1.1";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public boolean locateGame(QuiltLauncher launcher, String[] args) {
// expose obfuscated jar locations for mods to more easily remap code from obfuscated to intermediary
ObjectShare share = QuiltLoaderImpl.INSTANCE.getObjectShare();
share.put("fabric-loader:inputGameJar", gameJars.get(0)); // deprecated
share.put("fabric-loader:inputGameJars", gameJars);
share.put("fabric-loader:inputGameJars", Collections.unmodifiableList(new ArrayList<>(gameJars))); // need to make copy as gameJars is later mutated to hold the remapped jars
if (realmsJar != null) share.put("fabric-loader:inputRealmsJar", realmsJar);

String version = arguments.remove(Arguments.GAME_VERSION);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright 2016 FabricMC
* Copyright 2022-2023 QuiltMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.fabricmc.loader.impl.gui;

import java.awt.GraphicsEnvironment;
import java.util.function.Consumer;

import org.quiltmc.loader.api.gui.LoaderGuiException;
import org.quiltmc.loader.api.gui.QuiltLoaderGui;
import org.quiltmc.loader.api.gui.QuiltLoaderText;
import org.quiltmc.loader.impl.QuiltLoaderImpl;
import org.quiltmc.loader.impl.game.GameProvider;
import org.quiltmc.loader.impl.gui.QuiltGuiEntry;
import org.quiltmc.loader.impl.util.log.Log;
import org.quiltmc.loader.impl.util.log.LogCategory;

import net.fabricmc.loader.impl.gui.FabricStatusTree.FabricBasicButtonType;
import net.fabricmc.loader.impl.gui.FabricStatusTree.FabricStatusTab;

/** @deprecated Replaced by the public APIs in {@link QuiltLoaderGui} */
@Deprecated
public class FabricGuiEntry {

/** Opens the given {@link FabricStatusTree} in a new swing window.
*
* @throws Exception if something went wrong while opening the window. */
public static void open(FabricStatusTree tree) throws Exception {
QuiltLoaderGui.open(tree.toQuiltWindow());
}

/** @param exitAfter If true then this will call {@link System#exit(int)} after showing the gui, otherwise this will
* return normally. */
public static void displayCriticalError(Throwable exception, boolean exitAfter) {
displayError(QuiltLoaderText.translate("").toString(), exception, exitAfter);
}

public static void displayError(String mainText, Throwable exception, boolean exitAfter) {
QuiltGuiEntry.displayError(mainText, exception, true, exitAfter);
}

public static void displayError(String mainText, Throwable exception, Consumer<FabricStatusTree> treeCustomiser, boolean exitAfter) {
GameProvider provider = QuiltLoaderImpl.INSTANCE.tryGetGameProvider();

if ((provider == null || provider.canOpenGui()) && !GraphicsEnvironment.isHeadless()) {
FabricStatusTree tree = new FabricStatusTree("Quilt Loader " + QuiltLoaderImpl.VERSION, mainText);
FabricStatusTab crashTab = tree.addTab(QuiltLoaderText.translate("tab.messages").toString());

if (exception == null) {
exception = new Error("Missing exception!");
}
crashTab.node.addCleanedException(exception);

tree.addButton(QuiltLoaderText.translate("button.exit").toString(), FabricBasicButtonType.CLICK_ONCE).makeClose();
treeCustomiser.accept(tree);
try {
QuiltLoaderGui.open(tree.toQuiltWindow());
} catch (LoaderGuiException e) {
if (exitAfter) {
Log.warn(LogCategory.GENERAL, "Failed to open the error gui!", e);
} else {
throw new RuntimeException("Failed to open the error gui!", e);
}
}
}

if (exitAfter) {
System.exit(1);
}
}
}
Loading

0 comments on commit 460f345

Please sign in to comment.