mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 05:32:18 -07:00
#1004: Improve field rename handling and centralize conversion between bukkit and string more
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user