public class ExecutableBlocksAPI {
/**
* Get the ExecutableBlocks Manager,
* It allows you to get / retrieve the ExecutableBlocks Configurations
**/
public static ExecutableBlocksManager getExecutableBlocksManager() {
return ExecutableBlocksManager.getInstance();
}
/**
* Get the ExecutableBlocksPlaced Manager,
* It allows you to get / retrieve the ExecutableBlocks Placed
**/
public static ExecutableBlocksPlacedManager getExecutableBlocksPlacedManager() {
return ExecutableBlocksPlacedManager.getInstance();
}
/**
* Get the ExecutableBlockObject
* It allows you to get / retrieve the ExecutableBlocks Configurations under its item form
**/
public static ExecutableBlockObject getExecutableBlockObject(ItemStack itemStack) {
return new ExecutableBlockObject(itemStack);
}
}
The static method to have access to the managers of the ExecutableBlocks and the ExecutableBlockPlaced.
Examples
/** Example you decide to support ExecutableBlocks in world generation plugin **/
public void placeExecutableBlock(String executableBlockId, Location location){
Optional<ExecutableBlock> ebOpt = ExecutableBlocksAPI.getExecutableBlocksManager().getExecutableBlock(executableBlockId);
ebOpt.ifPresent(executableBlock -> executableBlock.place(location, true, OverrideEBP.REMOVE_EXISTING_EBP, null, null, null));
}