Skip to content

Commit 133a456

Browse files
committed
Merge remote-tracking branch 'origin/api-12' into api-17
2 parents ad186e9 + fb073c8 commit 133a456

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,11 @@ public final class Keys {
701701
*/
702702
public static final Key<Value<Boolean>> CAN_MOVE_ON_LAND = Keys.key(ResourceKey.sponge("can_move_on_land"), Boolean.class);
703703

704+
/**
705+
* Whether a {@link Living} can pick up loot.
706+
*/
707+
public static final Key<Value<Boolean>> CAN_PICK_UP_LOOT = Keys.key(ResourceKey.sponge("can_pick_up_loot"), Boolean.class);
708+
704709
/**
705710
* Whether a {@link FallingBlock} will place itself upon landing.
706711
*/

src/main/java/org/spongepowered/api/entity/attribute/AttributeHolder.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,24 @@ default Optional<Attribute> attribute(final Supplier<? extends AttributeType> ty
5252
* @return An attribute, if present.
5353
*/
5454
Optional<Attribute> attribute(final AttributeType type);
55+
56+
/**
57+
* Gets an immutable copy of the default {@link Attribute}
58+
* from this entity.
59+
*
60+
* @param type The attribute type.
61+
* @return An attribute, if present.
62+
*/
63+
default Optional<Attribute> defaultAttribute(final Supplier<? extends AttributeType> type) {
64+
return this.defaultAttribute(type.get());
65+
}
66+
67+
/**
68+
* Gets an immutable copy of the default {@link Attribute}
69+
* from this entity.
70+
*
71+
* @param type The attribute type.
72+
* @return An attribute, if present.
73+
*/
74+
Optional<Attribute> defaultAttribute(final AttributeType type);
5575
}

0 commit comments

Comments
 (0)