Skip to content

Commit 8b2d1fc

Browse files
committed
accept jar files
1 parent cefe7a0 commit 8b2d1fc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</head>
1111

1212
<body>
13-
<input type="file" id="input" accept=".zip" multiple />
13+
<input type="file" id="input" accept=".zip,.jar" multiple />
1414

1515
<div id="datapack-display"></div>
1616

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ async function onFileUploaded(e: Event) {
77
const fileList = (e.target as HTMLInputElement).files;
88
if (!fileList) return;
99

10-
const zipFiles = Array.from(fileList).filter((file) => file.type === "application/zip");
10+
const acceptedTypes = ["application/zip", "application/java-archive"];
11+
const zipFiles = Array.from(fileList).filter((file) => acceptedTypes.includes(file.type));
1112
const datapacks = await Promise.all(zipFiles.map(loadDatapack));
1213

1314
console.log(datapacks);

0 commit comments

Comments
 (0)