Package forestry.api.multiblock
Interface IMultiblockController
- All Known Subinterfaces:
IAlvearyController,IFarmController
public interface IMultiblockController
IMultiblockController is used to handle the assembly of Multiblocks.
This class is created and updated by IMultiblockLogic and Forestry.
This is a minimal interface to hide the ugly details from the multiblock tile entities.
-
Method Summary
Modifier and TypeMethodDescriptionbooleandefault voidonDestroyed(net.minecraft.core.BlockPos lastPos) Called when all blocks in this multiblock are destroyed and no new reference position can be found.voidCall to force the controller to check the multiblock's validity.
-
Method Details
-
isAssembled
boolean isAssembled()- Returns:
- True if this multiblock machine is considered assembled and ready to go.
-
reassemble
void reassemble()Call to force the controller to check the multiblock's validity. Use when important conditions around the multiblock change (i.e. Alveary slabs are removed and the alveary block detects it's neighbor changed) Changes to multiblock components are handled automatically and should not call this. -
getLastValidationError
- Returns:
- A string representing the last error encountered when trying to assemble this multiblock, or null if there is no error.
-
getComponents
Collection<IMultiblockComponent> getComponents()- Returns:
- all the multiblock components attached to this controller
-
onDestroyed
default void onDestroyed(net.minecraft.core.BlockPos lastPos) Called when all blocks in this multiblock are destroyed and no new reference position can be found. This method is typically used to drop stored items.- Parameters:
lastPos- The last block position in this multiblock before being destroyed. Any stored items should be dropped at this position.
-