类 RegisterShadersEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RegisterShadersEvent
所有已实现的接口:
net.minecraftforge.fml.event.IModBusEvent

public class RegisterShadersEvent extends net.minecraftforge.eventbus.api.Event implements net.minecraftforge.fml.event.IModBusEvent
Fired to allow mods to register custom shaders. This event is fired after the default Minecraft shaders have been registered.

This event is not cancellable, and does not have a result.

This event is fired on the mod-specific event bus, only on the logical client.

  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getResourceProvider

      public ResourceProvider getResourceProvider()
      返回 the client-side resource provider。
      返回:
      the client-side resource provider
    • registerShader

      public void registerShader(ShaderInstance shaderInstance, Consumer<ShaderInstance> onLoaded)
      Registers a shader, and a callback for when the shader is loaded.

      When creating a ShaderInstance, pass in the client-side resource provider as the resource provider.

      Mods should not store the shader instance passed into this method. Instead, mods should store the shader passed into the registered load callback.

      参数:
      shaderInstance - a shader
      onLoaded - a callback for when the shader is loaded