minecraft-src/net/minecraft/data/CachedOutput.java
2025-07-04 01:41:11 +03:00

17 lines
490 B
Java

package net.minecraft.data;
import com.google.common.hash.HashCode;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import net.minecraft.FileUtil;
public interface CachedOutput {
CachedOutput NO_CACHE = (path, bs, hashCode) -> {
FileUtil.createDirectoriesSafe(path.getParent());
Files.write(path, bs, new OpenOption[0]);
};
void writeIfNeeded(Path filePath, byte[] data, HashCode hashCode) throws IOException;
}