1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-21 20:25:54 +00:00
Slimefun4/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunBlockHandler.java
2020-01-14 02:10:20 +01:00

36 lines
1.1 KiB
Java

package me.mrCookieSlime.Slimefun.Objects;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason;
@FunctionalInterface
public interface SlimefunBlockHandler {
/**
* This method gets called when the Block is placed.
* Use this method to initialize block data.
*
* @param p The Player who placed it
* @param b The Block that was placed
* @param item The Item that will be stored inside the Block
*/
default void onPlace(Player p, Block b, SlimefunItem item) {
// This method can optionally be implemented by classes implementing it.
}
/**
* This method gets called when the Block is broken
* p is nullable if the Block is exploded
*
* @param p The Player who broke the Block
* @param b The Block that was broken
* @param item The SlimefunItem that was stored in that block
* @param reason The reason for the Block breaking
* @return Whether the Event should be cancelled
*/
boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason);
}