Fix unsafe creation of potentially invalid ResourceLocation
This commit is contained in:
+1
-1
@@ -128,7 +128,7 @@ public final class ChunkPacker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Block stringToBlockNullable(String name) {
|
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) {
|
private static PathingBlockType getPathingBlockType(IBlockState state, Chunk chunk, int x, int y, int z) {
|
||||||
|
|||||||
Reference in New Issue
Block a user