mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-09 20:28:57 -04:00
Don't load json files from the textures subfolder.
This removes junk blocks from the creative inventory.
This commit is contained in:
parent
bdcec16176
commit
3419034754
@ -32,7 +32,7 @@ pub fn readAllJsonFilesInAddons(externalAllocator: NeverFailingAllocator, addons
|
|||||||
std.log.err("Got error while iterating addon directory {s}: {s}", .{subPath, @errorName(err)});
|
std.log.err("Got error while iterating addon directory {s}: {s}", .{subPath, @errorName(err)});
|
||||||
break :blk null;
|
break :blk null;
|
||||||
}) |entry| {
|
}) |entry| {
|
||||||
if(entry.kind == .file and std.ascii.endsWithIgnoreCase(entry.basename, ".json")) {
|
if(entry.kind == .file and std.ascii.endsWithIgnoreCase(entry.basename, ".json") and !std.ascii.startsWithIgnoreCase(entry.path, "textures")) {
|
||||||
const folderName = addonName;
|
const folderName = addonName;
|
||||||
const id: []u8 = externalAllocator.alloc(u8, folderName.len + 1 + entry.path.len - 5);
|
const id: []u8 = externalAllocator.alloc(u8, folderName.len + 1 + entry.path.len - 5);
|
||||||
errdefer externalAllocator.free(id);
|
errdefer externalAllocator.free(id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user