Use GuiGraphics
This commit is contained in:
parent
c051cc54c2
commit
9573b280ad
6 changed files with 41 additions and 38 deletions
|
@ -2,7 +2,7 @@ package org.betterx.bclib.mixin.client;
|
|||
|
||||
import org.betterx.bclib.interfaces.AnvilScreenHandlerExtended;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
|
@ -31,6 +31,9 @@ public class AnvilScreenMixin extends ItemCombinerScreen<AnvilMenu> {
|
|||
@Shadow
|
||||
private EditBox name;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private static ResourceLocation ANVIL_LOCATION;
|
||||
private final List<AbstractWidget> be_buttons = Lists.newArrayList();
|
||||
|
||||
public AnvilScreenMixin(AnvilMenu handler, Inventory playerInventory, Component title, ResourceLocation texture) {
|
||||
|
@ -38,9 +41,9 @@ public class AnvilScreenMixin extends ItemCombinerScreen<AnvilMenu> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void renderErrorIcon(PoseStack poseStack, int i, int j) {
|
||||
public void renderErrorIcon(GuiGraphics guiGraphics, int i, int j) {
|
||||
if (this.bcl_hasRecipeError()) {
|
||||
blit(poseStack, i + 65, j + 46, this.imageWidth, 0, 28, 21);
|
||||
guiGraphics.blit(ANVIL_LOCATION, i + 65, j + 46, this.imageWidth, 0, 28, 21);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,9 +68,15 @@ public class AnvilScreenMixin extends ItemCombinerScreen<AnvilMenu> {
|
|||
}
|
||||
|
||||
@Inject(method = "renderFg", at = @At("TAIL"))
|
||||
protected void be_renderForeground(PoseStack matrices, int mouseX, int mouseY, float delta, CallbackInfo info) {
|
||||
protected void be_renderForeground(
|
||||
GuiGraphics guiGraphics,
|
||||
int mouseX,
|
||||
int mouseY,
|
||||
float delta,
|
||||
CallbackInfo info
|
||||
) {
|
||||
be_buttons.forEach(button -> {
|
||||
button.render(matrices, mouseX, mouseY, delta);
|
||||
button.render(guiGraphics, mouseX, mouseY, delta);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ package org.betterx.bclib.mixin.client;
|
|||
import org.betterx.bclib.blocks.BaseSignBlock;
|
||||
import org.betterx.bclib.client.render.BaseSignBlockEntityRenderer;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.screens.inventory.AbstractSignEditScreen;
|
||||
import net.minecraft.client.gui.screens.inventory.SignEditScreen;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
|
@ -37,12 +37,12 @@ public abstract class SignEditScreenMixin extends AbstractSignEditScreen {
|
|||
|
||||
|
||||
@Inject(method = "offsetSign", at = @At("TAIL"))
|
||||
private void bclib_offsetSign(PoseStack poseStack, BlockState blockState, CallbackInfo ci) {
|
||||
private void bclib_offsetSign(GuiGraphics guiGraphics, BlockState blockState, CallbackInfo ci) {
|
||||
bclib_isSign = blockState.getBlock() instanceof BaseSignBlock;
|
||||
if (bclib_isSign) {
|
||||
bclib_renderStick = blockState.getValue(BaseSignBlock.FLOOR);
|
||||
if (bclib_renderStick) {
|
||||
poseStack.translate(0.0, 0.3125, 0.0);
|
||||
guiGraphics.pose().translate(0.0, 0.3125, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue