Search in sources :

Example 1 with EntityMultiPlaceEvent

use of net.minecraftforge.event.world.BlockEvent.EntityMultiPlaceEvent in project MinecraftForge by MinecraftForge.

the class ForgeEventFactory method onMultiBlockPlace.

public static boolean onMultiBlockPlace(@Nullable Entity entity, List<BlockSnapshot> blockSnapshots, Direction direction) {
    BlockSnapshot snap = blockSnapshots.get(0);
    BlockState placedAgainst = snap.getLevel().getBlockState(snap.getPos().relative(direction.getOpposite()));
    EntityMultiPlaceEvent event = new EntityMultiPlaceEvent(blockSnapshots, placedAgainst, entity);
    return MinecraftForge.EVENT_BUS.post(event);
}
Also used : BlockState(net.minecraft.world.level.block.state.BlockState) BlockSnapshot(net.minecraftforge.common.util.BlockSnapshot) EntityMultiPlaceEvent(net.minecraftforge.event.world.BlockEvent.EntityMultiPlaceEvent)

Aggregations

BlockState (net.minecraft.world.level.block.state.BlockState)1 BlockSnapshot (net.minecraftforge.common.util.BlockSnapshot)1 EntityMultiPlaceEvent (net.minecraftforge.event.world.BlockEvent.EntityMultiPlaceEvent)1