Skip to content

Commit 7a9c12b

Browse files
Hendrix-ShenMSDNicrosoft
authored andcommitted
chore: Make field final
1 parent 7611978 commit 7a9c12b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/main/java/cn/msdnicrosoft/commandbuttons/gui/CommandEditGUI.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717

1818
public class CommandEditGUI extends LightweightGuiDescription {
1919
private final BiConsumer<Text, CommandItemDestination> creator = this::defBtnBehavior;
20-
2120
private final WGridPanel root = new WGridPanel(5);
2221
private final CommandItem item;
2322
private final WTextField displayName = new WTextField().setSuggestion(Component.translatable("mgbuttons.gui.edit.name"));
2423
private final WTextField input = new WTextField().setSuggestion(Component.translatable("mgbuttons.gui.edit.type")).setMaxLength(Integer.MAX_VALUE);
2524
private final WButton addBtn = new WButton(Component.literal("+")).setOnClick(this::addBtnCallback);
2625

2726
private final CommandEditListPanel<Text, CommandItemDestination> raw;
28-
private boolean editMode;
27+
private final boolean editMode;
2928

3029
public CommandEditGUI(CommandItem item) {
3130
this(item, false);
@@ -96,7 +95,6 @@ private void defBtnBehavior(Text text, @NotNull CommandItemDestination commandIt
9695
public void saveData() {
9796
if (!this.editMode) {
9897
ConfigManager.add(item);
99-
this.editMode = true;
10098
}
10199
ConfigManager.save();
102100
}

0 commit comments

Comments
 (0)