Skip to content

Commit

Permalink
Use StringTextComponent#EMPTY where appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeronica committed Mar 24, 2024
1 parent c396eb1 commit 153084e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@SuppressWarnings("unused")
public class GuiGroupButton extends MXButton
{
static final ITextComponent EMPTY = new StringTextComponent("");
static final ITextComponent EMPTY = StringTextComponent.EMPTY;
private boolean jamEnabled;

public GuiGroupButton(IPressable pOnPress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class GuiHelpButton extends MXButton
{
static final ITextComponent EMPTY = new StringTextComponent("");
static final ITextComponent EMPTY = StringTextComponent.EMPTY;
private boolean helpEnabled;

public GuiHelpButton(IPressable pOnPress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class GuiOverlayButton extends MXButton
{
static final ITextComponent EMPTY = new StringTextComponent("");
static final ITextComponent EMPTY = StringTextComponent.EMPTY;
private boolean buttonEnabled;

public GuiOverlayButton(IPressable pOnPress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class GuiRedstoneButton extends MXButton
{
static final ITextComponent EMPTY = new StringTextComponent("");
static final ITextComponent EMPTY = StringTextComponent.EMPTY;
private boolean signalEnabled;
private final ArrowFaces direction;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/aeronicamc/mods/mxtune/gui/widget/MXLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class MXLabel extends AbstractGui implements IRenderable, ILayout
private int x;
private int y;
private ITextComponent labelName;
private ITextComponent labelText = new StringTextComponent("");
private ITextComponent labelText = StringTextComponent.EMPTY;
private boolean centered;
private boolean visible = true;
private boolean background = false;
Expand All @@ -33,7 +33,7 @@ public class MXLabel extends AbstractGui implements IRenderable, ILayout

public MXLabel()
{
this(Minecraft.getInstance().font, 0, 0, 0, 0, new StringTextComponent(""), TextColorFg.WHITE | MathHelper.ceil(255.0F) << 24);
this(Minecraft.getInstance().font, 0, 0, 0, 0, StringTextComponent.EMPTY, TextColorFg.WHITE | MathHelper.ceil(255.0F) << 24);
}

public MXLabel (FontRenderer pFontRenderer, int pX, int pY, int pWidth, int pHeight, ITextComponent pLabelText, int pTextColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MXTextFieldWidget extends TextFieldWidget implements ILayout

public MXTextFieldWidget(int pMaxLength)
{
super(Minecraft.getInstance().font, 0, 0, 0, 0, new StringTextComponent(""));
super(Minecraft.getInstance().font, 0, 0, 0, 0, StringTextComponent.EMPTY);
this.setMaxLength(pMaxLength);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public ITextComponent getName()
{
if ((blockEntity != null) && (blockEntity.getLevel() != null) && blockEntity.getLevel().isClientSide)
return ((MusicBlockEntity) blockEntity).getName();
return new StringTextComponent("");
return StringTextComponent.EMPTY;
}

@Override
Expand Down

0 comments on commit 153084e

Please sign in to comment.