Flywheel/src/main/java/com/jozufozu/flywheel/api/MaterialManager.java
Jozufozu ec92fef445 Material refactor pt 1
- 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
2022-04-10 17:02:28 -07:00

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());
}
}