mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-30 01:13:38 +01:00
Fixed NoClassDefFound
This commit is contained in:
parent
27d5c93ba7
commit
a09c23ecf5
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user