Fix NamespacedWrapper#wrapAsHolder (#9450)

This commit is contained in:
matyrobbrt authored and GitHub committed 2023-05-04 16:42:02 -07:00
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));