Class CreateFluidSourceEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.block.CreateFluidSourceEvent
Fired when a fluid checks if nearby blocks can convert it to a source block.
This can be used to manipulate if fluids are allowed to create sources dynamically.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.BlockEvent
BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns if the fluid will be converted to a source block.getLevel()
boolean
Returns if the fluid would normally be converted to a source block.void
setCanConvert
(boolean convert) Sets if the fluid will be converted to a source block.Methods inherited from class net.neoforged.neoforge.event.level.BlockEvent
getPos, getState
-
Field Details
-
vanillaResult
private final boolean vanillaResult -
canConvert
private boolean canConvert
-
-
Constructor Details
-
CreateFluidSourceEvent
-
-
Method Details
-
getLevel
- Overrides:
getLevel
in classBlockEvent
-
getFluidState
-
getVanillaResult
public boolean getVanillaResult()Returns if the fluid would normally be converted to a source block.This is computed by calling
IFluidStateExtension.canConvertToSource(Level, BlockPos)
. -
canConvert
public boolean canConvert()Returns if the fluid will be converted to a source block.- Returns:
- if the fluid will be converted to a source block
-
setCanConvert
public void setCanConvert(boolean convert) Sets if the fluid will be converted to a source block.- Parameters:
convert
- True to permit the conversion, false otherwise.
-