Revert changes done to MemoryKey handelt in seperated PR

This commit is contained in:
DerFrZocker 2024-06-03 19:01:20 +02:00
parent e89706db96
commit ce9e4e791e
No known key found for this signature in database
GPG key ID: 713F71FFFE1DDF91
2 changed files with 7 additions and 7 deletions

View file

@ -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);
} }
}; };

View file

@ -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());
} }
} }