Interface LockAndKeyBehaviors
public interface LockAndKeyBehaviors
Holds the behaviors of the Lock and Key item for different block entities. Get via
BibliocraftApi.getLockAndKeyBehaviors().
Register a new behavior by subscribing to RegisterLockAndKeyBehaviorEvent and calling register(...) on it.
Make sure to put this call behind a ModList.isLoaded("bibliocraft") check, and in a separate class, to prevent accidental classloading (like you would with client classes).-
Method Summary
Modifier and TypeMethodDescription<T extends net.minecraft.world.level.block.entity.BlockEntity>
@Nullable LockAndKeyBehavior<T> get(T blockEntity)
-
Method Details
-
get
@Nullable <T extends net.minecraft.world.level.block.entity.BlockEntity> @Nullable LockAndKeyBehavior<T> get(T blockEntity) - Type Parameters:
T- The type of theBlockEntity.- Parameters:
blockEntity- TheBlockEntityto get the behavior for.- Returns:
- The
LockAndKeyBehaviorassociated with the givenBlockEntity, or null if no suchLockAndKeyBehaviorhas been registered.
-