Class Context
- java.lang.Object
-
- net.minecraftforge.server.permission.context.Context
-
- All Implemented Interfaces:
IContext
- Direct Known Subclasses:
PlayerContext
,WorldContext
public class Context extends java.lang.Object implements IContext
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<ContextKey<?>,java.lang.Object>
map
-
Constructor Summary
Constructors Constructor Description Context()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
covers(ContextKey<?> key)
<T> T
get(ContextKey<T> key)
PlayerEntity
getPlayer()
World
getWorld()
World from where permission is requested.boolean
has(ContextKey<?> key)
<T> Context
set(ContextKey<T> key, T obj)
Sets Context object
-
-
-
Field Detail
-
map
private java.util.Map<ContextKey<?>,java.lang.Object> map
-
-
Method Detail
-
getWorld
@Nullable public World getWorld()
Description copied from interface:IContext
World from where permission is requested. Can be null
-
getPlayer
@Nullable public PlayerEntity getPlayer()
-
get
@Nullable public <T> T get(ContextKey<T> key)
-
has
public boolean has(ContextKey<?> key)
-
set
public <T> Context set(ContextKey<T> key, @Nullable T obj)
Sets Context object- Parameters:
key
- Context keyobj
- Context object. Can be null- Returns:
- itself, for easy context chaining
-
covers
protected boolean covers(ContextKey<?> key)
-
-