Fixed NoClassDefFound

This commit is contained in:
Jules 2023-05-08 11:43:01 +02:00
parent 27d5c93ba7
commit a09c23ecf5
3 changed files with 13 additions and 21 deletions

View File

@ -1,7 +1,6 @@
package net.Indyuce.mmocore.manager.data;
import io.lumine.mythic.lib.api.player.MMOPlayerData;
import io.lumine.mythic.lib.comp.profile.ProfileDataModuleImpl;
import io.lumine.mythic.lib.data.SynchronizedDataManager;
import net.Indyuce.mmocore.MMOCore;
import net.Indyuce.mmocore.api.player.PlayerData;
@ -23,7 +22,7 @@ public class PlayerDataManager extends SynchronizedDataManager<PlayerData, Offli
}
@Override
public ProfileDataModuleImpl newProfileDataModule() {
public Object newProfileDataModule() {
return new MMOCoreProfileDataModule();
}

View File

@ -1,4 +1,4 @@
package net.Indyuce.mmocore.listener;
package net.Indyuce.mmocore.listener.option;
import io.lumine.mythic.lib.api.event.SynchronizedDataLoadEvent;
import io.lumine.mythic.lib.api.util.TemporaryListener;
@ -16,38 +16,31 @@ public class ForceChooseClassListener implements Listener {
if (event.getManager().getOwningPlugin().equals(MMOCore.plugin)) {
PlayerData playerData = PlayerData.get(event.getHolder().getProfileId());
if (playerData.isProfessNull()) {
// Open GUI
InventoryManager.CLASS_SELECT.newInventory(playerData).open();
//Give 1 class point to make sure the player can choose a class.
playerData.setClassPoints(1);
TemporaryListener closeGUIListener = new TemporaryListener(InventoryCloseEvent.getHandlerList()) {
// Re-open GUI till the player
new TemporaryListener(PlayerChangeClassEvent.getHandlerList(), InventoryCloseEvent.getHandlerList()) {
@EventHandler
public void whenClosed(InventoryCloseEvent e) {
if (e.getPlayer().equals(playerData.getPlayer()))
public void whenClosed(InventoryCloseEvent event) {
if (event.getPlayer().equals(playerData.getPlayer()))
InventoryManager.CLASS_SELECT.newInventory(playerData).open();
}
@EventHandler
public void whenChoose(PlayerChangeClassEvent event) {
if (event.getPlayer().equals(playerData.getPlayer())) close();
}
@Override
public void whenClosed() {
}
};
new TemporaryListener(PlayerChangeClassEvent.getHandlerList()) {
@EventHandler
public void whenChoose(PlayerChangeClassEvent e) {
if (e.getPlayer().equals(playerData.getPlayer())) {
closeGUIListener.close();
close();
}
}
@Override
public void whenClosed() {
}
};
}
}
}