Class BlockSpoutingBehaviour
java.lang.Object
com.simibubi.create.api.behaviour.BlockSpoutingBehaviour
- Direct Known Subclasses:
SpoutCasting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCustomSpoutInteraction(net.minecraft.resources.ResourceLocation resourceLocation, BlockSpoutingBehaviour movementBehaviour) abstract intfillBlock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, SpoutTileEntity spout, net.minecraftforge.fluids.FluidStack availableFluid, boolean simulate) While idle, Spouts will call this every tick with simulate == true
When fillBlock returns > 0, the Spout will start its animation cycle
During this animation cycle, fillBlock is called once again with simulate == false but only on the relevant SpoutingBehaviour
When fillBlock returns > 0 once again, the Spout will drain its content by the returned amount of units
Perform any other side-effects in this method
This method is called server-side only (except in ponder)static voidforEach(Consumer<? super BlockSpoutingBehaviour> accept) static voidregister()
-
Constructor Details
-
BlockSpoutingBehaviour
public BlockSpoutingBehaviour()
-
-
Method Details
-
addCustomSpoutInteraction
public static void addCustomSpoutInteraction(net.minecraft.resources.ResourceLocation resourceLocation, BlockSpoutingBehaviour movementBehaviour) -
forEach
-
fillBlock
public abstract int fillBlock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, SpoutTileEntity spout, net.minecraftforge.fluids.FluidStack availableFluid, boolean simulate) While idle, Spouts will call this every tick with simulate == true
When fillBlock returns > 0, the Spout will start its animation cycle
During this animation cycle, fillBlock is called once again with simulate == false but only on the relevant SpoutingBehaviour
When fillBlock returns > 0 once again, the Spout will drain its content by the returned amount of units
Perform any other side-effects in this method
This method is called server-side only (except in ponder)- Parameters:
world-pos- of the affected blockspout-availableFluid- do not modify, return the amount to be subtracted insteadsimulate- whether the spout is testing or actually performing this behaviour- Returns:
- amount filled into the block, 0 to idle/cancel
-
register
public static void register()
-