From 0f1ced9744fe6ef8c7a1dab2819f9d291c7472fc Mon Sep 17 00:00:00 2001 From: Ka0rX Date: Mon, 29 May 2023 09:21:13 +0100 Subject: [PATCH] Fixed issue #841 related to SubclassSelect showing subclasses despite not having the required level. --- .../main/java/net/Indyuce/mmocore/gui/SubclassSelect.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java index 2e3a4edb..7943a6dc 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java @@ -93,7 +93,12 @@ public class SubclassSelect extends EditableInventory { @Override public boolean canDisplay(SubclassSelectionInventory inv) { - return inv.getPlayerData().getProfess().hasSubclass(playerClass); + return inv.getPlayerData() + .getProfess() + .getSubclasses() + .stream() + .anyMatch(subclass -> subclass.getLevel() <= inv.getPlayerData().getLevel() + && subclass.getProfess().getId().equals(playerClass.getId())); } }