Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to 1.21.2 #20

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21
yarn_mappings=1.21+build.1
loader_version=0.15.11
minecraft_version=24w37a
yarn_mappings=24w37a+build.1
loader_version=0.16.5

# Mod Properties
mod_version=1.4.0
Expand All @@ -14,5 +14,5 @@ archives_base_name=ukulib

# Dependencies
toml4j_version=0.7.2
fabric_version=0.100.1+1.21
modmenu_version=11.0.0-beta.1
fabric_version=0.104.1+1.21.2
modmenu_version=12.0.0-alpha.1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.ElementListWidget;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.texture.NativeImageBackedTexture;
import net.minecraft.text.Text;
Expand Down Expand Up @@ -96,7 +97,7 @@ public void render(DrawContext drawContext, int index, int y, int x, int entryWi
button.setY(y);
button.render(drawContext, mouseX, mouseY, tickDelta);

drawContext.drawTexture(this.iconPath, button.getX() - ICON_SIZE - 5, y, 0, 0, ICON_SIZE, ICON_SIZE, ICON_SIZE, ICON_SIZE);
drawContext.drawTexture(RenderLayer::getGuiTextured, this.iconPath, button.getX() - ICON_SIZE - 5, y, 0, 0, ICON_SIZE, ICON_SIZE, ICON_SIZE, ICON_SIZE);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.gui.tab.TabManager;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.gui.widget.TabNavigationWidget;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.math.MathHelper;
import net.uku3lig.ukulib.config.ConfigManager;
import net.uku3lig.ukulib.config.option.CheckedOption;
Expand All @@ -16,8 +17,6 @@
import java.util.HashSet;
import java.util.Set;

import static net.minecraft.client.gui.screen.world.CreateWorldScreen.FOOTER_SEPARATOR_TEXTURE;

/**
* A config screen that utilizes a tabbed layout instead of a simple list of buttons.
*
Expand Down Expand Up @@ -88,6 +87,6 @@ protected Collection<ClickableWidget> getInvalidOptions() {
@Override
public void render(DrawContext drawContext, int mouseX, int mouseY, float delta) {
super.render(drawContext, mouseX, mouseY, delta);
drawContext.drawTexture(FOOTER_SEPARATOR_TEXTURE, 0, MathHelper.roundUpToMultiple(this.height - 36 - 2, 2), 0.0F, 0.0F, this.width, 2, 32, 2);
drawContext.drawTexture(RenderLayer::getGuiTextured, FOOTER_SEPARATOR_TEXTURE, 0, MathHelper.roundUpToMultiple(this.height - 36 - 2, 2), 0.0F, 0.0F, this.width, 2, 32, 2);
}
}
3 changes: 2 additions & 1 deletion src/main/java/net/uku3lig/ukulib/utils/IconButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Setter;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

Expand Down Expand Up @@ -122,7 +123,7 @@ public void renderWidget(DrawContext context, int mouseX, int mouseY, float delt
int ry = this.getY() + (this.height - this.iconHeight) / 2;

if (Ukutils.textureExists(this.texture)) {
context.drawTexture(this.texture, rx, ry, 0, this.u, this.v, this.iconWidth, this.iconHeight, this.textureWidth, this.textureHeight);
context.drawTexture(RenderLayer::getGuiTextured, this.texture, rx, ry, this.u, this.v, this.iconWidth, this.iconHeight, this.textureWidth, this.textureHeight);
}
}
}
Loading