File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/main/java/org/spongepowered/api/entity/attribute Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 2424 */
2525package org .spongepowered .api .entity .attribute ;
2626
27+ import org .spongepowered .api .ResourceKey ;
2728import org .spongepowered .api .ResourceKeyed ;
2829import org .spongepowered .api .Sponge ;
2930import org .spongepowered .api .item .inventory .ItemStack ;
3839 */
3940public interface AttributeModifier extends ResourceKeyed {
4041
42+ /**
43+ * Creates an attribute modifier with the given values.
44+ *
45+ * @param key The resource key
46+ * @param operation The attribute operation
47+ * @param amount The amount
48+ * @return The attribute modifier
49+ */
50+ static AttributeModifier of (final ResourceKey key , final Supplier <? extends AttributeOperation > operation , final double amount ) {
51+ return AttributeModifier .builder ().key (key ).operation (operation ).amount (amount ).build ();
52+ }
53+
54+ /**
55+ * Creates an attribute modifier with the given values.
56+ *
57+ * @param key The resource key
58+ * @param operation The attribute operation
59+ * @param amount The amount
60+ * @return The attribute modifier
61+ */
62+ static AttributeModifier of (final ResourceKey key , final AttributeOperation operation , final double amount ) {
63+ return AttributeModifier .builder ().key (key ).operation (operation ).amount (amount ).build ();
64+ }
65+
4166 /**
4267 * Creates a new {@link Builder} to create an {@link AttributeModifier}.
4368 *
You can’t perform that action at this time.
0 commit comments