Class DynamicBaseModel
java.lang.Object
org.cyclops.cyclopscore.client.model.DynamicBaseModel
- Direct Known Subclasses:
DynamicItemAndBlockModel
A model that can be used as a basis for flexible baked models.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int[]
protected static final float[][]
protected static final float[][]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DynamicBaseModel
(List<net.minecraft.client.renderer.block.model.BakedQuad> quads) -
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.List
<net.minecraft.client.renderer.block.model.BakedQuad> getBlockStateQuads
(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction side, net.minecraft.util.RandomSource rand, net.neoforged.neoforge.model.data.ModelData extraData, net.minecraft.client.renderer.RenderType renderType) 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.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
.
-
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
-
-
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
-
getBlockStateQuads
public List<net.minecraft.client.renderer.block.model.BakedQuad> getBlockStateQuads(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction side, net.minecraft.util.RandomSource rand, net.neoforged.neoforge.model.data.ModelData extraData, net.minecraft.client.renderer.RenderType renderType)
-