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 intprivate static final intprivate final RenderSystem.AutoStorageIndexBufferprivate static final org.slf4j.Loggerprivate static final intprivate booleanprivate static final intprivate intprivate intprivate CloudRenderer.RelativeCameraPosprivate CloudStatusprivate intprivate static final intprivate CloudRenderer.TextureDataprivate static final ResourceLocationprivate final MappableRingBufferprivate static final intprivate MappableRingBufferprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(Optional<CloudRenderer.TextureData> object, ResourceManager resourceManager, ProfilerFiller profiler) private voidbuildExtrudedCell(CloudRenderer.RelativeCameraPos relativeCameraPos, ByteBuffer buffer, int cellX, int cellZ, long cellData) private voidbuildFlatCell(ByteBuffer buffer, int cellX, int cellZ) private voidbuildMesh(CloudRenderer.RelativeCameraPos relativeCameraPos, ByteBuffer buffer, int cellX, int cellZ, boolean fancyClouds, int size) voidclose()private voidencodeFace(ByteBuffer buffer, int cellX, int cellZ, Direction face, int offset) voidendFrame()private static intgetSizeForCloudDistance(int cloudDistance) 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 resourceManager, ProfilerFiller profiler) Performs any reloading that can be done off-thread, such as file IOvoidrender(int cloudColor, CloudStatus cloudStatus, float height, Vec3 cameraPosition, float ticks) private voidtryBuildCell(CloudRenderer.RelativeCameraPos relativeCameraPos, ByteBuffer buffer, int cellX, int cellZ, boolean fancyClouds, int x, int width, int z, int height, long[] cells) 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
-
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 resourceManager, ProfilerFiller profiler) Performs any reloading that can be done off-thread, such as file IO- Specified by:
preparein classSimplePreparableReloadListener<Optional<CloudRenderer.TextureData>>
-
getSizeForCloudDistance
private static int getSizeForCloudDistance(int cloudDistance) -
apply
protected void apply(Optional<CloudRenderer.TextureData> object, ResourceManager resourceManager, ProfilerFiller profiler) - 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) -
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) -
buildMesh
private void buildMesh(CloudRenderer.RelativeCameraPos relativeCameraPos, ByteBuffer buffer, int cellX, int cellZ, boolean fancyClouds, int size) -
tryBuildCell
private void tryBuildCell(CloudRenderer.RelativeCameraPos relativeCameraPos, ByteBuffer buffer, int cellX, int cellZ, boolean fancyClouds, int x, int width, int z, int height, long[] cells) -
buildFlatCell
-
encodeFace
-
buildExtrudedCell
private void buildExtrudedCell(CloudRenderer.RelativeCameraPos relativeCameraPos, ByteBuffer buffer, int cellX, int cellZ, long cellData) -
markForRebuild
public void markForRebuild() -
endFrame
public void endFrame() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-