Potential fix for chisels block-id hack

This commit is contained in:
Blue (Lukas Rieger) 2021-08-10 21:26:49 +02:00
parent d63f340fd9
commit fd109b2407
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800

View File

@ -151,12 +151,13 @@ public void load(File... sources) throws InterruptedException {
//load blockstates //load blockstates
String namespace = namespaceRoot.substring("assets/".length()); String namespace = namespaceRoot.substring("assets/".length());
Logger.global.logInfo("Loading " + namespace + " assets (" + i + "/" + namespaces.size() + ")..."); Logger.global.logInfo("Loading " + namespace + " assets (" + i + "/" + namespaces.size() + ")...");
Collection<String> blockstateFiles = sourcesAccess.listFiles(namespaceRoot + "/blockstates", true); String blockstatesRootPath = namespaceRoot + "/blockstates";
Collection<String> blockstateFiles = sourcesAccess.listFiles(blockstatesRootPath, true);
for (String blockstateFile : blockstateFiles) { for (String blockstateFile : blockstateFiles) {
if (Thread.interrupted()) throw new InterruptedException(); if (Thread.interrupted()) throw new InterruptedException();
String filename = FileAccess.getFileName(blockstateFile); String filename = blockstateFile.substring(blockstatesRootPath.length() + 1);
if (!filename.endsWith(".json")) continue; if (!filename.endsWith(".json")) continue;
try { try {