mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
Revert changes done to MemoryKey handelt in seperated PR
This commit is contained in:
parent
e89706db96
commit
ce9e4e791e
2 changed files with 7 additions and 7 deletions
|
@ -255,23 +255,23 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||||
*
|
*
|
||||||
* @see MemoryKey
|
* @see MemoryKey
|
||||||
*/
|
*/
|
||||||
Registry<MemoryKey<?>> MEMORY_MODULE_TYPE = new Registry<>() {
|
Registry<MemoryKey> MEMORY_MODULE_TYPE = new Registry<MemoryKey>() {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Iterator<MemoryKey<?>> iterator() {
|
public Iterator iterator() {
|
||||||
return MemoryKey.values().iterator();
|
return MemoryKey.values().iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public MemoryKey<?> get(@NotNull NamespacedKey key) {
|
public MemoryKey get(@NotNull NamespacedKey key) {
|
||||||
return MemoryKey.getByKey(key);
|
return MemoryKey.getByKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Stream<MemoryKey<?>> stream() {
|
public Stream<MemoryKey> stream() {
|
||||||
return StreamSupport.stream(spliterator(), false);
|
return StreamSupport.stream(spliterator(), false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,7 @@ public final class MemoryKey<T> implements Keyed {
|
||||||
return tClass;
|
return tClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<NamespacedKey, MemoryKey<?>> MEMORY_KEYS = new HashMap<>();
|
private static final Map<NamespacedKey, MemoryKey> MEMORY_KEYS = new HashMap<>();
|
||||||
//
|
//
|
||||||
public static final MemoryKey<Location> HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class);
|
public static final MemoryKey<Location> HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class);
|
||||||
public static final MemoryKey<Location> POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class);
|
public static final MemoryKey<Location> POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class);
|
||||||
|
@ -80,7 +80,7 @@ public final class MemoryKey<T> implements Keyed {
|
||||||
* available under that key
|
* available under that key
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public static MemoryKey<?> getByKey(@NotNull NamespacedKey namespacedKey) {
|
public static MemoryKey getByKey(@NotNull NamespacedKey namespacedKey) {
|
||||||
return MEMORY_KEYS.get(namespacedKey);
|
return MEMORY_KEYS.get(namespacedKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public final class MemoryKey<T> implements Keyed {
|
||||||
* @return the memoryKeys
|
* @return the memoryKeys
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public static Set<MemoryKey<?>> values() {
|
public static Set<MemoryKey> values() {
|
||||||
return new HashSet<>(MEMORY_KEYS.values());
|
return new HashSet<>(MEMORY_KEYS.values());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue