mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-13 15:20:10 +01:00
Annotation + ItemStoreBuilder should be more like a builder
This commit is contained in:
parent
68de2b1980
commit
005d70e3a6
@ -106,8 +106,8 @@ public class ItemStack {
|
||||
}
|
||||
|
||||
@Contract(value = "_ -> new", pure = true)
|
||||
public @NotNull ItemStack withStore(@NotNull Consumer<@NotNull ItemStoreBuilder> metaOperator) {
|
||||
return builder().store(metaOperator).build();
|
||||
public @NotNull ItemStack withStore(@NotNull Consumer<@NotNull ItemStoreBuilder> storeConsumer) {
|
||||
return builder().store(storeConsumer).build();
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
|
@ -20,8 +20,10 @@ public class ItemStoreBuilder {
|
||||
this(new ConcurrentHashMap<>());
|
||||
}
|
||||
|
||||
public <T> void set(@NotNull String key, T value, MergingRule<T> mergingRule) {
|
||||
@Contract(value = "_, _, _ -> this")
|
||||
public <T> @NotNull ItemStoreBuilder set(@NotNull String key, T value, MergingRule<T> mergingRule) {
|
||||
this.entryMap.put(key, new Entry<>(value, mergingRule));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Contract(value = "-> new", pure = true)
|
||||
|
Loading…
Reference in New Issue
Block a user