Package net.minecraftforge.event.level
Class AlterGroundEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.AlterGroundEvent
public class AlterGroundEvent
extends net.minecraftforge.eventbus.api.Event
This event is fired when
AlterGroundDecorator.placeBlockAt(TreeDecorator.Context, BlockPos)
attempts to alter a ground block when generating a feature. An example of this would be large spruce trees converting grass blocks into podzol.
This event is not cancellable.
This event is fired on the main Forge event bus only on the logical server.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final LevelSimulatedReader
private BlockState
private final BlockState
private final BlockPos
private final RandomSource
-
Constructor Summary
ConstructorDescriptionAlterGroundEvent
(LevelSimulatedReader level, RandomSource random, BlockPos pos, BlockState altered) -
Method Summary
Modifier and TypeMethodDescriptiongetLevel()
Returns the new block state to be placed by the ground decorator.Returns the original block state that would be placed by the ground decorator.getPos()
Returns the position of the block that will be altered.void
setNewAlteredState
(BlockState newAltered) Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
level
-
random
-
pos
-
originalAltered
-
newAltered
-
-
Constructor Details
-
AlterGroundEvent
@Internal public AlterGroundEvent(LevelSimulatedReader level, RandomSource random, BlockPos pos, BlockState altered)
-
-
Method Details
-
getLevel
-
getRandom
-
getPos
Returns the position of the block that will be altered.- Returns:
- the position of the block that will be altered
-
getOriginalAlteredState
Returns the original block state that would be placed by the ground decorator.- Returns:
- the original block state that would be placed by the ground decorator
-
getNewAlteredState
Returns the new block state to be placed by the ground decorator.- Returns:
- the new block state to be placed by the ground decorator
-
setNewAlteredState
- Parameters:
newAltered
- the new block state to be placed by the ground decorator
-