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

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) {