#890: Add more Sculk API (bloom, shriek, bloom event)

By: Collin <collinjbarber@gmail.com>
This commit is contained in:
Bukkit/Spigot
2023-09-06 20:43:33 +10:00
parent 32643feee7
commit 6f4bee4eb0
3 changed files with 118 additions and 0 deletions

View File

@@ -1,7 +1,27 @@
package org.bukkit.block;
import org.bukkit.event.entity.EntityDeathEvent;
import org.jetbrains.annotations.NotNull;
/**
* Represents a captured state of a sculk catalyst.
*/
public interface SculkCatalyst extends TileState {
/**
* Causes a new sculk bloom, as if an entity just died around this catalyst.
* <p>
* Typically, charges should be set to the exp reward of a mob
* ({@link EntityDeathEvent#getDroppedExp()}), which is usually
* 3-5 for animals, and 5-10 for the average mob (up to 50 for
* wither skeletons). Roughly speaking, for each charge, 1 more
* sculk block will be placed.
* <p>
* If <code>charges > 1000</code>, multiple cursors will be spawned in the
* block.
*
* @param block which block to spawn the cursor in
* @param charges how much charge to spawn.
*/
void bloom(@NotNull Block block, int charges);
}

View File

@@ -1,5 +1,8 @@
package org.bukkit.block;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured state of a sculk shrieker.
*/
@@ -24,4 +27,11 @@ public interface SculkShrieker extends TileState {
* @param level new warning level
*/
void setWarningLevel(int level);
/**
* Simulates a player causing a vibration.
*
* @param player the player that "caused" the shriek
*/
void tryShriek(@Nullable Player player);
}