Package net.minecraft.client.renderer
Class CloudRenderer
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Optional<CloudRenderer.TextureData>>
net.minecraft.client.renderer.CloudRenderer
- All Implemented Interfaces:
AutoCloseable
,PreparableReloadListener
public class CloudRenderer
extends SimplePreparableReloadListener<Optional<CloudRenderer.TextureData>>
implements AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enum
static final record
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final float
private static final float
private static final int
private static final int
private static final long
private static final int
private static final int
private final RenderSystem.AutoStorageIndexBuffer
private static final org.slf4j.Logger
private static final int
private boolean
private static final int
private int
private int
private CloudRenderer.RelativeCameraPos
private CloudStatus
private int
private static final int
private CloudRenderer.TextureData
private static final ResourceLocation
private final MappableRingBuffer
private static final int
private MappableRingBuffer
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
apply
(Optional<CloudRenderer.TextureData> pObject, ResourceManager pResourceManager, ProfilerFiller pProfiler) private void
buildExtrudedCell
(CloudRenderer.RelativeCameraPos pRelativeCameraPos, ByteBuffer pBuffer, int pCellX, int pCellZ, long pCellData) private void
buildFlatCell
(ByteBuffer pBuffer, int pCellX, int pCellZ) private void
buildMesh
(CloudRenderer.RelativeCameraPos pRelativeCameraPos, ByteBuffer pBuffer, int pCellX, int pCellZ, boolean pFancyClouds, int pSize) void
close()
private void
encodeFace
(ByteBuffer pBuffer, int pCellX, int pCellZ, Direction pFace, int pOffset) void
endFrame()
private static int
getSizeForCloudDistance
(int pCloudDistance) private static boolean
isCellEmpty
(int pColor) private static boolean
isEastEmpty
(long pCellData) private static boolean
isNorthEmpty
(long pCellData) private static boolean
isSouthEmpty
(long pCellData) private static boolean
isWestEmpty
(long pCellData) void
private static long
packCellData
(int pColor, boolean pNorthEmpty, boolean pEastEmpty, boolean pSouthEmpty, boolean pWestEmpty) protected Optional
<CloudRenderer.TextureData> prepare
(ResourceManager pResourceManager, ProfilerFiller pProfiler) Performs any reloading that can be done off-thread, such as file IOvoid
render
(int pCloudColor, CloudStatus pCloudStatus, float pHeight, Vec3 pCameraPosition, float pTicks) private void
tryBuildCell
(CloudRenderer.RelativeCameraPos pRelativeCameraPos, ByteBuffer pBuffer, int pCellX, int pCellZ, boolean pFancyClouds, int pX, int pWidth, int pZ, int pHeight, long[] pCells) Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reload
Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Field Details
-
FLAG_INSIDE_FACE
private static final int FLAG_INSIDE_FACE- See Also:
-
FLAG_USE_TOP_COLOR
private static final int FLAG_USE_TOP_COLOR- See Also:
-
MAX_RADIUS_CHUNKS
private static final int MAX_RADIUS_CHUNKS- See Also:
-
CELL_SIZE_IN_BLOCKS
private static final float CELL_SIZE_IN_BLOCKS- See Also:
-
UBO_SIZE
private static final int UBO_SIZE -
LOGGER
private static final org.slf4j.Logger LOGGER -
TEXTURE_LOCATION
-
BLOCKS_PER_SECOND
private static final float BLOCKS_PER_SECOND- See Also:
-
EMPTY_CELL
private static final long EMPTY_CELL- See Also:
-
COLOR_OFFSET
private static final int COLOR_OFFSET- See Also:
-
NORTH_OFFSET
private static final int NORTH_OFFSET- See Also:
-
EAST_OFFSET
private static final int EAST_OFFSET- See Also:
-
SOUTH_OFFSET
private static final int SOUTH_OFFSET- See Also:
-
WEST_OFFSET
private static final int WEST_OFFSET- See Also:
-
needsRebuild
private boolean needsRebuild -
prevCellX
private int prevCellX -
prevCellZ
private int prevCellZ -
prevRelativeCameraPos
-
prevType
-
texture
-
quadCount
private int quadCount -
indices
-
ubo
-
utb
-
-
Constructor Details
-
CloudRenderer
public CloudRenderer()
-
-
Method Details
-
prepare
protected Optional<CloudRenderer.TextureData> prepare(ResourceManager pResourceManager, ProfilerFiller pProfiler) Performs any reloading that can be done off-thread, such as file IO- Specified by:
prepare
in classSimplePreparableReloadListener<Optional<CloudRenderer.TextureData>>
-
getSizeForCloudDistance
private static int getSizeForCloudDistance(int pCloudDistance) -
apply
protected void apply(Optional<CloudRenderer.TextureData> pObject, ResourceManager pResourceManager, ProfilerFiller pProfiler) - Specified by:
apply
in classSimplePreparableReloadListener<Optional<CloudRenderer.TextureData>>
-
isCellEmpty
private static boolean isCellEmpty(int pColor) -
packCellData
private static long packCellData(int pColor, boolean pNorthEmpty, boolean pEastEmpty, boolean pSouthEmpty, boolean pWestEmpty) -
isNorthEmpty
private static boolean isNorthEmpty(long pCellData) -
isEastEmpty
private static boolean isEastEmpty(long pCellData) -
isSouthEmpty
private static boolean isSouthEmpty(long pCellData) -
isWestEmpty
private static boolean isWestEmpty(long pCellData) -
render
public void render(int pCloudColor, CloudStatus pCloudStatus, float pHeight, Vec3 pCameraPosition, float pTicks) -
buildMesh
private void buildMesh(CloudRenderer.RelativeCameraPos pRelativeCameraPos, ByteBuffer pBuffer, int pCellX, int pCellZ, boolean pFancyClouds, int pSize) -
tryBuildCell
private void tryBuildCell(CloudRenderer.RelativeCameraPos pRelativeCameraPos, ByteBuffer pBuffer, int pCellX, int pCellZ, boolean pFancyClouds, int pX, int pWidth, int pZ, int pHeight, long[] pCells) -
buildFlatCell
-
encodeFace
-
buildExtrudedCell
private void buildExtrudedCell(CloudRenderer.RelativeCameraPos pRelativeCameraPos, ByteBuffer pBuffer, int pCellX, int pCellZ, long pCellData) -
markForRebuild
public void markForRebuild() -
endFrame
public void endFrame() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-