Package net.minecraftforge.event.world
Class BlockEvent.FluidPlaceBlockEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.world.BlockEvent
-
- net.minecraftforge.event.world.BlockEvent.FluidPlaceBlockEvent
-
- Enclosing class:
- BlockEvent
public static class BlockEvent.FluidPlaceBlockEvent extends BlockEvent
Fired when a liquid places a block. Use#setNewState(IBlockState)
to change the result of a cobblestone generator or add variants of obsidian. Alternatively, you could execute arbitrary code when lava sets blocks on fire, even preventing it.BlockEvent.getState()
will return the block that was originally going to be placed.BlockEvent.getPos()
will return the position of the block to be changed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.world.BlockEvent
BlockEvent.BlockToolInteractEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
-
Field Summary
Fields Modifier and Type Field Description private BlockPos
liquidPos
private BlockState
newState
private BlockState
origState
-
Constructor Summary
Constructors Constructor Description FluidPlaceBlockEvent(IWorld world, BlockPos pos, BlockPos liquidPos, BlockState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockPos
getLiquidPos()
BlockState
getNewState()
BlockState
getOriginalState()
void
setNewState(BlockState state)
-
Methods inherited from class net.minecraftforge.event.world.BlockEvent
getPos, getState, getWorld
-
-
-
-
Field Detail
-
liquidPos
private final BlockPos liquidPos
-
newState
private BlockState newState
-
origState
private BlockState origState
-
-
Constructor Detail
-
FluidPlaceBlockEvent
public FluidPlaceBlockEvent(IWorld world, BlockPos pos, BlockPos liquidPos, BlockState state)
-
-
Method Detail
-
getLiquidPos
public BlockPos getLiquidPos()
- Returns:
- The position of the liquid this event originated from. This may be the same as
BlockEvent.getPos()
.
-
getNewState
public BlockState getNewState()
- Returns:
- The block state that will be placed after this event resolves.
-
setNewState
public void setNewState(BlockState state)
-
getOriginalState
public BlockState getOriginalState()
- Returns:
- The state of the block to be changed before the event was fired.
-
-