Skip to content

Commit f695db1

Browse files
committed
Add Keys.BOUNDING_BOX_BASE_SIZE and Keys.BOUNDING_BOX_HEIGHT
1 parent 529eaa9 commit f695db1

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,24 @@ public final class Keys {
572572
*/
573573
public static final Key<Value<BossBar>> BOSS_BAR = Keys.key(ResourceKey.sponge("boss_bar"), BossBar.class);
574574

575+
/**
576+
* The width of the interactable form of an {@link Entity}.
577+
*
578+
* <p>Together with {@link #BOUNDING_BOX_HEIGHT} this defines
579+
* the size of the {@link Entity}'s bounding box.</p>
580+
* Readonly(Entity.class) expect Interaction
581+
*/
582+
public static final Key<Value<Double>> BOUNDING_BOX_BASE_SIZE = Keys.key(ResourceKey.sponge("bounding_box_base_size"), Double.class);
583+
584+
/**
585+
* The height of the interactable form of an {@link Entity}.
586+
*
587+
* <p>Together with {@link #BOUNDING_BOX_BASE_SIZE} this defines
588+
* the size of the {@link Entity}'s bounding box.</p>
589+
* Readonly(Entity.class) expect Interaction
590+
*/
591+
public static final Key<Value<Double>> BOUNDING_BOX_HEIGHT = Keys.key(ResourceKey.sponge("bounding_box_height"), Double.class);
592+
575593
/**
576594
* The {@link BlockType}s able to be broken by an {@link ItemStack}.
577595
*/

src/main/java/org/spongepowered/api/entity/Entity.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,4 +655,22 @@ default Optional<Value.Mutable<Double>> swiftness() {
655655

656656
@Override
657657
HoverEvent<HoverEvent.ShowEntity> asHoverEvent(final UnaryOperator<HoverEvent.ShowEntity> op);
658+
659+
/**
660+
* {@link Keys#BOUNDING_BOX_BASE_SIZE}
661+
*
662+
* @return The bounding box base size of the entity
663+
*/
664+
default Value.Mutable<Double> boundingBoxBaseSize() {
665+
return this.requireValue(Keys.BOUNDING_BOX_BASE_SIZE).asMutable();
666+
}
667+
668+
/**
669+
* {@link Keys#BOUNDING_BOX_HEIGHT}
670+
*
671+
* @return The bounding box height of the entity
672+
*/
673+
default Value.Mutable<Double> boundingBoxHeight() {
674+
return this.requireValue(Keys.BOUNDING_BOX_HEIGHT).asMutable();
675+
}
658676
}

0 commit comments

Comments
 (0)