2021-12-10 00:27:56 +01:00
|
|
|
package com.jozufozu.flywheel.api;
|
2021-07-22 05:28:20 +02:00
|
|
|
|
2021-12-09 09:42:27 +01:00
|
|
|
import com.jozufozu.flywheel.backend.RenderLayer;
|
2021-07-22 05:28:20 +02:00
|
|
|
|
2021-12-06 10:47:52 +01:00
|
|
|
import net.minecraft.client.renderer.RenderType;
|
2021-09-15 08:45:29 +02:00
|
|
|
import net.minecraft.core.Vec3i;
|
2021-07-22 05:28:20 +02:00
|
|
|
|
2021-08-24 07:34:27 +02:00
|
|
|
public interface MaterialManager {
|
2021-07-22 05:28:20 +02:00
|
|
|
|
2021-07-28 02:31:58 +02:00
|
|
|
/**
|
|
|
|
* 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.
|
2021-12-08 06:19:06 +01:00
|
|
|
* @param state The {@link RenderType} you need to draw with.
|
2021-07-28 02:31:58 +02:00
|
|
|
* @return A material group whose children will
|
|
|
|
*/
|
2021-12-06 10:47:52 +01:00
|
|
|
MaterialGroup state(RenderLayer layer, RenderType state);
|
2021-08-24 07:34:27 +02:00
|
|
|
|
2021-09-15 08:45:29 +02:00
|
|
|
Vec3i getOriginCoordinate();
|
2021-07-28 02:31:58 +02:00
|
|
|
|
2021-12-06 10:47:52 +01:00
|
|
|
default MaterialGroup solid(RenderType state) {
|
2021-08-24 07:34:27 +02:00
|
|
|
return state(RenderLayer.SOLID, state);
|
2021-07-28 02:31:58 +02:00
|
|
|
}
|
|
|
|
|
2021-12-06 10:47:52 +01:00
|
|
|
default MaterialGroup cutout(RenderType state) {
|
2021-08-24 07:34:27 +02:00
|
|
|
return state(RenderLayer.CUTOUT, state);
|
2021-07-28 02:31:58 +02:00
|
|
|
}
|
|
|
|
|
2021-12-06 10:47:52 +01:00
|
|
|
default MaterialGroup transparent(RenderType state) {
|
2021-08-24 07:34:27 +02:00
|
|
|
return state(RenderLayer.TRANSPARENT, state);
|
2021-07-28 02:31:58 +02:00
|
|
|
}
|
|
|
|
|
2021-08-24 07:34:27 +02:00
|
|
|
default MaterialGroup defaultSolid() {
|
2021-12-06 10:47:52 +01:00
|
|
|
return solid(RenderType.solid());
|
2021-07-28 02:31:58 +02:00
|
|
|
}
|
|
|
|
|
2021-08-24 07:34:27 +02:00
|
|
|
default MaterialGroup defaultCutout() {
|
2021-12-06 10:47:52 +01:00
|
|
|
return cutout(RenderType.cutout());
|
2021-07-28 02:31:58 +02:00
|
|
|
}
|
|
|
|
|
2021-08-24 07:34:27 +02:00
|
|
|
default MaterialGroup defaultTransparent() {
|
2021-12-06 10:47:52 +01:00
|
|
|
return transparent(RenderType.translucent());
|
2021-07-28 02:31:58 +02:00
|
|
|
}
|
2021-07-22 05:28:20 +02:00
|
|
|
}
|