1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-21 04:05:48 +00:00
Slimefun4/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunBlockHandler.java

36 lines
1.1 KiB
Java
Raw Normal View History

2016-04-14 16:24:03 +00:00
package me.mrCookieSlime.Slimefun.Objects;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
2019-08-30 19:02:55 +00:00
@FunctionalInterface
2016-04-14 16:24:03 +00:00
public interface SlimefunBlockHandler {
2019-08-30 19:02:55 +00:00
/**
* 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
*/
2016-04-14 16:24:03 +00:00
boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason);
}