Interface BlockSpoutingBehaviour
- All Known Implementing Classes:
CauldronSpoutingBehavior,SpoutCasting,StateChangingBehavior
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface for custom block-filling behavior for spouts.
Behaviors are queried by block first, through BY_BLOCK. If no behavior was provided,
they are then queried by block entity type, through BY_BLOCK_ENTITY.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleRegistry<net.minecraft.world.level.block.Block, BlockSpoutingBehaviour> static final SimpleRegistry<net.minecraft.world.level.block.entity.BlockEntityType<?>, BlockSpoutingBehaviour> -
Method Summary
Modifier and TypeMethodDescriptionintfillBlock(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, SpoutBlockEntity spout, net.neoforged.neoforge.fluids.FluidStack availableFluid, boolean simulate) While idle, spouts will query the behavior provided by the block below it.static @Nullable BlockSpoutingBehaviourget(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Get the behavior that should be used for the block at the given location.
-
Field Details
-
BY_BLOCK
-
BY_BLOCK_ENTITY
static final SimpleRegistry<net.minecraft.world.level.block.entity.BlockEntityType<?>,BlockSpoutingBehaviour> BY_BLOCK_ENTITY
-
-
Method Details
-
get
@Nullable static @Nullable BlockSpoutingBehaviour get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Get the behavior that should be used for the block at the given location. Queries both the block and the block entity if needed. -
fillBlock
int fillBlock(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, SpoutBlockEntity spout, net.neoforged.neoforge.fluids.FluidStack availableFluid, boolean simulate) While idle, spouts will query the behavior provided by the block below it. If one is present, this method will be called every tick with simulate == true.When a value greater than 0 is returned, the spout will begin processing. It will call this method again with simulate == false, which is when any filling behavior should actually occur.
This method is only called on the server side, except for in Ponder.
- Parameters:
level- The current levelpos- The position of the affected blockspout- The spout block entity that is calling thisavailableFluid- A copy of the fluidStack that is available, modifying this will do nothing, return the amount to be subtracted insteadsimulate- Whether the spout is testing or actually performing this behaviour- Returns:
- The amount filled into the block, 0 to idle/cancel
-