aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anthonyhilyard/iceberg/events/EntityFluidEvent.java
blob: d2abcb2c4f7f52b02f1b656fd8a61c3afa1885aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.anthonyhilyard.iceberg.events;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.event.entity.EntityEvent;

public class EntityFluidEvent extends EntityEvent
{
	private final Fluid fluid;
	
	private EntityFluidEvent(Entity entity, Fluid fluid)
	{
		super(entity);
		this.fluid = fluid;
	}

	public Fluid getFluid()
	{
		return fluid;
	}

	/**
	 * This event is fired when an entity enters a fluid to at least eye-level.
	 * If this is a player, they will see the "submerged in fluid" effect at this point.
	 * <br>
	 * This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
	 * <br>
	 * This event does not have a result. {@link HasResult}<br>
	 * <br>
	 * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
	 */
	public static class Entered extends EntityFluidEvent
	{
		public Entered(Entity entity, Fluid fluid)
		{
			super(entity, fluid);
		}
	}

	/**
	 * This event is fired when an entity was previously submerged in a fluid to at least eye-level and no longer are.
	 * If this is a player, they will no longer see the "submerged in fluid" effect at this point.
	 * <br>
	 * This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
	 * <br>
	 * This event does not have a result. {@link HasResult}<br>
	 * <br>
	 * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
	 */
	public static class Exited extends EntityFluidEvent
	{
		public Exited(Entity entity, Fluid fluid)
		{
			super(entity, fluid);
		}
	}
}