hello, i have this code which works but i want to make it render the texture item-like. how would i do that? for now it renders it as a block. thanks for the help :)
@Nullable
@Override
public BakedModel bake(Baker baker, Function<SpriteIdentifier, Sprite> textureGetter, ModelBakeSettings rotationContainer) {
// Get the sprites
for(int i = 0; i < SPRITE_IDS.length; ++i) {
sprites[i] = textureGetter.apply(SPRITE_IDS[i]);
}
// Build the mesh using the Renderer API
Renderer renderer = RendererAccess.INSTANCE.getRenderer();
MeshBuilder builder = renderer.meshBuilder();
QuadEmitter emitter = builder.getEmitter();
for(Direction direction : Direction.values()) {
// UP and DOWN share the Y axis
int spriteIdx = 0;
// Add a new face to the mesh
emitter.square(direction, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f);
// Set the sprite of the face, must be called after .square()
// We haven't specified any UV coordinates, so we want to use the whole texture. BAKE_LOCK_UV does exactly that.
emitter.spriteBake(sprites[spriteIdx], MutableQuadView.BAKE_LOCK_UV);
// Enable texture usage
emitter.color(-1, -1, -1, -1);
// Add the quad to the mesh
emitter.emit();
}
mesh = builder.build();
return this;
}```