Rebar Simple Multiblock
A multiblock that is made of a predefined set of components.
Automatically creates ghost blocks to show how to build your multiblock.
Automatically handles different possible rotations of your multiblock.
If you need something more flexible (eg: a fluid tank that can have up to 10 fluid casings added to increase the capacity), see RebarMultiblock.
Types
Displays all kind of MultiblockComponents that implement MultiblockComponentBlockDisplay, together with special item handling for RebarMultiblockComponent
Represents a single block of a multiblock.
A block display that represents this block, showing the player what block needs to be placed in a specific location.
Implement this together with MultiblockComponent, it is used to spawn multiple entities to display the needs of a single multiblock requirement, you are going to need this only when you can't display a block requirement with only a single ItemDisplay or BlockDisplay
Represents a Rebar block component of a multiblock.
Implement this together with MultiblockComponent, it is used to spawn a single entity to display the needs of a single multiblock requirement
Represents a vanilla component of a multiblock, which can have one or more blockdatas.
Represents a vanilla component of a multiblock, which can have one or more materials.
Properties
All chunks containing at least one component of the multiblock
The positions and corresponding components of the multiblock.
Any entity id's that should be culled when the block is considered culled by the BlockTextureEngine. The default implementation of onVisible and onCulled assumes that these are real entities When using real entities you cannot include entities in this list that are invisible by default, if you do they will not be culled properly.
Imagine the smallest square containing the multiblock; this is the radius of that square.
If the entities should be shown/hidden asynchronously instead of scheduled to be shown/hidden on the main thread. By default, this is false and the entities will be shown/hidden on the main thread because they are real entities.
Functions
Returns false if any entity is unloaded or does not exist.
Warning: You should not call this yourself. If you want to know if the multiblock is formed, use isFormedAndFullyLoaded(), which will read from a cache, so is much faster.
The 'direction' we expect the multiblock to be built in. This is not the actual direction that the multiblock has been built in.
Automatically implemented by RebarBlock
Returns true if every component of the multiblock is loaded AND the multiblock is formed. Reads from a cache, so call as often as you want.
Returns false if the block holds no entity with the provided name, the entity is unloaded or does not physically exist.
Should return true if there is any scenario in which this block's position could be part of a formed multiblock.
If the block is currently visible to the player. By default, this checks that the first entity from culledEntityIds is not toggled invisible for the player If you are using fake/packet entities you must override this method.
Hides all entities in culledEntityIds currently visible to the player. By default, this assumes that all entities in culledEntityIds are real entities, if they are not you must override this method.
Called when the multiblock is formed (i.e., was not formed before, but now is). This includes when the multiblock was previously formed, unloaded, and loaded again.
Called when the multiblock is refreshed (i.e., was formed before, and still is). This happens when something causes the Multiblock to re-check if it is formed, and it still is.
Called when the multiblock is unformed (i.e., was formed before, but now is not). This includes when a part of the multiblock is unloaded and the multiblock becomes unformed because of it, or when part of the multiblock is broken/changed, and it becomes unformed because of it.
Reveals all entities in culledEntityIds not currently visible to the player. By default, this assumes that all entities in culledEntityIds are real entities, if they are not you must override this method.
Sets the 'direction' we expect the multiblock to be built in. North is considered the default facing direction - ie setFacing(BlockFace.NORTH) will preserve the original multiblock structure without rotating it.
Returns all the valid configurations of the multiblock. If any of these is satisfied, the multiblock will be considered complete.