1
0
mirror of https://github.com/cabaletta/baritone synced 2025-02-23 15:46:59 +00:00

Fix unsafe creation of potentially invalid ResourceLocation

This commit is contained in:
Brady 2019-04-16 20:15:51 -05:00
parent 9c9c9d4387
commit 3d3a5f420e
No known key found for this signature in database
GPG Key ID: 73A788379A197567

View File

@ -128,7 +128,7 @@ public final class ChunkPacker {
}
public static Block stringToBlockNullable(String name) {
return resourceCache.computeIfAbsent(name, n -> IRegistry.BLOCK.get(new ResourceLocation(n.contains(":") ? n : "minecraft:" + n)));
return resourceCache.computeIfAbsent(name, n -> IRegistry.BLOCK.get(ResourceLocation.tryCreate(n.contains(":") ? n : "minecraft:" + n)));
}
private static PathingBlockType getPathingBlockType(IBlockState state, Chunk chunk, int x, int y, int z) {