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 enumstatic final recordNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatprivate static final floatprivate static final intprivate static final intprivate static final longprivate static final floatprivate intprivate final RenderSystem.AutoStorageIndexBufferprivate static final org.slf4j.Loggerprivate booleanprivate static final intprivate intprivate intprivate CloudRenderer.RelativeCameraPosprivate CloudStatusprivate static final intprivate CloudRenderer.TextureDataprivate static final ResourceLocationprivate GpuBufferprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(Optional<CloudRenderer.TextureData> p_362811_, ResourceManager p_364101_, ProfilerFiller p_360749_) private voidbuildExtrudedCell(CloudRenderer.RelativeCameraPos pRelativeCameraPos, BufferBuilder pBufferBuilder, int pBottomColor, int pTopColor, int pSideColor, int pFrontColor, int pX, int pY, long pCellData) private voidbuildFlatCell(BufferBuilder pBufferBuilder, int pColor, int pX, int pY) private MeshDatabuildMesh(Tesselator pTesselator, int pCellX, int pCellY, CloudStatus pCloudStatus, CloudRenderer.RelativeCameraPos pRelativeCameraPos, RenderPipeline pPipeline) private voidbuildMesh(CloudRenderer.RelativeCameraPos pRelativeCameraPos, BufferBuilder pBufferBuilder, int pCellX, int pCellZ, int pBottomColor, int pTopColor, int pSideColor, int pFrontColor, boolean pFancyClouds) voidclose()private voiddraw(RenderPipeline pPipeline, float pX, float pY, float pZ) private static intgetColor(long pCellData) private static booleanisCellEmpty(int pColor) private static booleanisEastEmpty(long pCellData) private static booleanisNorthEmpty(long pCellData) private static booleanisSouthEmpty(long pCellData) private static booleanisWestEmpty(long pCellData) voidprivate static longpackCellData(int pColor, boolean pNorthEmpty, boolean pEastEmpty, boolean pSouthEmpty, boolean pWestEmpty) protected Optional<CloudRenderer.TextureData> prepare(ResourceManager p_363181_, ProfilerFiller p_361418_) Performs any reloading that can be done off-thread, such as file IOvoidrender(int pCloudColor, CloudStatus pCloudStatus, float pHeight, Vec3 pCameraPosition, float pTicks) Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOpsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TEXTURE_LOCATION
-
CELL_SIZE_IN_BLOCKS
private static final float CELL_SIZE_IN_BLOCKS- See Also:
-
HEIGHT_IN_BLOCKS
private static final float HEIGHT_IN_BLOCKS- See Also:
-
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
-
vertexBuffer
-
indexCount
private int indexCount -
indices
-
-
Constructor Details
-
CloudRenderer
public CloudRenderer()
-
-
Method Details
-
prepare
protected Optional<CloudRenderer.TextureData> prepare(ResourceManager p_363181_, ProfilerFiller p_361418_) Description copied from class:SimplePreparableReloadListenerPerforms any reloading that can be done off-thread, such as file IO- Specified by:
preparein classSimplePreparableReloadListener<Optional<CloudRenderer.TextureData>>
-
apply
protected void apply(Optional<CloudRenderer.TextureData> p_362811_, ResourceManager p_364101_, ProfilerFiller p_360749_) - Specified by:
applyin 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) -
getColor
private static int getColor(long pCellData) -
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) -
draw
-
buildMesh
@Nullable private MeshData buildMesh(Tesselator pTesselator, int pCellX, int pCellY, CloudStatus pCloudStatus, CloudRenderer.RelativeCameraPos pRelativeCameraPos, RenderPipeline pPipeline) -
buildMesh
private void buildMesh(CloudRenderer.RelativeCameraPos pRelativeCameraPos, BufferBuilder pBufferBuilder, int pCellX, int pCellZ, int pBottomColor, int pTopColor, int pSideColor, int pFrontColor, boolean pFancyClouds) -
buildFlatCell
-
buildExtrudedCell
private void buildExtrudedCell(CloudRenderer.RelativeCameraPos pRelativeCameraPos, BufferBuilder pBufferBuilder, int pBottomColor, int pTopColor, int pSideColor, int pFrontColor, int pX, int pY, long pCellData) -
markForRebuild
public void markForRebuild() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-