Skip to content

Commit 2844c97

Browse files
committed
Merge remote-tracking branch 'origin/1.16' into 1.18
2 parents 27c7400 + 5e7d664 commit 2844c97

File tree

8 files changed

+171
-15
lines changed

8 files changed

+171
-15
lines changed

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ configure(subprojects.findAll {it.name == "common" || it.name == "forge" || it.n
146146
}
147147
}
148148

149-
tasks.withType(JavaCompile) {
149+
tasks.withType(JavaCompile).configureEach {
150150
// ensure that the encoding is set to UTF-8, no matter what the system default is
151151
// this fixes some edge cases with special characters not displaying correctly
152152
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
@@ -164,10 +164,10 @@ tasks.withType(JavaCompile) {
164164
*/
165165
}
166166

167-
task generateChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
167+
tasks.register('generateChangelog', se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
168168
def details = versionDetails();
169169
def theVersionRef
170-
if(details.commitDistance > 0) {
170+
if (details.commitDistance > 0) {
171171
theVersionRef = details.lastTag;
172172
} else {
173173
def secondLastTagCmd = "git describe --abbrev=0 " + details.lastTag + "^"
@@ -204,8 +204,8 @@ configure(subprojects.findAll {it.name == "forge" || it.name == "fabric"}) {
204204
}
205205
runs {
206206
client {
207-
vmArgs "-Xmx512m"
208-
vmArgs "-Xms512m"
207+
vmArgs "-Xmx1G"
208+
vmArgs "-Xms1G"
209209
}
210210
}
211211
}

common/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ dependencies {
3333
// modApi "me.shedaniel:architectury:${rootProject.architectury_version}"
3434
}
3535

36+
// don't need remapped common jar
37+
tasks.named('remapJar') { enabled = false }
38+
3639
publishing {
3740
publications {
3841
mavenCommon(MavenPublication) {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.embeddedt.modernfix.common.mixin.perf.mojang_registry_size;
2+
3+
import com.google.common.collect.ImmutableTable;
4+
import com.google.common.collect.Table;
5+
import net.minecraft.world.level.block.state.StateHolder;
6+
import net.minecraft.world.level.block.state.properties.Property;
7+
import org.embeddedt.modernfix.annotation.RequiresMod;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.Shadow;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
import org.spongepowered.asm.mixin.injection.Inject;
12+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13+
14+
/**
15+
* Minor mixin to avoid duplicate empty neighbor tables, used when FerriteCore is not present. Won't be enabled in 99% of
16+
* modded environments but is useful for testing in dev without dragging in Fabric API.
17+
*/
18+
@Mixin(StateHolder.class)
19+
@RequiresMod("!ferritecore")
20+
public class StateHolderMixin {
21+
@Shadow private Table<Property<?>, Comparable<?>, ?> neighbours;
22+
23+
/* optimize the case where block has no properties */
24+
@Inject(method = "populateNeighbours", at = @At("RETURN"), require = 0)
25+
private void replaceEmptyTable(CallbackInfo ci) {
26+
if(this.neighbours.isEmpty())
27+
this.neighbours = ImmutableTable.of();
28+
}
29+
}

common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private void scanForAndBuildMixinOptions() {
112112
if(annotation.values.get(i).equals("value")) {
113113
String modId = (String)annotation.values.get(i + 1);
114114
if(modId != null) {
115-
requiredModPresent = modPresent(modId);
115+
requiredModPresent = modId.startsWith("!") ? !modPresent(modId.substring(1)) : modPresent(modId);
116116
requiredModId = modId;
117117
}
118118
break;

common/src/main/resources/assets/modernfix/lang/ja_jp.json

Lines changed: 115 additions & 0 deletions
Large diffs are not rendered by default.

common/src/main/resources/assets/modernfix/lang/zh_cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"modernfix.perf_mod_warning": "推荐安装这些模组,但你也可以在现代化修复的配置中禁用此警告。",
88
"modernfix.config": "现代化修复Mixin配置",
99
"modernfix.config.done_restart": "完成(生效需重启)",
10+
"modernfix.message.reload_config": "在游戏外编辑完配置文件后,使用§b/mfrc§r命令使其生效。",
1011
"modernfix.option.on": "开启",
1112
"modernfix.option.off": "关闭",
1213
"modernfix.option.disabled": "已禁用",

fabric/build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,21 @@ dependencies {
3232
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
3333
testImplementation "net.fabricmc:fabric-loader-junit:${rootProject.fabric_loader_version}"
3434

35-
modImplementation(fabricApi.module("fabric-api-base", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
36-
modImplementation(fabricApi.module("fabric-screen-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
37-
modImplementation(fabricApi.module("fabric-command-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
38-
modImplementation(fabricApi.module("fabric-models-v0", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
35+
modCompileOnly(fabricApi.module("fabric-api-base", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
36+
modCompileOnly(fabricApi.module("fabric-screen-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
37+
modCompileOnly(fabricApi.module("fabric-command-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
38+
modCompileOnly(fabricApi.module("fabric-models-v0", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
3939
modIncludeImplementation(fabricApi.module("fabric-resource-loader-v0", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
40-
modImplementation(fabricApi.module("fabric-data-generation-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
41-
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") { transitive false }
42-
modImplementation "curse.maven:spark-361579:${rootProject.spark_version}"
43-
modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}") { exclude group: 'net.fabricmc', module: 'fabric-loader' }
40+
modCompileOnly(fabricApi.module("fabric-data-generation-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
41+
if(project.use_fabric_api_at_runtime.toBoolean()) {
42+
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") { transitive false }
43+
modImplementation "curse.maven:spark-361579:${rootProject.spark_version}"
44+
modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}") { exclude group: 'net.fabricmc', module: 'fabric-loader' }
45+
} else {
46+
modCompileOnly("com.terraformersmc:modmenu:${rootProject.modmenu_version}") { transitive false }
47+
modCompileOnly "curse.maven:spark-361579:${rootProject.spark_version}"
48+
}
49+
4450
// Remove the next line if you don't want to depend on the API
4551
// modApi "me.shedaniel:architectury-fabric:${rootProject.architectury_version}"
4652

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ fabric_api_version=0.76.0+1.18.2
2323
modmenu_version=3.2.5
2424
appeng_version=11.7.2
2525

26-
spark_version=4505375
26+
spark_version=4505375
27+
28+
use_fabric_api_at_runtime=true

0 commit comments

Comments
 (0)