Package com.ldtteam.structurize.util
Class WorldRenderMacros
java.lang.Object
com.ldtteam.structurize.util.WorldRenderMacros
- Direct Known Subclasses:
WorldRenderContext
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionnet.minecraft.client.renderer.MultiBufferSource.BufferSourcenet.minecraft.world.phys.Vec3net.minecraft.client.multiplayer.ClientLevelnet.minecraft.client.player.LocalPlayerintIn chunksstatic final net.minecraft.client.renderer.RenderTypestatic final net.minecraft.client.renderer.RenderTypestatic final floatnet.minecraft.client.DeltaTrackernet.neoforged.neoforge.client.event.RenderLevelStageEventstatic final net.minecraft.client.renderer.RenderTypestatic final net.minecraft.client.renderer.RenderTypestatic final net.minecraft.client.renderer.RenderTypestatic final net.minecraft.client.renderer.RenderTypestatic final net.minecraft.client.renderer.RenderTypenet.minecraft.world.item.ItemStackstatic final intnet.minecraft.client.Minecraftcom.mojang.blaze3d.vertex.PoseStackstatic final net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanisVisible(net.minecraft.core.BlockPos pos) final booleanisVisible(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB) final booleanisVisible(net.minecraft.world.phys.AABB aabb) final voidpopPose()voidprotected final voidpopulateCuboid(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 voidpopulateRectangle(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 voidpopulateRenderLineBox(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 voidpushPoseCameraToPos(net.minecraft.core.BlockPos pos) Moved pose context to camera and given posvoidfinal voidrenderBlackLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth) Render a black box around two positionsfinal voidrenderBlueprint(BlueprintPreviewData blueprint, Collection<net.minecraft.core.BlockPos> points) Draw a blueprint at list of given pos.final voidrenderBlueprint(BlueprintPreviewData blueprint, net.minecraft.core.BlockPos pos) Draw a blueprint at given pos.final voidrenderBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, int argbColor) final voidrenderBox(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 voidrenderDebugText(net.minecraft.core.BlockPos pos, List<String> text, boolean forceWhite, int mergeEveryXListElements) Renders the given list of strings, 3 elements a row.final voidrenderDebugText(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 voidrenderFillRectangle(int x, int y, int z, int w, int h, int argbColor) final voidrenderLineAABB(net.minecraft.client.renderer.RenderType renderType, net.minecraft.world.phys.AABB aabb, int argbColor, float lineWidth) Render a colored box around from aabbfinal voidrenderLineAABB(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 aabbfinal voidrenderLineBox(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 positionsfinal voidrenderLineBox(net.minecraft.client.renderer.RenderType renderType, net.minecraft.core.BlockPos pos, int argbColor, float lineWidth) Render a colored box around positionfinal voidrenderLineBox(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 positionsfinal voidrenderLineBox(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 positionsfinal voidrenderRedGlintLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth) Render a red glint box around two positionsfinal voidrenderWhiteLineBox(net.minecraft.core.BlockPos posA, net.minecraft.core.BlockPos posB, float lineWidth) Render a white box around two positionsprotected abstract voidrenderWithinContext(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage stage) This is called with properly prepared context.voidrenderWorldLastEvent(net.neoforged.neoforge.client.event.RenderLevelStageEvent e) Call this from event handler
-
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 clientRenderDistIn 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
Draw a blueprint at given pos.- Parameters:
pos- position to render atpreviewData- 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 atpreviewData- 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 PositionposB- 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 PositionposB- 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 PositionposB- 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 PositionposB- 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 positionposB- 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 positionposB- 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 attext- text listforceWhite- force white for no depth renderingmergeEveryXListElements- merge every X elements of text list using a tostring callmatrixStack- stack to usebuffer- 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 atworldPos- (logic) position in worldtext- text listforceWhite- force white for no depth renderingmergeEveryXListElements- merge every X elements of text list using a tostring callmatrixStack- stack to usebuffer- render buffer
-