Commits

DerFrZocker authored ce9e4e791e9
Revert changes done to MemoryKey handelt in seperated PR
No tags
experimental

src/main/java/org/bukkit/entity/memory/MemoryKey.java

Modified
37 37 /**
38 38 * Gets the class of values associated with this memory.
39 39 *
40 40 * @return the class of value objects
41 41 */
42 42 @NotNull
43 43 public Class<T> getMemoryClass() {
44 44 return tClass;
45 45 }
46 46
47 - private static final Map<NamespacedKey, MemoryKey<?>> MEMORY_KEYS = new HashMap<>();
47 + private static final Map<NamespacedKey, MemoryKey> MEMORY_KEYS = new HashMap<>();
48 48 //
49 49 public static final MemoryKey<Location> HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class);
50 50 public static final MemoryKey<Location> POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class);
51 51 public static final MemoryKey<Location> JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("job_site"), Location.class);
52 52 public static final MemoryKey<Location> MEETING_POINT = new MemoryKey<>(NamespacedKey.minecraft("meeting_point"), Location.class);
53 53 public static final MemoryKey<Boolean> GOLEM_DETECTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("golem_detected_recently"), Boolean.class);
54 54 public static final MemoryKey<Long> LAST_SLEPT = new MemoryKey<>(NamespacedKey.minecraft("last_slept"), Long.class);
55 55 public static final MemoryKey<Long> LAST_WOKEN = new MemoryKey<>(NamespacedKey.minecraft("last_woken"), Long.class);
56 56 public static final MemoryKey<Long> LAST_WORKED_AT_POI = new MemoryKey<>(NamespacedKey.minecraft("last_worked_at_poi"), Long.class);
57 57 public static final MemoryKey<Boolean> UNIVERSAL_ANGER = new MemoryKey<>(NamespacedKey.minecraft("universal_anger"), Boolean.class);
73 73
74 74 /**
75 75 * Returns a {@link MemoryKey} by a {@link NamespacedKey}.
76 76 *
77 77 * @param namespacedKey the {@link NamespacedKey} referencing a
78 78 * {@link MemoryKey}
79 79 * @return the {@link MemoryKey} or null when no {@link MemoryKey} is
80 80 * available under that key
81 81 */
82 82 @Nullable
83 - public static MemoryKey<?> getByKey(@NotNull NamespacedKey namespacedKey) {
83 + public static MemoryKey getByKey(@NotNull NamespacedKey namespacedKey) {
84 84 return MEMORY_KEYS.get(namespacedKey);
85 85 }
86 86
87 87 /**
88 88 * Returns the set of all MemoryKeys.
89 89 *
90 90 * @return the memoryKeys
91 91 */
92 92 @NotNull
93 - public static Set<MemoryKey<?>> values() {
93 + public static Set<MemoryKey> values() {
94 94 return new HashSet<>(MEMORY_KEYS.values());
95 95 }
96 96 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut