package com.lothrazar.cyclic.render;

import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;

/**
 * Render Types with help from direwolf20 MIT open source project https://github.com/Direwolf20-MC/BuildingGadgets/blob/1.15/LICENSE.md
 */
public class FakeBlockRenderTypes extends RenderType {

  public FakeBlockRenderTypes(String nameIn, VertexFormat formatIn, VertexFormat.Mode drawModeIn, int bufferSizeIn, boolean useDelegateIn, boolean needsSortingIn, Runnable setupTaskIn, Runnable clearTaskIn) {
    super(nameIn, formatIn, drawModeIn, bufferSizeIn, useDelegateIn, needsSortingIn, setupTaskIn, clearTaskIn);
  }

  /**
   * laser rendering from this MIT project https://github.com/Direwolf20-MC/DireGoo2/blob/master/LICENSE.md 1.17 BOOLS are
   * <p>
   * this.affectsCrumbling = p_173182_; this.sortOnUpload = p_173183_;
   */
  public static final RenderType LASER_MAIN_BEAM = create("MiningLaserMainBeam",
      DefaultVertexFormat.POSITION_COLOR_TEX, VertexFormat.Mode.QUADS, 256,
      false, false, // affectsCrumbling, sortOnUpload
      RenderType.CompositeState.builder()
          .setShaderState(RENDERTYPE_ENTITY_TRANSLUCENT_SHADER) //1.17 new
          .setLayeringState(VIEW_OFFSET_Z_LAYERING)
          .setTransparencyState(TRANSLUCENT_TRANSPARENCY)
          .setDepthTestState(RenderStateShard.LEQUAL_DEPTH_TEST)
          .setCullState(NO_CULL)
          .setLightmapState(NO_LIGHTMAP)
          .setWriteMaskState(COLOR_WRITE)
          .createCompositeState(false));
  //
  public static final RenderType FAKE_BLOCK = create("fakeBlock",
      DefaultVertexFormat.BLOCK, VertexFormat.Mode.QUADS, 256, false, false, // affectsCrumbling, sortOnUpload
      RenderType.CompositeState.builder()
          .setShaderState(RENDERTYPE_ENTITY_TRANSLUCENT_SHADER) //1.17 new
          //          .setShadeModelState(SMOOTH_SHADE)
          .setLightmapState(LIGHTMAP)
          .setTextureState(BLOCK_SHEET_MIPPED)
          //          .layer(PROJECTION_LAYERING)
          .setTransparencyState(TRANSLUCENT_TRANSPARENCY)
          .setDepthTestState(LEQUAL_DEPTH_TEST)
          .setCullState(NO_CULL)
          .setWriteMaskState(COLOR_DEPTH_WRITE)
          .createCompositeState(false));
  public static final RenderType TRANSPARENT_COLOUR = create("transparentColour",
      DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS, 256, false, false, // affectsCrumbling, sortOnUpload
      RenderType.CompositeState.builder()
          .setShaderState(RENDERTYPE_ENTITY_TRANSLUCENT_SHADER) //1.17 new
          //          .layer(PROJECTION_LAYERING)
          .setTransparencyState(TRANSLUCENT_TRANSPARENCY)
          .setTextureState(NO_TEXTURE)
          .setDepthTestState(LEQUAL_DEPTH_TEST)
          .setCullState(CULL)
          .setLightmapState(NO_LIGHTMAP)
          .setWriteMaskState(COLOR_DEPTH_WRITE)
          .createCompositeState(false));
  public static final RenderType SOLID_COLOUR = create("solidColour",
      DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS, 256, false, false, // affectsCrumbling, sortOnUpload
      RenderType.CompositeState.builder()
          .setShaderState(RenderStateShard.RENDERTYPE_TRANSLUCENT_MOVING_BLOCK_SHADER) //1.17 new
          //          .layer(PROJECTION_LAYERING)
          .setTransparencyState(ADDITIVE_TRANSPARENCY)
          .setTextureState(NO_TEXTURE)
          .setDepthTestState(LEQUAL_DEPTH_TEST)
          .setCullState(CULL)
          .setLightmapState(NO_LIGHTMAP)
          .setWriteMaskState(COLOR_DEPTH_WRITE)
          .createCompositeState(false));
}

@@ -876,16 +876,30 @@
 CENSE.md
+%0A   * %3Cp%3E%0A   *
  1.17 BO
@@ -905,30 +905,16 @@
 OOLS are
-%0A   * %3Cp%3E%0A   *
  this.af
@@ -3276,76 +3276,172 @@
     
-.setShaderState(RenderStateShard.RENDERTYPE_TRANSLUCENT_MOVING_BLOCK
+//RENDERTYPE_TRANSLUCENT_MOVING_BLOCK_SHADER %0A          //RENDERTYPE_TRANSLUCENT_SHADER%0A          .setShaderState(RenderStateShard.ShaderStateShard.RENDERTYPE_LINES
 _SHA
@@ -3596,32 +3596,32 @@
 NO_TEXTURE)%0A
-
         
   .setDepthT
@@ -3600,32 +3600,70 @@
 EXTURE)%0A        
+  .setDepthTestState(NO_DEPTH_TEST) //
   .setDepthTestS

update shader