Skip to content

Commit

Permalink
chore: merge block entity tick methods
Browse files Browse the repository at this point in the history
Merges #2517

Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
  • Loading branch information
gabizou committed Sep 28, 2024
2 parents fcfb921 + b016dd9 commit 41c571c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ tasks {
options {
(this as? StandardJavadocDocletOptions)?.apply {
links(
"https://logging.apache.org/log4j/log4j-${libs.versions.log4j.get()}/log4j-api/apidocs/",
"https://logging.apache.org/log4j/2.x/javadoc/log4j-api/",
"https://google.github.io/guice/api-docs/${libs.versions.guice.get()}/javadoc/",
"https://configurate.aoeu.xyz/${libs.versions.configurate.get()}/apidocs/",
"https://www.javadoc.io/doc/com.google.code.gson/gson/${libs.versions.gson.get()}/",
Expand Down
26 changes: 26 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,32 @@ 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();

/**
* Attempts to set if this block entity will naturally tick.
*
* <p>This will return <code>false</code>
* if {@link #isRemoved()} returns <code>true</code>
* or {@link #canTick()} returns <code>false</code></p>
*
* @param ticking The ticking state
* @return True if ticking state was successfully set
*/
boolean setTicking(boolean ticking);

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

0 comments on commit 41c571c

Please sign in to comment.