Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ publishing {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/MrCrayfish/Maven"
credentials {
username = githubCredentials['GITHUB_USERNAME']
password = githubCredentials['GITHUB_TOKEN']
username = System.getenv("GITHUB_USERNAME")//githubCredentials['GITHUB_USERNAME']
password = System.getenv("GITHUB_TOKEN")//githubCredentials['GITHUB_TOKEN']
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.mrcrayfish.configured.client.util.ScreenUtil;
import com.mrcrayfish.configured.util.ConfigHelper;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.AbstractSelectionList;
import net.minecraft.client.gui.components.EditBox;
import net.minecraft.client.gui.components.ObjectSelectionList;
Expand Down Expand Up @@ -116,16 +117,16 @@ private void constructEntries()
}

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTicks)
public void render(GuiGraphics poseStack, int mouseX, int mouseY, float partialTicks)
{
this.renderBackground(poseStack);
this.list.render(poseStack, mouseX, mouseY, partialTicks);
this.searchTextField.render(poseStack, mouseX, mouseY, partialTicks);
drawCenteredString(poseStack, this.font, this.title, this.width / 2, 7, 0xFFFFFF);
poseStack.drawCenteredString(this.font, this.title, this.width / 2, 7, 0xFFFFFF);
super.render(poseStack, mouseX, mouseY, partialTicks);
RenderSystem.setShaderTexture(0, ListMenuScreen.CONFIGURED_LOGO);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
blit(poseStack, 10, 13, 0, 0, 0, 23, 23, 32, 32);
poseStack.blit(ListMenuScreen.CONFIGURED_LOGO, 10, 13, 0, 0, 0, 23, 23, 32, 32);
if(ScreenUtil.isMouseWithin(10, 13, 23, 23, mouseX, mouseY))
{
this.setActiveTooltip(Component.translatable("configured.gui.info"));
Expand Down Expand Up @@ -211,10 +212,10 @@ public Component getFormattedLabel()
}

@Override
public void render(PoseStack poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
public void render(GuiGraphics poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
{
Component label = Component.literal(this.label.getString()).withStyle(ChangeEnumScreen.this.list.getSelected() == this ? ChatFormatting.YELLOW : ChatFormatting.WHITE);
Screen.drawString(poseStack, ChangeEnumScreen.this.minecraft.font, label, left + 5, top + 4, 0xFFFFFF);
poseStack.drawString(ChangeEnumScreen.this.minecraft.font, label, left + 5, top + 4, 0xFFFFFF);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.Tooltip;
import net.minecraft.client.gui.components.events.GuiEventListener;
Expand Down Expand Up @@ -289,13 +290,13 @@ private void updateButtons()
}

@Override
protected void renderForeground(PoseStack poseStack, int mouseX, int mouseY, float partialTicks)
protected void renderForeground(GuiGraphics poseStack, int mouseX, int mouseY, float partialTicks)
{
if(this.config.isReadOnly())
{
RenderSystem.setShaderTexture(0, IconButton.ICONS);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
blit(poseStack, this.width - 30, 14, 20, 20, 0, 33, 10, 10, 64, 64);
poseStack.blit(IconButton.ICONS, this.width - 30, 14, 20, 20, 0, 33, 10, 10, 64, 64);
if(ScreenUtil.isMouseWithin(this.width - 30, 14, 20, 20, mouseX, mouseY))
{
this.setActiveTooltip(Component.translatable("configured.gui.read_only_config"), 0xFF1E6566);
Expand Down Expand Up @@ -357,7 +358,7 @@ public List<? extends GuiEventListener> children()
}

@Override
public void render(PoseStack poseStack, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean selected, float partialTicks)
public void render(GuiGraphics poseStack, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean selected, float partialTicks)
{
super.render(poseStack, index, top, left, width, height, mouseX, mouseY, selected, partialTicks);
this.button.setX(left - 1);
Expand Down Expand Up @@ -412,18 +413,18 @@ public List<? extends GuiEventListener> children()
}

@Override
public void render(PoseStack poseStack, int x, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
public void render(GuiGraphics poseStack, int x, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
{
boolean showValidationHint = this.validationHint != null;
int trimLength = showValidationHint ? 100 : 80;
ChatFormatting labelStyle = this.holder.isChanged() ? Config.CLIENT.changedFormatting.get() : ChatFormatting.RESET;
Minecraft.getInstance().font.draw(poseStack, this.getTrimmedLabel(width - trimLength).withStyle(labelStyle), left, top + 6, 0xFFFFFF);
poseStack.drawString(Minecraft.getInstance().font, this.getTrimmedLabel(width - trimLength).withStyle(labelStyle), left, top + 6, 0xFFFFFF);

if(showValidationHint)
{
RenderSystem.setShaderTexture(0, IconButton.ICONS);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
blit(poseStack, left + width - 88, top + 3, 16, 16, 11, 11, 11, 11, 64, 64);
poseStack.blit(IconButton.ICONS, left + width - 88, top + 3, 16, 16, 11, 11, 11, 11, 64, 64);
}

if(!ConfigScreen.this.config.isReadOnly())
Expand All @@ -433,7 +434,7 @@ public void render(PoseStack poseStack, int x, int top, int left, int width, int
boolean gameRestart = this.holder.requiresGameRestart();
RenderSystem.setShaderTexture(0, IconButton.ICONS);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
blit(poseStack, left - 18, top + 5, 11, 11, gameRestart ? 51 : 11, 22, 11, 11, 64, 64);
poseStack.blit(IconButton.ICONS, left - 18, top + 5, 11, 11, gameRestart ? 51 : 11, 22, 11, 11, 64, 64);

if(ScreenUtil.isMouseWithin(left - 18, top + 5, 11, 11, mouseX, mouseY))
{
Expand Down Expand Up @@ -551,7 +552,7 @@ public NumberItem(IConfigValue<T> holder, Function<String, Number> parser)
}

@Override
public void render(PoseStack poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
public void render(GuiGraphics poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
{
super.render(poseStack, index, top, left, width, p_230432_6_, mouseX, mouseY, hovered, partialTicks);
long time = Util.getMillis();
Expand Down Expand Up @@ -613,7 +614,7 @@ public BooleanItem(IConfigValue<Boolean> holder)
}

@Override
public void render(PoseStack poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
public void render(GuiGraphics poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
{
super.render(poseStack, index, top, left, width, p_230432_6_, mouseX, mouseY, hovered, partialTicks);
this.button.setX(left + width - 69);
Expand Down Expand Up @@ -646,7 +647,7 @@ public StringItem(IConfigValue<String> holder)
}

@Override
public void render(PoseStack poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
public void render(GuiGraphics poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
{
super.render(poseStack, index, top, left, width, p_230432_6_, mouseX, mouseY, hovered, partialTicks);
this.button.setX(left + width - 69);
Expand All @@ -668,7 +669,7 @@ public ListItem(IConfigValue<List<?>> holder)
}

@Override
public void render(PoseStack poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
public void render(GuiGraphics poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
{
super.render(poseStack, index, top, left, width, p_230432_6_, mouseX, mouseY, hovered, partialTicks);
this.button.setX(left + width - 69);
Expand All @@ -693,7 +694,7 @@ public EnumItem(IConfigValue<Enum<?>> holder)
}

@Override
public void render(PoseStack poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
public void render(GuiGraphics poseStack, int index, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean hovered, float partialTicks)
{
super.render(poseStack, index, top, left, width, p_230432_6_, mouseX, mouseY, hovered, partialTicks);
this.button.setX(left + width - 69);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mrcrayfish.configured.client.screen.widget.IconButton;
import com.mrcrayfish.configured.client.util.ScreenUtil;
import net.minecraft.client.gui.GuiComponent;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.CommonComponents;
Expand Down Expand Up @@ -78,7 +77,7 @@ protected void init()
}

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTicks)
public void render(GuiGraphics poseStack, int mouseX, int mouseY, float partialTicks)
{
this.renderBackground(poseStack);
super.render(poseStack, mouseX, mouseY, partialTicks);
Expand All @@ -88,14 +87,14 @@ public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTic
RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
RenderSystem.setShaderTexture(0, IconButton.ICONS);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
Screen.blit(poseStack, this.width / 2 - 10, this.startY - 30, 20, 20, this.icon.u(), this.icon.v(), 10, 10, 64, 64);
poseStack.blit(IconButton.ICONS, this.width / 2 - 10, this.startY - 30, 20, 20, this.icon.u(), this.icon.v(), 10, 10, 64, 64);

drawListBackground(0.0, this.width, this.startY, this.endY);

for(int i = 0; i < lines.size(); i++)
{
int lineWidth = this.font.width(lines.get(i));
this.font.draw(poseStack, lines.get(i), this.width / 2 - lineWidth / 2, this.startY + MESSAGE_PADDING + i * (this.font.lineHeight + 2) + 1, 0xFFFFFF);
poseStack.drawString(this.font, lines.get(i), this.width / 2 - lineWidth / 2, this.startY + MESSAGE_PADDING + i * (this.font.lineHeight + 2) + 1, 0xFFFFFF);
}
}

Expand Down Expand Up @@ -167,7 +166,7 @@ public static void drawListBackground(double startX, double endX, double startY,
BufferBuilder buffer = tesselator.getBuilder();

RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
RenderSystem.setShaderTexture(0, GuiComponent.BACKGROUND_LOCATION);
RenderSystem.setShaderTexture(0, BACKGROUND_LOCATION);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);
buffer.vertex(startX, endY, 0.0).uv((float) startX / 32.0F, (float) endY / 32.0F).color(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS, 255).endVertex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.mrcrayfish.configured.client.screen.widget.IconButton;
import com.mrcrayfish.configured.client.util.ScreenUtil;
import com.mrcrayfish.configured.util.ConfigHelper;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
import net.minecraft.client.gui.components.Tooltip;
Expand Down Expand Up @@ -109,11 +110,11 @@ protected void init()
}

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTicks)
public void render(GuiGraphics poseStack, int mouseX, int mouseY, float partialTicks)
{
this.renderBackground(poseStack);
this.list.render(poseStack, mouseX, mouseY, partialTicks);
drawCenteredString(poseStack, this.font, this.title, this.width / 2, 14, 0xFFFFFF);
poseStack.drawCenteredString(this.font, this.title, this.width / 2, 14, 0xFFFFFF);
super.render(poseStack, mouseX, mouseY, partialTicks);
}

Expand Down Expand Up @@ -182,7 +183,7 @@ public boolean removeEntry(StringEntry entry)
}

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTicks)
public void render(GuiGraphics poseStack, int mouseX, int mouseY, float partialTicks)
{
super.render(poseStack, mouseX, mouseY, partialTicks);
this.children().forEach(entry ->
Expand Down Expand Up @@ -243,10 +244,10 @@ public StringEntry(ObjectList list, StringHolder holder)
}

@Override
public void render(PoseStack poseStack, int x, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean selected, float partialTicks)
public void render(GuiGraphics poseStack, int x, int top, int left, int width, int p_230432_6_, int mouseX, int mouseY, boolean selected, float partialTicks)
{
if(x % 2 != 0) Screen.fill(poseStack, left, top, left + width, top + 24, 0x55000000);
EditListScreen.this.minecraft.font.draw(poseStack, Component.literal(this.holder.getValue()), left + 5, top + 8, 0xFFFFFF);
if(x % 2 != 0) poseStack.fill(left, top, left + width, top + 24, 0x55000000);
poseStack.drawString(EditListScreen.this.minecraft.font, Component.literal(this.holder.getValue()), left + 5, top + 8, 0xFFFFFF);
this.editButton.visible = true;
this.editButton.setX(left + width - 44);
this.editButton.setY(top + 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.mrcrayfish.configured.api.IModConfig;
import com.mrcrayfish.configured.client.screen.widget.IconButton;
import com.mrcrayfish.configured.client.util.ScreenUtil;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.EditBox;
import net.minecraft.client.gui.screens.Screen;
Expand Down Expand Up @@ -82,21 +83,21 @@ protected void updateValidation()
}

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTicks)
public void render(GuiGraphics poseStack, int mouseX, int mouseY, float partialTicks)
{
this.resetTooltip();

this.renderBackground(poseStack);
ConfirmationScreen.drawListBackground(0.0, this.width, this.textField.getY() - 10, this.textField.getY() + 20 + 10);
this.textField.render(poseStack, mouseX, mouseY, partialTicks);
drawCenteredString(poseStack, this.font, this.title, this.width / 2, this.height / 2 - 50, 0xFFFFFF);
poseStack.drawCenteredString(this.font, this.title, this.width / 2, this.height / 2 - 50, 0xFFFFFF);

boolean showValidationHint = this.validationHint != null;
if(showValidationHint)
{
RenderSystem.setShaderTexture(0, IconButton.ICONS);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
Screen.blit(poseStack, this.textField.getX() - 20, this.textField.getY() + 3, 16, 16, 11, 11, 11, 11, 64, 64);
poseStack.blit(IconButton.ICONS, this.textField.getX() - 20, this.textField.getY() + 3, 16, 16, 11, 11, 11, 11, 64, 64);

if(ScreenUtil.isMouseWithin(this.textField.getX() - 20, this.textField.getY() + 3, 16, 16, mouseX, mouseY))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -32,14 +34,14 @@ public interface IColouredTooltip
@Nullable
Integer getTooltipBackgroundColour();

default boolean drawColouredTooltip(PoseStack poseStack, int mouseX, int mouseY, Screen screen)
default boolean drawColouredTooltip(GuiGraphics poseStack, int mouseX, int mouseY, Screen screen)
{
if(this.getTooltipText() != null)
{
boolean positioned = this.getTooltipX() != null && this.getTooltipY() != null;
int x = positioned ? this.getTooltipX() + 12 : mouseX;
int y = positioned ? this.getTooltipY() - 12 : mouseY;
screen.renderComponentTooltip(poseStack, DUMMY_TOOLTIP, x, y); // Yep, this is strange. See the forge events below!
poseStack.renderComponentTooltip(Minecraft.getInstance().font, DUMMY_TOOLTIP, x, y); // Yep, this is strange. See the forge events below!
return true;
}
return false;
Expand Down
Loading