mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
Minecraft is now Unobfuscated and requires Java 25 Lots of changes/code cleanup. See https://github.com/MinecraftForge/MinecraftForge-Experimental/tree/26.1-dev for non-squashed commits. Co-authored-by: Paint_Ninja <[email protected]>
43 lines
1.3 KiB
Diff
43 lines
1.3 KiB
Diff
--- a/net/minecraft/client/gui/components/Button.java
|
|
+++ b/net/minecraft/client/gui/components/Button.java
|
|
@@ -39,6 +_,12 @@
|
|
this.createNarration = createNarration;
|
|
}
|
|
|
|
+ // Forge (GH-9238)
|
|
+ protected Button(Builder builder) {
|
|
+ this(builder.x, builder.y, builder.width, builder.height, builder.message, builder.onPress, builder.createNarration);
|
|
+ this.setTooltip(builder.tooltip);
|
|
+ }
|
|
+
|
|
@Override
|
|
public void onPress(final InputWithModifiers input) {
|
|
this.onPress.onPress(this);
|
|
@@ -102,9 +_,12 @@
|
|
}
|
|
|
|
public Button build() {
|
|
- Button button = new Button.Plain(this.x, this.y, this.width, this.height, this.message, this.onPress, this.createNarration);
|
|
- button.setTooltip(this.tooltip);
|
|
- return button;
|
|
+ return build(Button.Plain::new);
|
|
+ }
|
|
+
|
|
+ // Forge (GH-9238)
|
|
+ public Button build(java.util.function.Function<Builder, Button> builder) {
|
|
+ return builder.apply(this);
|
|
}
|
|
}
|
|
|
|
@@ -130,6 +_,10 @@
|
|
final Button.CreateNarration createNarration
|
|
) {
|
|
super(x, y, width, height, message, onPress, createNarration);
|
|
+ }
|
|
+
|
|
+ protected Plain(Builder builder) {
|
|
+ super(builder);
|
|
}
|
|
|
|
@Override
|