Skip to content

Commit

Permalink
support: mc 1.16.5 and 1.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyDynamic committed Dec 16, 2023
1 parent ca5ad17 commit 49cb284
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 28 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/matrix_includes.json
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
[
{
"subproject_dir": "1.18.2"
},
{
"subproject_dir": "1.19.4"
},
{
"subproject_dir": "1.20.1"
}
]
[ "1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1", "1.20.2", "1.20.3", "1.20.4" ]
6 changes: 3 additions & 3 deletions .github/workflows/scripts/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A script to scan through all valid mod jars in build-artifacts.zip/$version/build/libs,
and generate an artifact summary table for that to GitHub action step summary
"""
__author__ = 'Fallen_Breath'
__author__ = ['Fallen_Breath', 'Sky_Dynamic']

import glob
import json
Expand All @@ -19,15 +19,15 @@ def read_prop(file_name: str, key: str) -> str:

target_subproject = os.environ.get('TARGET_SUBPROJECT', '')
with open('.github/workflows/matrix_includes.json') as f:
matrix: list[dict] = json.load(f)
matrix: list[str] = json.load(f)

with open(os.environ['GITHUB_STEP_SUMMARY'], 'w') as f:
f.write('## Build Artifacts Summary\n\n')
f.write('| Subproject | for Minecraft | Files |\n')
f.write('| --- | --- | --- |\n')

for m in matrix:
subproject = m['subproject_dir']
subproject = m
if target_subproject != '' and subproject != target_subproject:
continue
game_versions = read_prop('versions/{}/gradle.properties'.format(subproject), 'game_versions')
Expand Down
34 changes: 20 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT' apply false
id 'maven-publish'
id 'com.replaymod.preprocess' version 'SNAPSHOT'
id "fabric-loom" version "1.4-SNAPSHOT" apply false
id "maven-publish"
id "com.replaymod.preprocess" version "SNAPSHOT"
}

preprocess {
def mc118 = createNode('1.18.2', 1_18_02, 'yarn')
def mc119 = createNode('1.19.4', 1_19_04, 'yarn')
def mc1201 = createNode('1.20.1', 1_20_01, 'yarn')
def mc1202 = createNode("1.20.2", 1_20_02, 'yarn')
def mc1203 = createNode("1.20.3", 1_20_03, 'yarn')
def mc1204 = createNode("1.20.4", 1_20_04, 'yarn')
def mc116 = createNode("1.16.5", 1_16_05, "yarn")
def mc117 = createNode("1.17.1", 1_17_01, "yarn")
def mc118 = createNode("1.18.2", 1_18_02, "yarn")
def mc119 = createNode("1.19.4", 1_19_04, "yarn")
def mc1200 = createNode("1.20", 1_20_00, "yarn")
def mc1201 = createNode("1.20.1", 1_20_01, "yarn")
def mc1202 = createNode("1.20.2", 1_20_02, "yarn")
def mc1203 = createNode("1.20.3", 1_20_03, "yarn")
def mc1204 = createNode("1.20.4", 1_20_04, "yarn")

mc118.link(mc119, file('versions/mapping-1.18-1.19.txt'))
mc119.link(mc1201, file('versions/mapping-1.19-1.20.txt'))
mc1201.link(mc1202, file('versions/mapping-1.19-1.20.txt'))
mc1202.link(mc1203, file('versions/mapping-1.19-1.20.txt'))
mc1203.link(mc1204, file('versions/mapping-1.19-1.20.txt'))
mc116.link(mc117, file("versions/mapping-1.16-1.17.txt"))
mc117.link(mc118, file("versions/mapping-1.17-1.18.txt"))
mc118.link(mc119, file("versions/mapping-1.18-1.19.txt"))
mc119.link(mc1200, file("versions/mapping-1.19-1.20.txt"))
mc1200.link(mc1201, file("versions/mapping-1.19-1.20.txt"))
mc1201.link(mc1202, file("versions/mapping-1.19-1.20.txt"))
mc1202.link(mc1203, file("versions/mapping-1.19-1.20.txt"))
mc1203.link(mc1204, file("versions/mapping-1.19-1.20.txt"))
}
2 changes: 2 additions & 0 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ dependencies {
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_version}"

implementation group: 'commons-io', name: 'commons-io', version: '2.15.1'
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.0'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.1'
}

String versionSuffix = ''
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ pluginManagement {
}

def versions = Arrays.asList(
"1.16.5",
"1.17.1",
"1.18.2",
"1.19.4",
"1.20",
"1.20.1",
"1.20.2",
"1.20.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ public void run() {
Config.TEMP_CONFIG.setIsBackupValue(false);
Text title = Text.of(tr("quickbackupmulti.toast.end_title"));
Text content = Text.of(tr("quickbackupmulti.toast.end_content"));
//#if MC>=11800
SystemToast.show(minecraftClient.toastManager, SystemToast.Type.PERIODIC_NOTIFICATION, title, content);
//#else
//$$ SystemToast.show(minecraftClient.toastManager, SystemToast.Type.WORLD_BACKUP, title, content);
//#endif
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ void inj(CallbackInfo ci) {
if (Config.TEMP_CONFIG.isBackup) {
Text title = Text.of(tr("quickbackupmulti.toast.start_title"));
Text content = Text.of(tr("quickbackupmulti.toast.start_content"));
//#if MC>=11800
SystemToast.show(this.toastManager, SystemToast.Type.PERIODIC_NOTIFICATION, title, content);
//#else
//$$ SystemToast.show(this.toastManager, SystemToast.Type.WORLD_BACKUP, title, content);
//#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ public static int make(ServerCommandSource commandSource, int slot, String desc)
try {
Messenger.sendMessage(commandSource, Text.of(tr("quickbackupmulti.make.start")));
MinecraftServer server = commandSource.getServer();
//#if MC>11800
server.saveAll(true, true, true);
//#else
//$$ server.save(true, true, true);
//#endif
for (ServerWorld serverWorld : server.getWorlds()) {
if (serverWorld == null || serverWorld.savingDisabled) continue;
serverWorld.savingDisabled = true;
Expand Down
4 changes: 4 additions & 0 deletions versions/1.16.5/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.10
fabric_version=0.42.0+1.16
game_versions = 1.16.5
6 changes: 6 additions & 0 deletions versions/1.16.5/qbm.accesswidener
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessWidener v2 named

accessible method net/minecraft/server/MinecraftServer runServer ()V
accessible field net/minecraft/server/MinecraftServer stopped Z
accessible field net/minecraft/server/MinecraftServer running Z
accessible field net/minecraft/client/MinecraftClient toastManager Lnet/minecraft/client/toast/ToastManager;
4 changes: 4 additions & 0 deletions versions/1.17.1/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.65
fabric_version=0.46.1+1.17
game_versions = 1.17.1
6 changes: 6 additions & 0 deletions versions/1.17.1/qbm.accesswidener
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessWidener v2 named

accessible method net/minecraft/server/MinecraftServer runServer ()V
accessible field net/minecraft/server/MinecraftServer stopped Z
accessible field net/minecraft/server/MinecraftServer running Z
accessible field net/minecraft/client/MinecraftClient toastManager Lnet/minecraft/client/toast/ToastManager;
4 changes: 4 additions & 0 deletions versions/1.20/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
minecraft_version=1.20
yarn_mappings=1.20+build.1
fabric_version=0.83.0+1.20
game_versions = 1.20
6 changes: 6 additions & 0 deletions versions/1.20/qbm.accesswidener
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessWidener v2 named

accessible method net/minecraft/server/MinecraftServer runServer ()V
accessible field net/minecraft/server/MinecraftServer stopped Z
accessible field net/minecraft/server/MinecraftServer running Z
accessible field net/minecraft/client/MinecraftClient toastManager Lnet/minecraft/client/toast/ToastManager;
Empty file added versions/mapping-1.16-1.17.txt
Empty file.
Empty file added versions/mapping-1.17-1.18.txt
Empty file.

0 comments on commit 49cb284

Please sign in to comment.