Package vazkii.botania.api.corporea
Interface CorporeaSpark
- All Superinterfaces:
SparkEntity
- All Known Implementing Classes:
CorporeaSparkEntity
An interface for a Corporea Spark. Includes functions for handling
connections.
-
Method Summary
Modifier and TypeMethodDescription@Nullable CorporeaSparkGets the list of sparks that this spark added to the list of connections during registerConnections(), this is mainly used to create a non messy chain of particles to display the network when a spark is right clicked with a wand.voidintroduceNearbyTo(Set<CorporeaSpark> network, CorporeaSpark master) Look around this spark for neighbors and introduce them to the network by adding them tonetwork.booleanGets if this spark is considered a creative spark.booleanisMaster()Gets if this spark is considered a master spark.voidonItemExtracted(net.minecraft.world.item.ItemStack stack) Called when an item is extracted from the node this spark is attached to through this spark.voidonItemsRequested(List<net.minecraft.world.item.ItemStack> stacks) Called when this spark requests items, passes in the result of the request and not the actual requested stack(s).Methods inherited from interface vazkii.botania.api.item.SparkEntity
entity, getAttachPos, getNetwork, setNetwork
-
Method Details
-
introduceNearbyTo
Look around this spark for neighbors and introduce them to the network by adding them tonetwork. If they weren't already innetwork, this method should then recursively call this method on all newcomers. This spark should then retain thenetworkobject internally for quick access to all members of the network. -
getSparkNode
CorporeaNode getSparkNode()- Returns:
- Corporea node this spark is attached to, generally belonging to the block below it
-
getConnections
Set<CorporeaSpark> getConnections()- Returns:
- All sparks in the same logical corporea network as this one, including this spark itself.
-
getRelatives
List<CorporeaSpark> getRelatives()Gets the list of sparks that this spark added to the list of connections during registerConnections(), this is mainly used to create a non messy chain of particles to display the network when a spark is right clicked with a wand. -
getMaster
- Returns:
- The master spark of the network this spark is part of. A master spark's
master is itself. Returns
nullif this spark is not in a network with a valid master.
-
onItemExtracted
void onItemExtracted(net.minecraft.world.item.ItemStack stack) Called when an item is extracted from the node this spark is attached to through this spark.- Parameters:
stack- The itemstack, before any extraction was done. Do not mutate this.
-
onItemsRequested
Called when this spark requests items, passes in the result of the request and not the actual requested stack(s). -
isMaster
boolean isMaster()Gets if this spark is considered a master spark. -
isCreative
boolean isCreative()Gets if this spark is considered a creative spark.
-