Fixed a bug related to SubClassSelect GUI.

This commit is contained in:
Ka0rX 2023-05-07 16:26:37 +01:00
parent aa6a1d7101
commit a125320dd0

View File

@ -16,6 +16,7 @@ import net.Indyuce.mmocore.api.ConfigMessage;
import net.Indyuce.mmocore.api.SoundEvent; import net.Indyuce.mmocore.api.SoundEvent;
import net.Indyuce.mmocore.api.player.profess.Subclass; import net.Indyuce.mmocore.api.player.profess.Subclass;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@ -112,8 +113,8 @@ public class SubclassSelect extends EditableInventory {
InventoryManager.CLASS_SELECT.newInventory(playerData).open(); InventoryManager.CLASS_SELECT.newInventory(playerData).open();
if (item.getFunction().startsWith("sub-class")) { if (item.getFunction().startsWith("sub-class")) {
String classId = item.getFunction().substring(10); String classId = UtilityMethods.ymlName(item.getFunction().substring(10));
PlayerClass profess = MMOCore.plugin.classManager.get(classId); PlayerClass profess = MMOCore.plugin.classManager.get(UtilityMethods.enumName(classId));
if (playerData.getClassPoints() < 1) { if (playerData.getClassPoints() < 1) {
player.closeInventory(); player.closeInventory();
MMOCore.plugin.soundManager.getSound(SoundEvent.CANT_SELECT_CLASS).playTo(getPlayer()); MMOCore.plugin.soundManager.getSound(SoundEvent.CANT_SELECT_CLASS).playTo(getPlayer());