java.lang.Object
net.minecraftforge.server.permission.context.Context
All Implemented Interfaces:
IContext
Direct Known Subclasses:
PlayerContext, WorldContext

public class Context extends Object implements IContext
  • Field Details

  • Constructor Details

    • Context

      public Context()
  • Method Details

    • getWorld

      @Nullable public Level getWorld()
      Description copied from interface: IContext
      World from where permission is requested. Can be null
      Specified by:
      getWorld in interface IContext
    • getPlayer

      @Nullable public Player getPlayer()
      Specified by:
      getPlayer in interface IContext
      Returns:
      Player requesting permission. Can be null
    • get

      @Nullable public <T> T get(ContextKey<T> key)
      Specified by:
      get in interface IContext
      Parameters:
      key - Context key
      Returns:
      Context object
    • has

      public boolean has(ContextKey<?> key)
      Specified by:
      has in interface IContext
      Parameters:
      key - Context key
      Returns:
      true if context contains this key
    • set

      public <T> Context set(ContextKey<T> key, @Nullable T obj)
      Sets Context object
      Parameters:
      key - Context key
      obj - Context object. Can be null
      Returns:
      itself, for easy context chaining
    • covers

      protected boolean covers(ContextKey<?> key)