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,30 +16,22 @@ 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();
}
@Override
public void whenClosed() {
}
};
new TemporaryListener(PlayerChangeClassEvent.getHandlerList()) {
@EventHandler
public void whenChoose(PlayerChangeClassEvent e) {
if (e.getPlayer().equals(playerData.getPlayer())) {
closeGUIListener.close();
close();
}
public void whenChoose(PlayerChangeClassEvent event) {
if (event.getPlayer().equals(playerData.getPlayer())) close();
}
@Override
@ -47,6 +39,7 @@ public class ForceChooseClassListener implements Listener {
}
};
}
}
}

View File

@ -193,7 +193,7 @@ vanilla-exp-redirection:
# Requires a SERVER reload when changed.
override-vanilla-exp: true
#Forces the player to choose a class at first join.
# Forces the player to choose a class at first join.
force-class-choose-on-first-login: false
# Check the target player's RPG profile when shift when shift right clicking.