-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/main/java/com/minelittlepony/common/util/render/RenderLayerUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.minelittlepony.common.util.render; | ||
|
||
import java.util.Optional; | ||
import net.minecraft.client.render.*; | ||
import net.minecraft.client.render.VertexFormat.DrawMode; | ||
import net.minecraft.util.Identifier; | ||
|
||
public interface RenderLayerUtil { | ||
static RenderLayer.MultiPhase layerOf( | ||
Identifier name, | ||
VertexFormat vertexFormat, | ||
DrawMode drawMode, | ||
int expectedBufferSize, | ||
RenderLayer.MultiPhaseParameters phases) { | ||
return RenderLayer.of(name.toString(), vertexFormat, drawMode, expectedBufferSize, phases); | ||
} | ||
|
||
static RenderLayer.MultiPhase layerOf( | ||
Identifier name, | ||
VertexFormat vertexFormat, | ||
DrawMode drawMode, | ||
int expectedBufferSize, | ||
boolean crumbling, | ||
boolean translucent, | ||
RenderLayer.MultiPhaseParameters phases | ||
) { | ||
return RenderLayer.of(name.toString(), vertexFormat, drawMode, expectedBufferSize, crumbling, translucent, phases); | ||
} | ||
|
||
static Optional<Identifier> getTexture(RenderLayer layer) { | ||
if (layer instanceof RenderLayer.MultiPhase multiphase) { | ||
return multiphase.getPhases().texture.getId(); | ||
} | ||
return Optional.empty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters