mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Fix first call to ToolType.get always returning null (#5396)
This commit is contained in:
1 parent
4db208332e
commit
2e1456517a
1 file changed
+1
-1
@@ -38,7 +38,7 @@ public final class ToolType
|
||||
{
|
||||
if (VALID_NAME.matcher(name).find())
|
||||
throw new IllegalArgumentException("ToolType.create() called with invalid name: " + name);
|
||||
return values.putIfAbsent(name, new ToolType(name));
|
||||
return values.computeIfAbsent(name, k -> new ToolType(name));
|
||||
}
|
||||
|
||||
private final String name;
|
||||
|
||||
Reference in new issue
Block a user