diff options
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/gui/controllers')
2 files changed, 3 insertions, 3 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java b/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java index f91fc41..0e62af4 100644 --- a/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java +++ b/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java @@ -174,7 +174,7 @@ public abstract class AbstractDropdownControllerElement<T, U> extends StringCont } public void renderDropdown(GuiGraphics graphics) { - if (matchingValues.size() == 0) return; + if (matchingValues.isEmpty()) return; // Limit the visible options to allow scrolling through the suggestion list int begin = Math.max(0, selectedIndex - MAX_SHOWN_NUMBER_OF_ITEMS / 2); int end = begin + MAX_SHOWN_NUMBER_OF_ITEMS; @@ -184,7 +184,7 @@ public abstract class AbstractDropdownControllerElement<T, U> extends StringCont } renderDropdownBackground(graphics, end - begin); - if (matchingValues.size() >= 1) { + if (!matchingValues.isEmpty()) { // Highlight the currently selected element graphics.setColor(0.0f, 0.0f, 0.0f, 0.5f); int x = getDimension().x(); diff --git a/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/ItemControllerElement.java b/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/ItemControllerElement.java index b0bf566..1617c41 100644 --- a/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/ItemControllerElement.java +++ b/common/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/ItemControllerElement.java @@ -56,7 +56,7 @@ public class ItemControllerElement extends AbstractDropdownControllerElement<Ite @Override public String getString(ResourceLocation identifier) { - return BuiltInRegistries.ITEM.get(identifier).toString(); + return identifier.toString(); } @Override |