public static class BlockEvent.FluidPlaceBlockEvent extends BlockEvent
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.BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.HarvestDropsEvent, BlockEvent.MultiPlaceEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PlaceEvent, BlockEvent.PortalSpawnEvent
Event.HasResult, Event.Result
Modifier and Type | Field and Description |
---|---|
private BlockPos |
liquidPos |
private IBlockState |
newState |
private IBlockState |
origState |
Constructor and Description |
---|
FluidPlaceBlockEvent(World world,
BlockPos pos,
BlockPos liquidPos,
IBlockState state) |
Modifier and Type | Method and Description |
---|---|
BlockPos |
getLiquidPos() |
IBlockState |
getNewState() |
IBlockState |
getOriginalState() |
void |
setNewState(IBlockState state) |
getPos, getState, getWorld
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
private final BlockPos liquidPos
private IBlockState newState
private IBlockState origState
public FluidPlaceBlockEvent(World world, BlockPos pos, BlockPos liquidPos, IBlockState state)
public BlockPos getLiquidPos()
BlockEvent.getPos()
.public IBlockState getNewState()
public void setNewState(IBlockState state)
public IBlockState getOriginalState()