Class DynamicBaseModel

java.lang.Object
org.cyclops.cyclopscore.client.model.DynamicBaseModel
All Implemented Interfaces:
net.minecraft.client.resources.model.BakedModel, net.neoforged.neoforge.client.extensions.IBakedModelExtension
Direct Known Subclasses:
DynamicItemAndBlockModel

public abstract class DynamicBaseModel extends Object implements net.minecraft.client.resources.model.BakedModel
A model that can be used as a basis for flexible baked models.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int[]
     
    protected static final float[][]
     
    protected static final float[][]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static void
    addBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, int shadeColor, net.minecraft.core.Direction side)
    Add a given quad to a list of quads.
    protected static void
    addBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, net.minecraft.core.Direction side)
    Add a given quad to a list of quads.
    protected static void
    addBakedQuadRotated(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, net.minecraft.core.Direction side, int rotation)
    Add a given rotated quad to a list of quads.
    protected static void
    addBakedQuadRotated(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, net.minecraft.core.Direction side, int rotation, boolean isColored, int shadeColor, float[][] uvs)
    Add a given rotated quad to a list of quads.
    protected static void
    addColoredBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, int shadeColor, net.minecraft.core.Direction side)
    Add a given colored quad to a list of quads.
    protected static void
    addColoredBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, Color shadeColor, net.minecraft.core.Direction side)
    Add a given colored quad to a list of quads.
    net.minecraft.client.renderer.block.model.ItemOverrides
     
    List<net.minecraft.client.renderer.block.model.BakedQuad>
    getQuads(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction side, net.minecraft.util.RandomSource rand)
     
    boolean
     
    boolean
     
    protected static net.minecraft.world.phys.Vec3
    revRotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction side)
    Rotate a given vector inversely to the given side.
    protected static net.minecraft.world.phys.Vec3
    rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction side)
    Rotate a given vector to the given side.
    boolean
     
    protected static int[]
    vertexToInts(float x, float y, float z, int color, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, float u, float v)
    Make an int array of the given information so that it can be fed into a BakedQuad.

    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.resources.model.BakedModel

    getParticleIcon, getTransforms, usesBlockLight

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IBakedModelExtension

    applyTransform, getModelData, getParticleIcon, getQuads, getRenderPasses, getRenderTypes, getRenderTypes, useAmbientOcclusion, useAmbientOcclusion
  • Field Details

    • ROTATION_UV

      protected static final float[][] ROTATION_UV
    • ROTATION_FIX

      protected static final int[] ROTATION_FIX
    • UVS

      protected static final float[][] UVS
  • Constructor Details

    • DynamicBaseModel

      public DynamicBaseModel()
  • Method Details

    • rotate

      protected static net.minecraft.world.phys.Vec3 rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction side)
      Rotate a given vector to the given side.
      Parameters:
      vec - The vector to rotate.
      side - The side to rotate by.
      Returns:
      The rotated vector.
    • revRotate

      protected static net.minecraft.world.phys.Vec3 revRotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction side)
      Rotate a given vector inversely to the given side.
      Parameters:
      vec - The vector to rotate.
      side - The side to rotate by.
      Returns:
      The inversely rotated vector.
    • vertexToInts

      protected static int[] vertexToInts(float x, float y, float z, int color, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, float u, float v)
      Make an int array of the given information so that it can be fed into a BakedQuad.
      Parameters:
      x - X
      y - Y
      z - Z
      color - Color
      texture - Texture
      u - Icon U
      v - Icon V
      Returns:
      The assembled int array.
    • addBakedQuad

      protected static void addBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, net.minecraft.core.Direction side)
      Add a given quad to a list of quads.
      Parameters:
      quads - The quads to append to.
      x1 - Start X
      x2 - End X
      z1 - Start Z
      z2 - End Z
      y - Y
      texture - The base texture
      side - The side to add render quad at.
    • addBakedQuad

      protected static void addBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, int shadeColor, net.minecraft.core.Direction side)
      Add a given quad to a list of quads.
      Parameters:
      quads - The quads to append to.
      x1 - Start X
      x2 - End X
      z1 - Start Z
      z2 - End Z
      y - Y
      texture - The base texture
      shadeColor - shade color for the texture in BGR format
      side - The side to add render quad at.
    • addColoredBakedQuad

      protected static void addColoredBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, Color shadeColor, net.minecraft.core.Direction side)
      Add a given colored quad to a list of quads.
      Parameters:
      quads - The quads to append to.
      x1 - Start X
      x2 - End X
      z1 - Start Z
      z2 - End Z
      y - Y
      texture - The base texture
      shadeColor - shade color for the texture
      side - The side to add render quad at.
    • addColoredBakedQuad

      protected static void addColoredBakedQuad(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, int shadeColor, net.minecraft.core.Direction side)
      Add a given colored quad to a list of quads.
      Parameters:
      quads - The quads to append to.
      x1 - Start X
      x2 - End X
      z1 - Start Z
      z2 - End Z
      y - Y
      texture - The base texture
      shadeColor - shade color for the texture in BGR format
      side - The side to add render quad at.
    • addBakedQuadRotated

      protected static void addBakedQuadRotated(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, net.minecraft.core.Direction side, int rotation)
      Add a given rotated quad to a list of quads.
      Parameters:
      quads - The quads to append to.
      x1 - Start X
      x2 - End X
      z1 - Start Z
      z2 - End Z
      y - Y
      texture - The base texture
      side - The side to add render quad at.
      rotation - The rotation index to rotate by.
    • addBakedQuadRotated

      protected static void addBakedQuadRotated(List<net.minecraft.client.renderer.block.model.BakedQuad> quads, float x1, float x2, float z1, float z2, float y, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, net.minecraft.core.Direction side, int rotation, boolean isColored, int shadeColor, float[][] uvs)
      Add a given rotated quad to a list of quads.
      Parameters:
      quads - The quads to append to.
      x1 - Start X
      x2 - End X
      z1 - Start Z
      z2 - End Z
      y - Y
      texture - The base texture
      side - The side to add render quad at.
      rotation - The rotation index to rotate by.
      isColored - When set to true a colored baked quad will be made, otherwise a regular baked quad is used.
      shadeColor - The shade color
      uvs - A double array of 4 uv pairs
    • getQuads

      public List<net.minecraft.client.renderer.block.model.BakedQuad> getQuads(@Nullable net.minecraft.world.level.block.state.BlockState state, @Nullable net.minecraft.core.Direction side, net.minecraft.util.RandomSource rand)
      Specified by:
      getQuads in interface net.minecraft.client.resources.model.BakedModel
    • isGui3d

      public boolean isGui3d()
      Specified by:
      isGui3d in interface net.minecraft.client.resources.model.BakedModel
    • useAmbientOcclusion

      public boolean useAmbientOcclusion()
      Specified by:
      useAmbientOcclusion in interface net.minecraft.client.resources.model.BakedModel
    • isCustomRenderer

      public boolean isCustomRenderer()
      Specified by:
      isCustomRenderer in interface net.minecraft.client.resources.model.BakedModel
    • getOverrides

      public net.minecraft.client.renderer.block.model.ItemOverrides getOverrides()
      Specified by:
      getOverrides in interface net.minecraft.client.resources.model.BakedModel