#1004: Improve field rename handling and centralize conversion between bukkit and string more

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot
2024-05-04 08:19:04 +10:00
parent a3c30e3ee2
commit 92293c1b89
5 changed files with 44 additions and 6 deletions

View File

@@ -322,6 +322,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
static final class SimpleRegistry<T extends Enum<T> & Keyed> implements Registry<T> {
private final Class<T> type;
private final Map<NamespacedKey, T> map;
protected SimpleRegistry(@NotNull Class<T> type) {
@@ -338,6 +339,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
}
map = builder.build();
this.type = type;
}
@Nullable
@@ -357,5 +359,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
public Iterator<T> iterator() {
return map.values().iterator();
}
@ApiStatus.Internal
@Deprecated(since = "1.20.6", forRemoval = true)
public Class<T> getType() {
return this.type;
}
}
}