Class TransformCopyingModel<S,D>
java.lang.Object
net.minecraft.client.model.Model<com.mojang.datafixers.util.Pair<S,D>>
net.fabricmc.fabric.api.client.rendering.v1.TransformCopyingModel<S,D>
- Type Parameters:
S- type of the source model stateD- type of the delegate model state
- All Implemented Interfaces:
FabricModel<com.mojang.datafixers.util.Pair<S,D>>, net.fabricmc.fabric.impl.client.rendering.ModelExtensions
public final class TransformCopyingModel<S,D>
extends net.minecraft.client.model.Model<com.mojang.datafixers.util.Pair<S,D>>
implements net.fabricmc.fabric.impl.client.rendering.ModelExtensions
A model that copies transforms from a source model to a delegate model.
Useful in cases where an overlay model may not be a subclass of its base model.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.model.Model
net.minecraft.client.model.Model.Simple -
Field Summary
Fields inherited from class net.minecraft.client.model.Model
renderType, root -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyTransforms(net.minecraft.client.model.Model<?> model) Copies transforms of child model parts of the model to child model parts of this model whose names match.static <S,D> TransformCopyingModel <S, D> create(net.minecraft.client.model.Model<? super S> source, net.minecraft.client.model.Model<? super D> delegate, boolean setDelegateAngles) voidfabric$calculateChildParts(net.minecraft.client.model.geom.ModelPart root) @Nullable net.minecraft.client.model.geom.ModelPartgetChildPart(String name) Returns a child model part of the given name, ornullif one is not found.voidMethods inherited from class net.minecraft.client.model.Model
allParts, renderToBuffer, renderToBuffer, renderType, renderType, resetPose, root
-
Method Details
-
create
public static <S,D> TransformCopyingModel<S,D> create(net.minecraft.client.model.Model<? super S> source, net.minecraft.client.model.Model<? super D> delegate, boolean setDelegateAngles) - Parameters:
source- the model whose transforms will be copieddelegate- the model that will be rendered with transforms copied from the source modelsetDelegateAngles-trueif theModel.setupAnim(Object)method should be called for the delegate model after it is called for the source model
-
setupAnim
-
fabric$calculateChildParts
public void fabric$calculateChildParts(net.minecraft.client.model.geom.ModelPart root) - Specified by:
fabric$calculateChildPartsin interfacenet.fabricmc.fabric.impl.client.rendering.ModelExtensions
-
getChildPart
Description copied from interface:FabricModelReturns a child model part of the given name, ornullif one is not found.- Specified by:
getChildPartin interfaceFabricModel<S>- Parameters:
name- the name of the child model part- Returns:
- the child model part that corresponds to the name parameter, or
nullif it is not found.
-
copyTransforms
public void copyTransforms(net.minecraft.client.model.Model<?> model) Description copied from interface:FabricModelCopies transforms of child model parts of the model to child model parts of this model whose names match.- Specified by:
copyTransformsin interfaceFabricModel<S>- Parameters:
model- the model to copy transforms from
-