This commit is contained in:
TheMode 2021-06-12 16:02:35 +02:00
parent 342554cb36
commit 54b6868b2e
2 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,13 @@ import org.jglrxavpok.hephaistos.nbt.NBTCompound;
import java.util.Map;
import java.util.function.BiPredicate;
/**
* Represents a block that can be placed anywhere.
* Block objects are expected to be reusable and therefore do not
* retain placement data (e.g. block position)
* <p>
* Implementations are expected to be immutable.
*/
public interface Block extends ProtocolObject, TagReadable, BlockConstants {
<T> @NotNull Block withProperty(@NotNull BlockProperty<T> property, @NotNull T value);

View File

@ -7,6 +7,11 @@ import net.minestom.server.utils.BlockPosition;
import net.minestom.server.utils.NamespaceID;
import org.jetbrains.annotations.NotNull;
/**
* Interface used to provide block behavior. Set with {@link Block#withHandler(BlockHandler)}.
* <p>
* Implementations are expected to be thread safe.
*/
public interface BlockHandler {
/**