patch error on no entity in list

This commit is contained in:
unurled 2024-05-25 15:57:58 +02:00
parent 395749b312
commit 1febc27d67
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F

View file

@ -2,6 +2,7 @@ package me.unurled.sacredrealms.sr.commands.admin;
import static me.unurled.sacredrealms.sr.utils.Component.NOT_PLAYER;
import static me.unurled.sacredrealms.sr.utils.Component.comp;
import static me.unurled.sacredrealms.sr.utils.Component.textComp;
import java.util.Arrays;
import java.util.List;
@ -25,6 +26,12 @@ public class EntityTypeCommand implements TabExecutor {
sender.sendMessage(comp(NOT_PLAYER));
return true;
}
EntityManager em = Manager.getInstance(EntityManager.class);
if (em.getTypes().isEmpty()) {
sender.sendMessage(textComp("There are no entity types to display."));
return false;
}
Window window =
Window.single().setViewer(p).setTitle(args[1]).setGui(EntityTypeGUI.listGui()).build();
window.open();