Search in sources :

Example 1 with CreateFluidSourceEvent

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

the class ForgeEventFactory method canCreateFluidSource.

public static boolean canCreateFluidSource(World world, BlockPos pos, IBlockState state, boolean def) {
    CreateFluidSourceEvent evt = new CreateFluidSourceEvent(world, pos, state);
    MinecraftForge.EVENT_BUS.post(evt);
    Result result = evt.getResult();
    return result == Result.DEFAULT ? def : result == Result.ALLOW;
}
Also used : CreateFluidSourceEvent(net.minecraftforge.event.world.BlockEvent.CreateFluidSourceEvent) ActionResult(net.minecraft.util.ActionResult) EnumActionResult(net.minecraft.util.EnumActionResult) RayTraceResult(net.minecraft.util.math.RayTraceResult) Result(net.minecraftforge.fml.common.eventhandler.Event.Result) SleepResult(net.minecraft.entity.player.EntityPlayer.SleepResult)

Aggregations

SleepResult (net.minecraft.entity.player.EntityPlayer.SleepResult)1 ActionResult (net.minecraft.util.ActionResult)1 EnumActionResult (net.minecraft.util.EnumActionResult)1 RayTraceResult (net.minecraft.util.math.RayTraceResult)1 CreateFluidSourceEvent (net.minecraftforge.event.world.BlockEvent.CreateFluidSourceEvent)1 Result (net.minecraftforge.fml.common.eventhandler.Event.Result)1