Don't use delayed registries in impl anywhere (#11918)

This commit is contained in:
Jake Potrebic
2025-01-11 11:02:28 -08:00
committed by GitHub
parent 19ddbeff9e
commit ac3aaa248b
55 changed files with 145 additions and 133 deletions

View File

@ -2,6 +2,7 @@ package org.bukkit.attribute;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import org.bukkit.Bukkit;
import org.bukkit.Keyed;
@ -158,7 +159,7 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Attribute valueOf(@NotNull String name) {
Attribute attribute = Bukkit.getUnsafe().get(Registry.ATTRIBUTE, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Attribute attribute = Bukkit.getUnsafe().get(RegistryKey.ATTRIBUTE, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(attribute != null, "No attribute found with the name %s", name);
return attribute;
}