Skip to content

Commit

Permalink
switch to using the method instead of the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jun 27, 2024
1 parent 9b25806 commit a85491c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class MatrixEnchantingPlusButton extends Button {

public MatrixEnchantingPlusButton(int x, int y, OnPress onPress) {
super(new Button.Builder(Component.literal(""), onPress).size(50, 12).pos(x, y));
super(Button.builder(Component.literal(""), onPress).size(50, 12).pos(x, y));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static void celebrate(String name, int day, int end, Month month, int ti
private boolean showBubble;

public QButton(int x, int y) {
super(new Button.Builder(Component.literal("q"), QButton::click).size(20, 20).pos(x, y));
super(Button.builder(Component.literal("q"), QButton::click).size(20, 20).pos(x, y));

Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH) + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class SocialButton extends Button {
private final int socialId;

public SocialButton(int x, int y, Component text, int textColor, int socialId, OnPress onClick) {
super(new Button.Builder(Component.literal(""), onClick).size(20, 20).pos(x, y));
super(Button.builder(Component.literal(""), onClick).size(20, 20).pos(x, y));
this.textColor = textColor;
this.socialId = socialId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected void init() {
for(Map.Entry<String, double[]> entry : params.presetMap.entrySet()) {
String name = entry.getKey();
double[] preset = entry.getValue();
addRenderableWidget(new Button.Builder(Component.literal(name), __ -> setFromArray(preset)).size(w - p, 20).pos(x + (w * i), y + 115).build());
addRenderableWidget(Button.builder(Component.literal(name), __ -> setFromArray(preset)).size(w - p, 20).pos(x + (w * i), y + 115).build());
i++;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public MiniInventoryButton(AbstractContainerScreen<?> parent, int spriteType, in
}

public MiniInventoryButton(AbstractContainerScreen<?> parent, int spriteType, int x, int y, Supplier<List<Component>> tooltip, OnPress onPress) {
super(new Button.Builder(Component.literal(""), onPress).size(10, 10).pos(parent.getGuiLeft() + x, parent.getGuiTop() + y));
super(Button.builder(Component.literal(""), onPress).size(10, 10).pos(parent.getGuiLeft() + x, parent.getGuiTop() + y));
this.parent = parent;
this.spriteType = spriteType;
this.tooltip = tooltip;
Expand Down

0 comments on commit a85491c

Please sign in to comment.