Skip to content

Commit 83f1fc4

Browse files
committed
Bonus cleanup stuffs IntelliJ told me to do. Wow!
1 parent 6b6f61d commit 83f1fc4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/xyz/imcodist/quickmenu/ui/ActionEditorUI.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ protected void build(FlowLayout rootComponent) {
164164
customModelDataTextBox = Components.textBox(Sizing.fixed(75), customModelData);
165165
customModelDataTextBox.cursorStyle(CursorStyle.TEXT);
166166

167-
customModelDataTextBox.onChanged().subscribe((text) -> {
168-
updateCustomModelData(iconButton.itemIcon);
169-
});
167+
customModelDataTextBox.onChanged().subscribe((text) -> updateCustomModelData(iconButton.itemIcon));
170168

171169
customModelDataProperty.child(customModelDataTextBox);
172170

@@ -229,7 +227,7 @@ private void updateCustomModelData(ItemStack itemStack) {
229227

230228
try {
231229
ActionButtonData.CustomModelDataValues values = new ActionButtonData.CustomModelDataValues(text);
232-
if (!text.equals("")) {
230+
if (!text.isEmpty()) {
233231
itemStack.set(DataComponentTypes.CUSTOM_MODEL_DATA, values.getComponent());
234232
System.out.println(getCustomModelData(itemStack));
235233
} else {
@@ -395,11 +393,11 @@ public void updateKeybindButton() {
395393
if (!isMouse) {
396394
message = InputUtil.fromKeyCode(keybind.get(0), keybind.get(1)).getLocalizedText().getString();
397395
} else {
398-
message = switch (keybind.get(0)) {
396+
message = switch (keybind.getFirst()) {
399397
case 0 -> "Left Button";
400398
case 1 -> "Right Button";
401399
case 2 -> "Middle Button";
402-
default -> "Mouse " + keybind.get(0);
400+
default -> "Mouse " + keybind.getFirst();
403401
};
404402
}
405403
}
@@ -409,7 +407,7 @@ public void updateKeybindButton() {
409407
}
410408

411409
private void updateActionKeybindMessage(ButtonComponent button, KeybindActionData actionData) {
412-
if (!actionData.keybindTranslationKey.equals("")) {
410+
if (!actionData.keybindTranslationKey.isEmpty()) {
413411
String textString = Text.translatable(actionData.keybindTranslationKey).getString();
414412
int maxLength = 14;
415413

0 commit comments

Comments
 (0)