Class Context

    • Field Detail

      • map

        private java.util.Map<ContextKey<?>,​java.lang.Object> map
    • Constructor Detail

      • Context

        public Context()
    • Method Detail

      • getWorld

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

        @Nullable
        public PlayerEntity 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)