Package net.minecraftforge.client.model
Class FluidModel.CachingBakedFluid
- java.lang.Object
-
- net.minecraftforge.client.model.FluidModel.BakedFluid
-
- net.minecraftforge.client.model.FluidModel.CachingBakedFluid
-
- All Implemented Interfaces:
IBakedModel
,IForgeBakedModel
- Enclosing class:
- FluidModel
private static final class FluidModel.CachingBakedFluid extends FluidModel.BakedFluid
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.cache.LoadingCache<java.lang.Long,FluidModel.BakedFluid>
modelCache
-
Fields inherited from class net.minecraftforge.client.model.FluidModel.BakedFluid
color, faceQuads, flowing, gas, modelLocation, overlay, still, transformation, transforms
-
-
Constructor Summary
Constructors Constructor Description CachingBakedFluid(TransformationMatrix transformation, com.google.common.collect.ImmutableMap<ItemCameraTransforms.TransformType,TransformationMatrix> transforms, ResourceLocation modelLocation, int color, TextureAtlasSprite still, TextureAtlasSprite flowing, java.util.Optional<TextureAtlasSprite> overlay, boolean gas, java.util.Optional<IModelData> stateOption)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int[]
getCorners(java.util.Optional<IModelData> stateOption)
Gets the quantized fluid levels for each corner.private static int
getFlow(java.util.Optional<IModelData> stateOption)
Gets the quantized flow direction of the fluid.private static boolean[]
getOverlay(java.util.Optional<IModelData> stateOption)
Gets the overlay texture flag for each side.java.util.List<BakedQuad>
getQuads(BlockState state, Direction side, java.util.Random rand, IModelData modelData)
-
Methods inherited from class net.minecraftforge.client.model.FluidModel.BakedFluid
doesHandlePerspectives, getOverrides, getParticleIcon, getQuads, handlePerspective, isCustomRenderer, isGui3d, useAmbientOcclusion, usesBlockLight
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraft.client.renderer.model.IBakedModel
getTransforms
-
Methods inherited from interface net.minecraftforge.client.extensions.IForgeBakedModel
getBakedModel, getLayerModels, getModelData, getParticleTexture, isAmbientOcclusion, isLayered
-
-
-
-
Field Detail
-
modelCache
private final com.google.common.cache.LoadingCache<java.lang.Long,FluidModel.BakedFluid> modelCache
-
-
Constructor Detail
-
CachingBakedFluid
public CachingBakedFluid(TransformationMatrix transformation, com.google.common.collect.ImmutableMap<ItemCameraTransforms.TransformType,TransformationMatrix> transforms, ResourceLocation modelLocation, int color, TextureAtlasSprite still, TextureAtlasSprite flowing, java.util.Optional<TextureAtlasSprite> overlay, boolean gas, java.util.Optional<IModelData> stateOption)
-
-
Method Detail
-
getCorners
private static int[] getCorners(java.util.Optional<IModelData> stateOption)
Gets the quantized fluid levels for each corner. Each value is packed into 10 bits of the model key, so max range is [0,1024). The value is currently stored/interpreted as the closest multiple of 1/864. The divisor is chosen here to allows likely flow values to be exactly representable while also providing good use of the available value range. (For fluids with default quanta, this evenly divides the per-block intervals of 1/9 by 96)
-
getFlow
private static int getFlow(java.util.Optional<IModelData> stateOption)
Gets the quantized flow direction of the fluid. This value comprises 11 bits of the model key, and is signed, so the max range is [-1024,1024). The value is currently stored as the angle rounded to the nearest degree. A value of -1000 is used to signify no flow.
-
getOverlay
private static boolean[] getOverlay(java.util.Optional<IModelData> stateOption)
Gets the overlay texture flag for each side. This value determines if the fluid "overlay" texture should be used for that side, instead of the normal "flowing" texture (if applicable for that fluid). The sides are stored here by their regular horizontal index.
-
getQuads
public java.util.List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, java.util.Random rand, IModelData modelData)
-
-