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.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
Modifier and Type | Field and Description |
---|---|
private BlockPos |
liquidPos |
private BlockState |
newState |
private BlockState |
origState |
Constructor and Description |
---|
FluidPlaceBlockEvent(IWorld world,
BlockPos pos,
BlockPos liquidPos,
BlockState state) |
Modifier and Type | Method and Description |
---|---|
BlockPos |
getLiquidPos() |
BlockState |
getNewState() |
BlockState |
getOriginalState() |
void |
setNewState(BlockState state) |
getPos, getState, getWorld
private final BlockPos liquidPos
private BlockState newState
private BlockState origState
public FluidPlaceBlockEvent(IWorld world, BlockPos pos, BlockPos liquidPos, BlockState state)
public BlockPos getLiquidPos()
BlockEvent.getPos()
.public BlockState getNewState()
public void setNewState(BlockState state)
public BlockState getOriginalState()