Skip to content

Add BlockEntity tick methods #2517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 28, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/main/java/org/spongepowered/api/block/entity/BlockEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,27 @@ public interface BlockEntity extends SerializableDataHolder.Mutable, Locatable {
*/
void remove();

/**
* Returns whether this block entity can tick.
*
* @return True if this block entity can tick
*/
boolean canTick();

/**
* Returns whether this block entity is ticking.
*
* @return True if this block entity is ticking
*/
boolean isTicking();

/**
* Sets if this block entity will naturally tick.
*
* @param ticking The ticking state
*/
void setTicking(boolean ticking);

/**
* Gets the type of {@link BlockEntity} this is.
*
Expand Down