Class RenderTypeHelper
java.lang.Object
dev.cammiescorner.velvet.api.util.RenderTypeHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.client.renderer.RenderTypecopy(net.minecraft.client.renderer.RenderType existing, String newName, Consumer<net.minecraft.client.renderer.RenderType.CompositeState.CompositeStateBuilder> phaseTransform) Copies aRenderTypewith all its parameters, but applies the givenphaseTransformto the copied parameters.static net.minecraft.client.renderer.RenderType.CompositeStatecopyPhaseParameters(net.minecraft.client.renderer.RenderType existing, Consumer<net.minecraft.client.renderer.RenderType.CompositeState.CompositeStateBuilder> phaseTransform) static StringgetName(net.minecraft.client.renderer.RenderStateShard phase) Gets the name of aRenderStateShardstatic voidregisterBlockRenderType(net.minecraft.client.renderer.RenderType type) Deprecated.this feature is likely to cause incompatibilities.
-
Constructor Details
-
RenderTypeHelper
public RenderTypeHelper()
-
-
Method Details
-
getName
@API(status=EXPERIMENTAL, since="1.5.0") public static String getName(net.minecraft.client.renderer.RenderStateShard phase) Gets the name of aRenderStateShardThis method can be used with
copy(RenderType, String, Consumer)to make unique names based on the base layer's own name.- Parameters:
phase- a render phase or layer- Returns:
- the name that was passed to
RenderStateShard(String, Runnable, Runnable)
-
copy
@API(status=EXPERIMENTAL, since="1.4.0") public static net.minecraft.client.renderer.RenderType copy(net.minecraft.client.renderer.RenderType existing, String newName, Consumer<net.minecraft.client.renderer.RenderType.CompositeState.CompositeStateBuilder> phaseTransform) Copies aRenderTypewith all its parameters, but applies the givenphaseTransformto the copied parameters.A typical use of this method is to create a new render layer with a different target (eg. a target that supports shaders). For example:
RenderTypeHelper.copy( RenderType.translucent(), "mymod:special_layer", builder -> builder.target(someShaderEnablingTarget) );- Parameters:
existing- the render layer to duplicatenewName- the name of the new render layerphaseTransform- a transformation operation to apply to the new layer's parameter builder- Returns:
- a
RenderTypewith the same base parameters asexistingbut modified according tophaseTransform - Throws:
IllegalArgumentException- ifexistingis not aMultiPhaserender layer
-
copyPhaseParameters
@API(status=EXPERIMENTAL, since="1.4.0") public static net.minecraft.client.renderer.RenderType.CompositeState copyPhaseParameters(net.minecraft.client.renderer.RenderType existing, Consumer<net.minecraft.client.renderer.RenderType.CompositeState.CompositeStateBuilder> phaseTransform) -
registerBlockRenderType
@Deprecated @API(status=EXPERIMENTAL, since="1.5.0") public static void registerBlockRenderType(net.minecraft.client.renderer.RenderType type) Deprecated.this feature is likely to cause incompatibilities. Use at your own discretion.Register a custom RenderType for block rendering.Custom block render layers are usually not supported by alternative renderers. Calling this method will have no visible effect if one of those is active.
- Throws:
IllegalStateException- if this method is called afterbuffer buildershave been initialized.
-