Skip to content

Commit

Permalink
Add fabric transitive access wideners as a dependency instead of doin…
Browse files Browse the repository at this point in the history
…g our own
  • Loading branch information
Sollace committed Jun 6, 2024
1 parent b6ae15f commit bffd033
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
modApi fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version)
modApi fabricApi.module("fabric-key-binding-api-v1", project.fabric_version)
modApi fabricApi.module("fabric-rendering-v1", project.fabric_version)
modApi fabricApi.module("fabric-transitive-access-wideners-v1", project.fabric_version)
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,9 @@

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();
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/kirin.aw
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ extendable method net/minecraft/client/gui/tooltip/TooltipState
accessible field net/minecraft/client/gui/widget/ClickableWidget tooltip Lnet/minecraft/client/gui/tooltip/TooltipState;
mutable field net/minecraft/client/gui/widget/ClickableWidget tooltip Lnet/minecraft/client/gui/tooltip/TooltipState;

accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;ILnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;

accessible class net/minecraft/client/render/RenderPhase$TextureBase

accessible method net/minecraft/client/render/RenderLayer$MultiPhase getPhases ()Lnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;
Expand Down

0 comments on commit bffd033

Please sign in to comment.