Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private void init(final int groundstyle, final BlockPos pos)
return;
}

if (StringUtils.isBlank(currentStructurePack) && !currentStructurePack.equals(selectedPack.getName()))
if (!StringUtils.isBlank(currentStructurePack) && !currentStructurePack.equals(selectedPack.getName()))
{
depth = "";
currentBluePrintMappingAtDepthCache.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import net.neoforged.fml.ModList;
import net.neoforged.neoforge.event.tick.ServerTickEvent;
import net.neoforged.neoforgespi.language.IModInfo;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.io.IOException;
import java.nio.file.*;
Expand Down Expand Up @@ -251,18 +253,20 @@ private static ByteBuf zipPack(final Path sourcePath)
Files.walkFileTree(sourcePath, new SimpleFileVisitor<>()
{
@Override
public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs) throws IOException
@NotNull
public FileVisitResult preVisitDirectory(@NotNull final Path dir, @NotNull final BasicFileAttributes attrs) throws IOException
{
if (!sourcePath.equals(dir))
{
zos.putNextEntry(new ZipEntry(sourcePath.relativize(dir) + File.separator));
zos.putNextEntry(new ZipEntry(sourcePath.relativize(dir) + "/"));
zos.closeEntry();
}
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException
@NotNull
public FileVisitResult visitFile(@NotNull final Path file, @NotNull final BasicFileAttributes attrs) throws IOException
{
zos.putNextEntry(new ZipEntry(sourcePath.relativize(file).toString()));
Files.copy(file, zos);
Expand All @@ -273,7 +277,7 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr
}
catch (IOException e)
{
Log.getLogger().warn("Unable to ZIP up: " + sourcePath.toString());
Log.getLogger().warn("Unable to ZIP up: {}", sourcePath);
return null;
}
return buffer;
Expand Down