Skip to content

Commit ec2acfa

Browse files
Merge remote-tracking branch 'origin/1.18.2-forge' into 1.19.4-forge
2 parents 083c428 + 374f7ff commit ec2acfa

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/java/cam72cam/mod/gui/screen/ScreenBuilder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ public boolean keyPressed(int typedChar, int keyCode, int mods) {
146146
return true;
147147
}
148148

149+
@Override
150+
public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_) {
151+
if (active != null) {
152+
return active.internal.charTyped(p_charTyped_1_, p_charTyped_2_);
153+
}
154+
return super.charTyped(p_charTyped_1_, p_charTyped_2_);
155+
}
156+
149157
@Override
150158
public boolean mouseClicked(double x, double y, int button) {
151159
Player.Hand hand = button == 0 ? Player.Hand.PRIMARY : Player.Hand.SECONDARY;

src/main/java/cam72cam/mod/gui/screen/TextField.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public class TextField implements IWidget{
1212
/** Standard constructor */
1313
public TextField(IScreenBuilder builder, int x, int y, int width, int height) {
1414
this(builder,
15-
new EditBox(Minecraft.getInstance().font, builder.getWidth() / 2 + x, builder.getHeight() / 4 + y, width, height,
15+
//Offset x&y by 1 and minus width&height by 2 to let border be within the range specified
16+
new EditBox(Minecraft.getInstance().font, builder.getWidth() / 2 + x + 1, builder.getHeight() / 4 + y + 1, width - 2, height - 2,
1617
Component.literal("")));
1718
}
1819

0 commit comments

Comments
 (0)