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 relativeCameraPos, BufferBuilder bufferBuilder, int bottomColor, int topColor, int sideColor, int frontColor, int x, int y, long cellData) private voidbuildFlatCell(BufferBuilder bufferBuilder, int color, int x, int y) private MeshDatabuildMesh(Tesselator tesselator, int cellX, int cellY, CloudStatus cloudStatus, CloudRenderer.RelativeCameraPos relativeCameraPos, RenderPipeline pipeline) private voidbuildMesh(CloudRenderer.RelativeCameraPos relativeCameraPos, BufferBuilder bufferBuilder, int cellX, int cellZ, int bottomColor, int topColor, int sideColor, int frontColor, boolean fancyClouds) voidclose()private voiddraw(RenderPipeline pipeline, float x, float y, float z) private static intgetColor(long cellData) private static booleanisCellEmpty(int color) private static booleanisEastEmpty(long cellData) private static booleanisNorthEmpty(long cellData) private static booleanisSouthEmpty(long cellData) private static booleanisWestEmpty(long cellData) voidprivate static longpackCellData(int color, boolean northEmpty, boolean eastEmpty, boolean southEmpty, boolean westEmpty) 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 cloudColor, CloudStatus cloudStatus, float height, Vec3 cameraPosition, float ticks) 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 color) -
packCellData
private static long packCellData(int color, boolean northEmpty, boolean eastEmpty, boolean southEmpty, boolean westEmpty) -
getColor
private static int getColor(long cellData) -
isNorthEmpty
private static boolean isNorthEmpty(long cellData) -
isEastEmpty
private static boolean isEastEmpty(long cellData) -
isSouthEmpty
private static boolean isSouthEmpty(long cellData) -
isWestEmpty
private static boolean isWestEmpty(long cellData) -
render
public void render(int cloudColor, CloudStatus cloudStatus, float height, Vec3 cameraPosition, float ticks) -
draw
-
buildMesh
@Nullable private MeshData buildMesh(Tesselator tesselator, int cellX, int cellY, CloudStatus cloudStatus, CloudRenderer.RelativeCameraPos relativeCameraPos, RenderPipeline pipeline) -
buildMesh
private void buildMesh(CloudRenderer.RelativeCameraPos relativeCameraPos, BufferBuilder bufferBuilder, int cellX, int cellZ, int bottomColor, int topColor, int sideColor, int frontColor, boolean fancyClouds) -
buildFlatCell
-
buildExtrudedCell
private void buildExtrudedCell(CloudRenderer.RelativeCameraPos relativeCameraPos, BufferBuilder bufferBuilder, int bottomColor, int topColor, int sideColor, int frontColor, int x, int y, long cellData) -
markForRebuild
public void markForRebuild() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-