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:
parent
9c9c9d4387
commit
3d3a5f420e
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user