-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #317
- Loading branch information
Showing
8 changed files
with
72 additions
and
54 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
src/api/java/mcp/mobius/waila/api/__internal__/IClientApiService.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,25 @@ | ||
package mcp.mobius.waila.api.__internal__; | ||
|
||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import mcp.mobius.waila.api.ITooltipComponent; | ||
import net.minecraft.client.DeltaTracker; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import org.jetbrains.annotations.ApiStatus; | ||
import org.joml.Matrix4f; | ||
|
||
/** @hidden */ | ||
@ApiStatus.Internal | ||
public interface IClientApiService { | ||
|
||
IClientApiService INSTANCE = Internals.loadService(IClientApiService.class); | ||
|
||
MultiBufferSource getBufferSource(GuiGraphics ctx); | ||
|
||
void renderComponent(GuiGraphics ctx, ITooltipComponent component, int x, int y, DeltaTracker delta); | ||
|
||
void fillGradient(Matrix4f matrix, VertexConsumer buf, int x, int y, int w, int h, int start, int end); | ||
|
||
void renderRectBorder(Matrix4f matrix, VertexConsumer buf, int x, int y, int w, int h, int s, int gradStart, int gradEnd); | ||
|
||
} |
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
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
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
35 changes: 35 additions & 0 deletions
35
src/main/java/mcp/mobius/waila/service/ClientApiService.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,35 @@ | ||
package mcp.mobius.waila.service; | ||
|
||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import mcp.mobius.waila.api.ITooltipComponent; | ||
import mcp.mobius.waila.api.__internal__.IClientApiService; | ||
import mcp.mobius.waila.mixin.GuiGraphicsAccess; | ||
import mcp.mobius.waila.util.DisplayUtil; | ||
import net.minecraft.client.DeltaTracker; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import org.joml.Matrix4f; | ||
|
||
public class ClientApiService implements IClientApiService { | ||
|
||
@Override | ||
public void renderComponent(GuiGraphics ctx, ITooltipComponent component, int x, int y, DeltaTracker delta) { | ||
DisplayUtil.renderComponent(ctx, component, x, y, 0, delta); | ||
} | ||
|
||
@Override | ||
public void fillGradient(Matrix4f matrix, VertexConsumer buf, int x, int y, int w, int h, int start, int end) { | ||
DisplayUtil.fillGradient(matrix, buf, x, y, w, h, start, end); | ||
} | ||
|
||
@Override | ||
public void renderRectBorder(Matrix4f matrix, VertexConsumer buf, int x, int y, int w, int h, int s, int gradStart, int gradEnd) { | ||
DisplayUtil.renderRectBorder(matrix, buf, x, y, w, h, s, gradStart, gradEnd); | ||
} | ||
|
||
@Override | ||
public MultiBufferSource getBufferSource(GuiGraphics ctx) { | ||
return ((GuiGraphicsAccess) ctx).wthit_bufferSource(); | ||
} | ||
|
||
} |
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
1 change: 1 addition & 0 deletions
1
...resources/resources/META-INF/services/mcp.mobius.waila.api.__internal__.IClientApiService
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 @@ | ||
mcp.mobius.waila.service.ClientApiService |