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 state
D - type of the delegate model state

public final class TransformCopyingModel<S,D> extends net.minecraft.client.model.Model<com.mojang.datafixers.util.Pair<S,D>>
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 Type
    Method
    Description
    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)
     
    void
    setupAnim(com.mojang.datafixers.util.Pair<S,D> state)
     

    Methods inherited from class net.minecraft.client.model.Model

    allParts, renderToBuffer, renderToBuffer, renderType, resetPose, root

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 copied
      delegate - the model that will be rendered with transforms copied from the source model
      setDelegateAngles - true if the Model.setupAnim(Object) method should be called for the delegate model after it is called for the source model
    • setupAnim

      public void setupAnim(com.mojang.datafixers.util.Pair<S,D> state)
      Overrides:
      setupAnim in class net.minecraft.client.model.Model<com.mojang.datafixers.util.Pair<S,D>>