code refactoring

This commit is contained in:
unurled 2024-03-19 21:16:53 +01:00
parent ffbdf2e367
commit bcb1fa2e56
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F
5 changed files with 45 additions and 28 deletions

View file

@ -42,7 +42,7 @@ public class EntityTypeCommand implements TabExecutor {
}
if (args.length < 3) {
EntityManager em = Manager.getInstance(EntityManager.class);
if (!em.getTypes().stream().map(SREntityType::getID).toList().contains(args[1])) {
if (!em.getTypes().stream().map(SREntityType::getId).toList().contains(args[1])) {
sender.sendMessage("Invalid entity type.");
return true;
}
@ -181,7 +181,7 @@ public class EntityTypeCommand implements TabExecutor {
}
if (args.length == 2) {
return Manager.getInstance(EntityManager.class).getTypes().stream()
.map(SREntityType::getID)
.map(SREntityType::getId)
.toList();
}
if (args.length == 3 && (args[0].equalsIgnoreCase("edit"))) {