Files
Paper/paper-api/src/main/java/org/bukkit/block/Bell.java
Nassim Jahnke f00727c57e 1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-04-12 17:27:00 +02:00

96 lines
3.0 KiB
Java

package org.bukkit.block;
import org.bukkit.entity.Entity;
import org.bukkit.event.block.BellRingEvent;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured state of Bell.
*/
public interface Bell extends TileState {
/**
* Ring this bell. This will call a {@link BellRingEvent}.
*
* @param entity the entity ringing the bell
* @param direction the direction from which the bell was rung or null to
* ring in the direction that the bell is facing
* @return true if rung successfully, false if the event was cancelled
*/
public boolean ring(@Nullable Entity entity, @Nullable BlockFace direction);
/**
* Ring this bell in the direction that the bell is facing. This will call a
* {@link BellRingEvent}.
*
* @param entity the entity ringing the bell
* @return true if rung successfully, false if the event was cancelled
*/
default boolean ring(@Nullable Entity entity) {
return this.ring(entity, null);
}
/**
* Ring this bell. This will call a {@link BellRingEvent}.
*
* @param direction the direction from which the bell was rung or null to
* ring in the direction that the bell is facing
* @return true if rung successfully, false if the event was cancelled
*/
default boolean ring(@Nullable BlockFace direction) {
return this.ring(null, direction);
}
/**
* Ring this bell in the direction that the bell is facing. This will call a
* {@link BellRingEvent}.
*
* @return true if rung successfully, false if the event was cancelled
*/
default boolean ring() {
return this.ring(null, null);
}
/**
* Check whether or not this bell is shaking. A bell is considered to be
* shaking if it was recently rung.
* <p>
* A bell will typically shake for 50 ticks.
*
* @return true if shaking, false otherwise
*/
public boolean isShaking();
/**
* Get the amount of ticks since this bell has been shaking, or 0 if the
* bell is not currently shaking.
* <p>
* A bell will typically shake for 50 ticks.
*
* @return the time in ticks since the bell was rung, or 0 if not shaking
*/
public int getShakingTicks();
/**
* Check whether or not this bell is resonating. A bell is considered to be
* resonating if {@link #isShaking() while shaking}, raiders were detected
* in the area and are ready to be highlighted to nearby players.
* <p>
* A bell will typically resonate for 40 ticks.
*
* @return true if resonating, false otherwise
*/
public boolean isResonating();
/**
* Get the amount of ticks since this bell has been resonating, or 0 if the
* bell is not currently resonating.
* <p>
* A bell will typically resonate for 40 ticks.
*
* @return the time in ticks since the bell has been resonating, or 0 if not
* resonating
*/
public int getResonatingTicks();
}