Class DynamicBaseModel
java.lang.Object
org.cyclops.cyclopscore.client.model.DynamicBaseModel
- All Implemented Interfaces:
net.minecraft.client.resources.model.BakedModel
,net.minecraftforge.client.extensions.IForgeBakedModel
- 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
Modifier and TypeFieldDescriptionprotected static final int[]
protected static final float[][]
protected static final float[][]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
isGui3d()
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 aBakedQuad
.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.minecraftforge.client.extensions.IForgeBakedModel
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 aBakedQuad
.- Parameters:
x
- Xy
- Yz
- Zcolor
- Colortexture
- Textureu
- Icon Uv
- 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 Xx2
- End Xz1
- Start Zz2
- End Zy
- Ytexture
- The base textureside
- 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 Xx2
- End Xz1
- Start Zz2
- End Zy
- Ytexture
- The base textureshadeColor
- shade color for the texture in BGR formatside
- 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 Xx2
- End Xz1
- Start Zz2
- End Zy
- Ytexture
- The base textureshadeColor
- shade color for the textureside
- 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 Xx2
- End Xz1
- Start Zz2
- End Zy
- Ytexture
- The base textureshadeColor
- shade color for the texture in BGR formatside
- 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 Xx2
- End Xz1
- Start Zz2
- End Zy
- Ytexture
- The base textureside
- 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 Xx2
- End Xz1
- Start Zz2
- End Zy
- Ytexture
- The base textureside
- 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 coloruvs
- 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 interfacenet.minecraft.client.resources.model.BakedModel
-
isGui3d
public boolean isGui3d()- Specified by:
isGui3d
in interfacenet.minecraft.client.resources.model.BakedModel
-
useAmbientOcclusion
public boolean useAmbientOcclusion()- Specified by:
useAmbientOcclusion
in interfacenet.minecraft.client.resources.model.BakedModel
-
isCustomRenderer
public boolean isCustomRenderer()- Specified by:
isCustomRenderer
in interfacenet.minecraft.client.resources.model.BakedModel
-
getOverrides
public net.minecraft.client.renderer.block.model.ItemOverrides getOverrides()- Specified by:
getOverrides
in interfacenet.minecraft.client.resources.model.BakedModel
-