1.21.1 port

This commit is contained in:
Oth3r 2024-11-25 13:16:24 -06:00
commit 77f59e7b6a
4 changed files with 6 additions and 9 deletions

View file

@ -4,7 +4,6 @@ import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
@ -30,7 +29,7 @@ public class TextureButtonWidget extends ButtonWidget {
super.renderWidget(context, mouseX, mouseY, delta);
int x = this.getX() + this.getWidth() / 2 - this.textureWidth / 2;
int y = this.getY() + this.getHeight() / 2 - this.textureHeight / 2;
context.drawGuiTexture(RenderLayer::getGuiTextured, this.texture, x, y, this.textureWidth, this.textureHeight);
context.drawGuiTexture(this.texture, x, y, this.textureWidth, this.textureHeight);
}
@Override