mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-10 14:26:10 +01:00
ec92fef445
- User no longer needs to supply a key object to get an instancer - Move memoization logic outside of MaterialManager - Provide utility class for memoizing models - Vanilla instances use static objects for their models - PartialModels don't actually need reference states, use air instead - Move RenderLayer to api package - Kill lazy killable
42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
package com.jozufozu.flywheel.api;
|
|
|
|
import net.minecraft.client.renderer.RenderType;
|
|
import net.minecraft.core.Vec3i;
|
|
|
|
public interface MaterialManager {
|
|
|
|
/**
|
|
* Get a material group that will render in the given layer with the given state.
|
|
*
|
|
* @param layer The {@link RenderLayer} you want to draw in.
|
|
* @param type The {@link RenderType} you need to draw with.
|
|
* @return A material group whose children will
|
|
*/
|
|
MaterialGroup state(RenderLayer layer, RenderType type);
|
|
|
|
Vec3i getOriginCoordinate();
|
|
|
|
default MaterialGroup solid(RenderType state) {
|
|
return state(RenderLayer.SOLID, state);
|
|
}
|
|
|
|
default MaterialGroup cutout(RenderType state) {
|
|
return state(RenderLayer.CUTOUT, state);
|
|
}
|
|
|
|
default MaterialGroup transparent(RenderType state) {
|
|
return state(RenderLayer.TRANSPARENT, state);
|
|
}
|
|
|
|
default MaterialGroup defaultSolid() {
|
|
return solid(RenderType.solid());
|
|
}
|
|
|
|
default MaterialGroup defaultCutout() {
|
|
return cutout(RenderType.cutout());
|
|
}
|
|
|
|
default MaterialGroup defaultTransparent() {
|
|
return transparent(RenderType.translucent());
|
|
}
|
|
}
|