Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Commit

Permalink
update to newest mapping-io
Browse files Browse the repository at this point in the history
this should fix issues with other mods bundling newer versions of it
  • Loading branch information
BasiqueEvangelist committed Jul 26, 2024
1 parent 7884ab0 commit 007af76
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ org.gradle.jvmargs=-Xmx1G
modmenu_version=11.0.1
rei_version=16.0.729
fabric_perms_api=0.3.1
mapping_io=0.4.2
mapping_io=0.6.1
auoeke_result=0.4.1
auoeke_unsafe=1.7.3
auoeke_reflect=6.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.wispforest.gadget.util.ProgressToast;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.mappingio.MappingVisitor;
import net.fabricmc.mappingio.format.Tiny2Reader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader;
import net.minecraft.SharedConstants;
import net.minecraft.text.Text;
import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -45,7 +45,7 @@ public static void loadIntermediary(ProgressToast toast, MappingVisitor visitor)

try (FileSystem fs = FileSystems.newFileSystem(intermediaryPath, (ClassLoader) null);
BufferedReader br = Files.newBufferedReader(fs.getPath("mappings/mappings.tiny"))) {
Tiny2Reader.read(br, visitor);
Tiny2FileReader.read(br, visitor);
}
}
}
12 changes: 6 additions & 6 deletions src/main/java/io/wispforest/gadget/mappings/MojangMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.mappingio.MappingVisitor;
import net.fabricmc.mappingio.adapter.MappingSourceNsSwitch;
import net.fabricmc.mappingio.format.ProGuardReader;
import net.fabricmc.mappingio.format.Tiny2Reader;
import net.fabricmc.mappingio.format.Tiny2Writer;
import net.fabricmc.mappingio.format.proguard.ProGuardFileReader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileWriter;
import net.fabricmc.mappingio.tree.MemoryMappingTree;
import net.minecraft.SharedConstants;
import net.minecraft.text.Text;
Expand All @@ -34,7 +34,7 @@ protected void load(ProgressToast toast, MappingVisitor visitor) {

if (Files.exists(mojPath)) {
try (BufferedReader br = Files.newBufferedReader(mojPath)) {
Tiny2Reader.read(br, visitor);
Tiny2FileReader.read(br, visitor);
return;
}
}
Expand Down Expand Up @@ -70,7 +70,7 @@ protected void load(ProgressToast toast, MappingVisitor visitor) {
readProGuardInto(toast, JsonHelper.getString(serverMappings, "url"), sw);

try (BufferedWriter bw = Files.newBufferedWriter(mojPath)) {
tree.accept(new Tiny2Writer(bw, false));
tree.accept(new Tiny2FileWriter(bw, false));
}

tree.accept(visitor);
Expand All @@ -81,7 +81,7 @@ protected void load(ProgressToast toast, MappingVisitor visitor) {

private void readProGuardInto(ProgressToast toast, String url, MappingVisitor visitor) throws IOException {
try (var is = toast.loadWithProgress(new URL(url))) {
ProGuardReader.read(new InputStreamReader(new BufferedInputStream(is)), "named", "official", visitor);
ProGuardFileReader.read(new InputStreamReader(new BufferedInputStream(is)), "named", "official", visitor);
}
}
}
10 changes: 5 additions & 5 deletions src/main/java/io/wispforest/gadget/mappings/QuiltMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import io.wispforest.gadget.util.ProgressToast;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.mappingio.MappingVisitor;
import net.fabricmc.mappingio.format.Tiny2Reader;
import net.fabricmc.mappingio.format.Tiny2Writer;
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileWriter;
import net.fabricmc.mappingio.tree.MemoryMappingTree;
import net.minecraft.SharedConstants;
import net.minecraft.text.Text;
Expand All @@ -54,7 +54,7 @@ protected void load(ProgressToast toast, MappingVisitor visitor) {

if (Files.exists(qmPath)) {
try (BufferedReader br = Files.newBufferedReader(qmPath)) {
Tiny2Reader.read(br, visitor);
Tiny2FileReader.read(br, visitor);
return;
}
}
Expand Down Expand Up @@ -91,11 +91,11 @@ protected void load(ProgressToast toast, MappingVisitor visitor) {
toast.step(Text.translatable("message.gadget.progress.downloading_qm"));
try (var is = toast.loadWithProgress(url);
var gz = new GZIPInputStream(is)) {
Tiny2Reader.read(new InputStreamReader(gz), tree);
Tiny2FileReader.read(new InputStreamReader(gz), tree);
}

try (var bw = Files.newBufferedWriter(qmPath)) {
tree.accept(new Tiny2Writer(bw, false));
tree.accept(new Tiny2FileWriter(bw, false));
}

tree.accept(visitor);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/wispforest/gadget/mappings/YarnMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import io.wispforest.gadget.util.ProgressToast;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.mappingio.MappingVisitor;
import net.fabricmc.mappingio.format.Tiny2Reader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader;
import net.minecraft.SharedConstants;
import net.minecraft.text.Text;
import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -76,7 +76,7 @@ protected void load(ProgressToast toast, MappingVisitor visitor) {

try (FileSystem fs = FileSystems.newFileSystem(yarnPath, (ClassLoader) null)) {
try (var br = Files.newBufferedReader(fs.getPath("mappings/mappings.tiny"))) {
Tiny2Reader.read(br, visitor);
Tiny2FileReader.read(br, visitor);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"minecraft": ">=1.21",
"java": ">=17",
"owo": ">=0.11.1",
"fabric-permissions-api-v0": ">=0.3.1"
"fabric-permissions-api-v0": ">=0.3.1",
"mapping-io": ">=0.6.1"
}
}

0 comments on commit 007af76

Please sign in to comment.