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
-
Field Summary
Modifier and TypeFieldDescriptionprivate final com.google.common.cache.LoadingCache<Long,
FluidModel.BakedFluid> Fields inherited from class net.minecraftforge.client.model.FluidModel.BakedFluid
color, faceQuads, flowing, gas, modelLocation, overlay, still, transformation, transforms
-
Constructor Summary
ConstructorDescriptionCachingBakedFluid
(TransformationMatrix transformation, com.google.common.collect.ImmutableMap<ItemCameraTransforms.TransformType, TransformationMatrix> transforms, ResourceLocation modelLocation, int color, TextureAtlasSprite still, TextureAtlasSprite flowing, Optional<TextureAtlasSprite> overlay, boolean gas, Optional<IModelData> stateOption) -
Method Summary
Modifier and TypeMethodDescriptionprivate static int[]
getCorners
(Optional<IModelData> stateOption) Gets the quantized fluid levels for each corner.private static int
getFlow
(Optional<IModelData> stateOption) Gets the quantized flow direction of the fluid.private static boolean[]
getOverlay
(Optional<IModelData> stateOption) Gets the overlay texture flag for each side.getQuads
(BlockState state, Direction side, 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 Details
-
modelCache
-
-
Constructor Details
-
CachingBakedFluid
public CachingBakedFluid(TransformationMatrix transformation, com.google.common.collect.ImmutableMap<ItemCameraTransforms.TransformType, TransformationMatrix> transforms, ResourceLocation modelLocation, int color, TextureAtlasSprite still, TextureAtlasSprite flowing, Optional<TextureAtlasSprite> overlay, boolean gas, Optional<IModelData> stateOption)
-
-
Method Details
-
getCorners
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
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
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 List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand, IModelData modelData)
-