1212import net .neoforged .fml .ModList ;
1313import net .neoforged .neoforge .event .tick .ServerTickEvent ;
1414import net .neoforged .neoforgespi .language .IModInfo ;
15+ import org .jetbrains .annotations .NotNull ;
16+
1517import java .io .File ;
1618import java .io .IOException ;
1719import java .nio .file .*;
@@ -251,18 +253,20 @@ private static ByteBuf zipPack(final Path sourcePath)
251253 Files .walkFileTree (sourcePath , new SimpleFileVisitor <>()
252254 {
253255 @ Override
254- public FileVisitResult preVisitDirectory (final Path dir , final BasicFileAttributes attrs ) throws IOException
256+ @ NotNull
257+ public FileVisitResult preVisitDirectory (@ NotNull final Path dir , @ NotNull final BasicFileAttributes attrs ) throws IOException
255258 {
256259 if (!sourcePath .equals (dir ))
257260 {
258- zos .putNextEntry (new ZipEntry (sourcePath .relativize (dir ) + File . separator ));
261+ zos .putNextEntry (new ZipEntry (sourcePath .relativize (dir ) + "/" ));
259262 zos .closeEntry ();
260263 }
261264 return FileVisitResult .CONTINUE ;
262265 }
263266
264267 @ Override
265- public FileVisitResult visitFile (final Path file , final BasicFileAttributes attrs ) throws IOException
268+ @ NotNull
269+ public FileVisitResult visitFile (@ NotNull final Path file , @ NotNull final BasicFileAttributes attrs ) throws IOException
266270 {
267271 zos .putNextEntry (new ZipEntry (sourcePath .relativize (file ).toString ()));
268272 Files .copy (file , zos );
@@ -273,7 +277,7 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr
273277 }
274278 catch (IOException e )
275279 {
276- Log .getLogger ().warn ("Unable to ZIP up: " + sourcePath . toString () );
280+ Log .getLogger ().warn ("Unable to ZIP up: {}" , sourcePath );
277281 return null ;
278282 }
279283 return buffer ;
0 commit comments