Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
1.5 kB
2
Indexable
Never
package com.radon.naruto_universe.client.entity;

import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.radon.naruto_universe.NarutoUniverse;
import com.radon.naruto_universe.shader.ShaderRegistry;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;

public class RenderTypeRegistry extends RenderType {
    public RenderTypeRegistry(String name, VertexFormat format, VertexFormat.Mode mode, int bufferSize, boolean affectsCrumbling, boolean sortOnUpload, Runnable setupState, Runnable clearState) {
        super(name, format, mode, bufferSize, affectsCrumbling, sortOnUpload, setupState, clearState);
    }

    public static RenderType FIREBALL_RENDER = RenderType.create("normal", DefaultVertexFormat.PARTICLE, VertexFormat.Mode.QUADS, 256, false, false, RenderType.CompositeState.builder()
            .setTextureState(new RenderStateShard.TextureStateShard(new ResourceLocation(NarutoUniverse.MOD_ID, "textures/entity/fireball.png"), true, false))
            .setTransparencyState(LIGHTNING_TRANSPARENCY)
            .setCullState(NO_CULL)
            .setLightmapState(LIGHTMAP)
            .setOverlayState(OVERLAY)
            .setWriteMaskState(RenderStateShard.COLOR_WRITE)
            .setShaderState(new RenderStateShard.ShaderStateShard(() -> ShaderRegistry.BASIC_SHADER))
            .createCompositeState(false));
}