Fix crash. Closes #3091

This commit is contained in:
modmuss50 2022-12-18 12:28:42 +00:00
parent ad81e8cc8c
commit 9faa008939
2 changed files with 4 additions and 18 deletions

View file

@ -34,11 +34,11 @@ public class GuiButtonExtended extends ButtonWidget {
private TriConsumer<GuiButtonExtended, Double, Double> clickHandler; private TriConsumer<GuiButtonExtended, Double, Double> clickHandler;
public GuiButtonExtended(int x, int y, Text buttonText, ButtonWidget.PressAction pressAction) { public GuiButtonExtended(int x, int y, Text buttonText, ButtonWidget.PressAction pressAction) {
super(x, y, 20, 200, buttonText, pressAction, narrationSupplier()); super(x, y, 20, 200, buttonText, pressAction, ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
} }
public GuiButtonExtended(int x, int y, int widthIn, int heightIn, Text buttonText, ButtonWidget.PressAction pressAction) { public GuiButtonExtended(int x, int y, int widthIn, int heightIn, Text buttonText, ButtonWidget.PressAction pressAction) {
super(x, y, widthIn, heightIn, buttonText, pressAction, narrationSupplier()); super(x, y, widthIn, heightIn, buttonText, pressAction, ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
} }
public GuiButtonExtended clickHandler(TriConsumer<GuiButtonExtended, Double, Double> consumer) { public GuiButtonExtended clickHandler(TriConsumer<GuiButtonExtended, Double, Double> consumer) {
@ -53,11 +53,4 @@ public class GuiButtonExtended extends ButtonWidget {
} }
super.onClick(mouseX, mouseY); super.onClick(mouseX, mouseY);
} }
private static NarrationSupplier narrationSupplier() {
return textSupplier -> {
// TODO 1.19.3
return null;
};
}
} }

View file

@ -34,7 +34,7 @@ public class GuiButtonSimple extends ButtonWidget {
*/ */
@Deprecated @Deprecated
public GuiButtonSimple(int x, int y, Text buttonText, ButtonWidget.PressAction pressAction) { public GuiButtonSimple(int x, int y, Text buttonText, ButtonWidget.PressAction pressAction) {
super(x, y, 20, 200, buttonText, pressAction, narrationSupplier()); super(x, y, 20, 200, buttonText, pressAction, ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
} }
/** /**
@ -42,13 +42,6 @@ public class GuiButtonSimple extends ButtonWidget {
*/ */
@Deprecated @Deprecated
public GuiButtonSimple(int x, int y, int widthIn, int heightIn, Text buttonText, ButtonWidget.PressAction pressAction) { public GuiButtonSimple(int x, int y, int widthIn, int heightIn, Text buttonText, ButtonWidget.PressAction pressAction) {
super(x, y, widthIn, heightIn, buttonText, pressAction, narrationSupplier()); super(x, y, widthIn, heightIn, buttonText, pressAction, ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
}
private static NarrationSupplier narrationSupplier() {
return textSupplier -> {
// TODO 1.19.3
return null;
};
} }
} }