public interface IActionSource
EntityPlayer or an IActionHost.
In most cases this is used for security checks, but can be used to validate the source itself.| Modifier and Type | Method and Description |
|---|---|
<T> java.util.Optional<T> |
context(java.lang.Class<T> key)
An
IActionSource can have multiple optional contexts. |
java.util.Optional<IActionHost> |
machine()
If present, it indicates the
IActionHost of the source. |
java.util.Optional<net.minecraft.entity.player.EntityPlayer> |
player()
If present, AE will consider the player being the source for the action.
|
@Nonnull java.util.Optional<net.minecraft.entity.player.EntityPlayer> player()
machine() in any case.@Nonnull java.util.Optional<IActionHost> machine()
IActionHost of the source.
Should player() be absent, it will consider a machine as source.
It is recommended to include the machine even when a player is present.@Nonnull
<T> java.util.Optional<T> context(@Nonnull
java.lang.Class<T> key)
IActionSource can have multiple optional contexts.
It is strongly recommended to limit the uses for absolutely necessary cases.
Currently there are no public contexts made available by AE.
An example would be the context interfaces use internally to avoid looping items between each other.