mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix NamespacedWrapper#wrapAsHolder (#9450)
This commit is contained in:
1 parent
0ae63b0b07
commit
e1bf07dece
1 file changed
+7
@@ -220,6 +220,13 @@ class NamespacedWrapper<T> extends MappedRegistry<T> implements ILockableRegistr
|
||||
return Optional.ofNullable(this.holdersByName.get(key.location()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Holder<T> wrapAsHolder(@NotNull T value)
|
||||
{
|
||||
final Holder<T> holder = this.holders.get(value);
|
||||
return holder == null ? Holder.direct(value) : holder;
|
||||
}
|
||||
|
||||
Optional<Holder<T>> getHolder(ResourceLocation location)
|
||||
{
|
||||
return Optional.ofNullable(this.holdersByName.get(location));
|
||||
|
||||
Reference in new issue
Block a user