Class WorldRenderMacros

java.lang.Object
com.ldtteam.structurize.util.WorldRenderMacros
Direct Known Subclasses:
WorldRenderContext

public abstract class WorldRenderMacros extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    net.minecraft.client.renderer.MultiBufferSource.BufferSource
     
    net.minecraft.world.phys.Vec3
     
    net.minecraft.client.multiplayer.ClientLevel
     
    net.minecraft.client.player.LocalPlayer
     
    int
    In chunks
    static final net.minecraft.client.renderer.RenderType
     
    static final net.minecraft.client.renderer.RenderType
     
    static final float
     
    net.minecraft.client.DeltaTracker
     
    net.neoforged.neoforge.client.event.RenderLevelStageEvent
     
    static final net.minecraft.client.renderer.RenderType
     
    static final net.minecraft.client.renderer.RenderType
     
    static final net.minecraft.client.renderer.RenderType
     
    static final net.minecraft.client.renderer.RenderType
     
    static final net.minecraft.client.renderer.RenderType
     
    net.minecraft.world.item.ItemStack
     
    static final int
     
    net.minecraft.client.Minecraft
     
    com.mojang.blaze3d.vertex.PoseStack
     
    static final net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    isVisible(net.minecraft.core.BlockPos pos)
     
    final boolean
    isVisible(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB)
     
    final boolean
    isVisible(net.minecraft.world.phys.AABB aabb)
     
    final void
     
    void
     
    protected final void
    populateCuboid(float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int red, int green, int blue, int alpha, org.joml.Matrix4f m, com.mojang.blaze3d.vertex.VertexConsumer buf)
     
    protected final void
    populateRectangle(int x, int y, int z, int w, int h, int red, int green, int blue, int alpha, com.mojang.blaze3d.vertex.VertexConsumer buffer, org.joml.Matrix4f m)
     
    protected final void
    populateRenderLineBox(float minX, float minY, float minZ, float minX2, float minY2, float minZ2, float maxX, float maxY, float maxZ, float maxX2, float maxY2, float maxZ2, int red, int green, int blue, int alpha, org.joml.Matrix4f m, com.mojang.blaze3d.vertex.VertexConsumer buf)
     
    final void
    pushPoseCameraToPos(net.minecraft.core.BlockPos pos)
    Moved pose context to camera and given pos
    void
     
    final void
    renderBlackLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth)
    Render a black box around two positions
    final void
    renderBlueprint(BlueprintPreviewData blueprint, Collection<net.minecraft.core.BlockPos> points)
    Draw a blueprint at list of given pos.
    final void
    renderBlueprint(BlueprintPreviewData blueprint, net.minecraft.core.BlockPos pos)
    Draw a blueprint at given pos.
    final void
    renderBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int argbColor)
     
    final void
    renderBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int red, int green, int blue, int alpha)
     
    final void
    renderDebugText(net.minecraft.core.BlockPos pos, List<String> text, boolean forceWhite, int mergeEveryXListElements)
    Renders the given list of strings, 3 elements a row.
    final void
    renderDebugText(net.minecraft.core.BlockPos renderPos, net.minecraft.core.BlockPos worldPos, List<String> text, boolean forceWhite, int mergeEveryXListElements)
    Renders the given list of strings, 3 elements a row.
    final void
    renderFillRectangle(int x, int y, int z, int w, int h, int argbColor)
     
    final void
    renderLineAABB(net.minecraft.client.renderer.RenderType renderType, net.minecraft.world.phys.AABB aabb, int argbColor, float lineWidth)
    Render a colored box around from aabb
    final void
    renderLineAABB(net.minecraft.client.renderer.RenderType renderType, net.minecraft.world.phys.AABB aabb, int red, int green, int blue, int alpha, float lineWidth)
    Render a colored box around from aabb
    final void
    renderLineBox(net.minecraft.client.renderer.RenderType renderType, float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int red, int green, int blue, int alpha, float lineWidth)
    Render a box around two positions
    final void
    renderLineBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos pos, int argbColor, float lineWidth)
    Render a colored box around position
    final void
    renderLineBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int argbColor, float lineWidth)
    Render a colored box around two positions
    final void
    renderLineBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int red, int green, int blue, int alpha, float lineWidth)
    Render a box around two positions
    final void
    renderRedGlintLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth)
    Render a red glint box around two positions
    final void
    renderWhiteLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth)
    Render a white box around two positions
    protected abstract void
    renderWithinContext(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage stage)
    This is called with properly prepared context.
    void
    renderWorldLastEvent(net.neoforged.neoforge.client.event.RenderLevelStageEvent e)
    Call this from event handler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_DEBUG_TEXT_RENDER_DIST_SQUARED

      public static final int MAX_DEBUG_TEXT_RENDER_DIST_SQUARED
    • LINES

      public static final net.minecraft.client.renderer.RenderType LINES
    • LINES_WITH_WIDTH

      public static final net.minecraft.client.renderer.RenderType LINES_WITH_WIDTH
    • LINES_WITH_WIDTH_DEPTH_INVERT

      public static final net.minecraft.client.renderer.RenderType LINES_WITH_WIDTH_DEPTH_INVERT
    • GLINT_LINES

      public static final net.minecraft.client.renderer.RenderType GLINT_LINES
    • GLINT_LINES_WITH_WIDTH

      public static final net.minecraft.client.renderer.RenderType GLINT_LINES_WITH_WIDTH
    • COLORED_TRIANGLES

      public static final net.minecraft.client.renderer.RenderType COLORED_TRIANGLES
    • COLORED_TRIANGLES_NC_ND

      public static final net.minecraft.client.renderer.RenderType COLORED_TRIANGLES_NC_ND
    • STAGE_FOR_LINES

      public static final net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage STAGE_FOR_LINES
    • DEFAULT_LINE_WIDTH

      public static final float DEFAULT_LINE_WIDTH
      See Also:
    • mc

      public net.minecraft.client.Minecraft mc
    • event

      public net.neoforged.neoforge.client.event.RenderLevelStageEvent event
    • clientPlayer

      public net.minecraft.client.player.LocalPlayer clientPlayer
    • bufferSource

      public net.minecraft.client.renderer.MultiBufferSource.BufferSource bufferSource
    • poseStack

      public com.mojang.blaze3d.vertex.PoseStack poseStack
    • deltaTracker

      public net.minecraft.client.DeltaTracker deltaTracker
    • clientLevel

      public net.minecraft.client.multiplayer.ClientLevel clientLevel
    • mainHandItem

      public net.minecraft.world.item.ItemStack mainHandItem
    • cameraPosition

      public net.minecraft.world.phys.Vec3 cameraPosition
    • clientRenderDist

      public int clientRenderDist
      In chunks
  • Constructor Details

    • WorldRenderMacros

      public WorldRenderMacros()
  • Method Details

    • renderWorldLastEvent

      public void renderWorldLastEvent(net.neoforged.neoforge.client.event.RenderLevelStageEvent e)
      Call this from event handler
      Parameters:
      event -
    • renderWithinContext

      protected abstract void renderWithinContext(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage stage)
      This is called with properly prepared context. Do here what you want
      Parameters:
      stage - render world stage
    • pushPoseCameraToPos

      public final void pushPoseCameraToPos(net.minecraft.core.BlockPos pos)
      Moved pose context to camera and given pos
      See Also:
    • popPose

      public final void popPose()
    • pushShaderMvMatrixFromPose

      public void pushShaderMvMatrixFromPose()
    • popShaderMvMatrix

      public void popShaderMvMatrix()
    • isVisible

      public final boolean isVisible(net.minecraft.world.phys.AABB aabb)
      Returns:
      true if given aabb can be in any way seen by camera
    • isVisible

      public final boolean isVisible(net.minecraft.core.BlockPos pos)
      Returns:
      true if given pos can be in any way seen by camera
    • isVisible

      public final boolean isVisible(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB)
      Returns:
      true if given box can be in any way seen by camera
    • renderBlueprint

      public final void renderBlueprint(BlueprintPreviewData blueprint, net.minecraft.core.BlockPos pos)
      Draw a blueprint at given pos.
      Parameters:
      pos - position to render at
      previewData - the blueprint and context to draw.
    • renderBlueprint

      public final void renderBlueprint(BlueprintPreviewData blueprint, Collection<net.minecraft.core.BlockPos> points)
      Draw a blueprint at list of given pos.
      Parameters:
      points - list of positions to render at
      previewData - the blueprint and context to draw.
    • renderBlackLineBox

      public final void renderBlackLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth)
      Render a black box around two positions
      Parameters:
      posA - The first Position
      posB - The second Position
    • renderRedGlintLineBox

      public final void renderRedGlintLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth)
      Render a red glint box around two positions
      Parameters:
      posA - The first Position
      posB - The second Position
    • renderWhiteLineBox

      public final void renderWhiteLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth)
      Render a white box around two positions
      Parameters:
      posA - The first Position
      posB - The second Position
    • renderLineAABB

      public final void renderLineAABB(net.minecraft.client.renderer.RenderType renderType, net.minecraft.world.phys.AABB aabb, int argbColor, float lineWidth)
      Render a colored box around from aabb
      Parameters:
      aabb - the box
    • renderLineAABB

      public final void renderLineAABB(net.minecraft.client.renderer.RenderType renderType, net.minecraft.world.phys.AABB aabb, int red, int green, int blue, int alpha, float lineWidth)
      Render a colored box around from aabb
      Parameters:
      aabb - the box
    • renderLineBox

      public final void renderLineBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos pos, int argbColor, float lineWidth)
      Render a colored box around position
      Parameters:
      pos - The Position
    • renderLineBox

      public final void renderLineBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int argbColor, float lineWidth)
      Render a colored box around two positions
      Parameters:
      posA - The first Position
      posB - The second Position
    • renderLineBox

      public final void renderLineBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int red, int green, int blue, int alpha, float lineWidth)
      Render a box around two positions
      Parameters:
      posA - First position
      posB - Second position
    • renderLineBox

      public final void renderLineBox(net.minecraft.client.renderer.RenderType renderType, float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int red, int green, int blue, int alpha, float lineWidth)
      Render a box around two positions
      Parameters:
      posA - First position
      posB - Second position
    • populateRenderLineBox

      protected final void populateRenderLineBox(float minX, float minY, float minZ, float minX2, float minY2, float minZ2, float maxX, float maxY, float maxZ, float maxX2, float maxY2, float maxZ2, int red, int green, int blue, int alpha, org.joml.Matrix4f m, com.mojang.blaze3d.vertex.VertexConsumer buf)
    • renderBox

      public final void renderBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int argbColor)
    • renderBox

      public final void renderBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int red, int green, int blue, int alpha)
    • populateCuboid

      protected final void populateCuboid(float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int red, int green, int blue, int alpha, org.joml.Matrix4f m, com.mojang.blaze3d.vertex.VertexConsumer buf)
    • renderFillRectangle

      public final void renderFillRectangle(int x, int y, int z, int w, int h, int argbColor)
    • populateRectangle

      protected final void populateRectangle(int x, int y, int z, int w, int h, int red, int green, int blue, int alpha, com.mojang.blaze3d.vertex.VertexConsumer buffer, org.joml.Matrix4f m)
    • renderDebugText

      public final void renderDebugText(net.minecraft.core.BlockPos pos, List<String> text, boolean forceWhite, int mergeEveryXListElements)
      Renders the given list of strings, 3 elements a row.
      Parameters:
      pos - position to render at
      text - text list
      forceWhite - force white for no depth rendering
      mergeEveryXListElements - merge every X elements of text list using a tostring call
      matrixStack - stack to use
      buffer - render buffer
    • renderDebugText

      public final void renderDebugText(net.minecraft.core.BlockPos renderPos, net.minecraft.core.BlockPos worldPos, List<String> text, boolean forceWhite, int mergeEveryXListElements)
      Renders the given list of strings, 3 elements a row.
      Parameters:
      renderPos - position to render at
      worldPos - (logic) position in world
      text - text list
      forceWhite - force white for no depth rendering
      mergeEveryXListElements - merge every X elements of text list using a tostring call
      matrixStack - stack to use
      buffer - render buffer