Skip to content

Commit 563f5e2

Browse files
authored
Fix 2 issues (#785)
1 parent 156d3a8 commit 563f5e2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/main/java/com/ldtteam/structurize/client/gui/WindowExtendedBuildTool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private void init(final int groundstyle, final BlockPos pos)
217217
return;
218218
}
219219

220-
if (StringUtils.isBlank(currentStructurePack) && !currentStructurePack.equals(selectedPack.getName()))
220+
if (!StringUtils.isBlank(currentStructurePack) && !currentStructurePack.equals(selectedPack.getName()))
221221
{
222222
depth = "";
223223
currentBluePrintMappingAtDepthCache.clear();

src/main/java/com/ldtteam/structurize/storage/ServerStructurePackLoader.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import net.neoforged.fml.ModList;
1313
import net.neoforged.neoforge.event.tick.ServerTickEvent;
1414
import net.neoforged.neoforgespi.language.IModInfo;
15+
import org.jetbrains.annotations.NotNull;
16+
1517
import java.io.File;
1618
import java.io.IOException;
1719
import 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

Comments
 (0)