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; package net.Indyuce.mmocore.manager.data;
import io.lumine.mythic.lib.api.player.MMOPlayerData; import io.lumine.mythic.lib.api.player.MMOPlayerData;
import io.lumine.mythic.lib.comp.profile.ProfileDataModuleImpl;
import io.lumine.mythic.lib.data.SynchronizedDataManager; import io.lumine.mythic.lib.data.SynchronizedDataManager;
import net.Indyuce.mmocore.MMOCore; import net.Indyuce.mmocore.MMOCore;
import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.api.player.PlayerData;
@ -23,7 +22,7 @@ public class PlayerDataManager extends SynchronizedDataManager<PlayerData, Offli
} }
@Override @Override
public ProfileDataModuleImpl newProfileDataModule() { public Object newProfileDataModule() {
return new MMOCoreProfileDataModule(); 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.event.SynchronizedDataLoadEvent;
import io.lumine.mythic.lib.api.util.TemporaryListener; import io.lumine.mythic.lib.api.util.TemporaryListener;
@ -16,38 +16,31 @@ public class ForceChooseClassListener implements Listener {
if (event.getManager().getOwningPlugin().equals(MMOCore.plugin)) { if (event.getManager().getOwningPlugin().equals(MMOCore.plugin)) {
PlayerData playerData = PlayerData.get(event.getHolder().getProfileId()); PlayerData playerData = PlayerData.get(event.getHolder().getProfileId());
if (playerData.isProfessNull()) { if (playerData.isProfessNull()) {
// Open GUI
InventoryManager.CLASS_SELECT.newInventory(playerData).open(); InventoryManager.CLASS_SELECT.newInventory(playerData).open();
//Give 1 class point to make sure the player can choose a class.
playerData.setClassPoints(1); // Re-open GUI till the player
TemporaryListener closeGUIListener = new TemporaryListener(InventoryCloseEvent.getHandlerList()) { new TemporaryListener(PlayerChangeClassEvent.getHandlerList(), InventoryCloseEvent.getHandlerList()) {
@EventHandler @EventHandler
public void whenClosed(InventoryCloseEvent e) { public void whenClosed(InventoryCloseEvent event) {
if (e.getPlayer().equals(playerData.getPlayer())) if (event.getPlayer().equals(playerData.getPlayer()))
InventoryManager.CLASS_SELECT.newInventory(playerData).open(); InventoryManager.CLASS_SELECT.newInventory(playerData).open();
} }
@EventHandler
public void whenChoose(PlayerChangeClassEvent event) {
if (event.getPlayer().equals(playerData.getPlayer())) close();
}
@Override @Override
public void whenClosed() { 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() {
}
};
}
} }
} }

View File

@ -193,7 +193,7 @@ vanilla-exp-redirection:
# Requires a SERVER reload when changed. # Requires a SERVER reload when changed.
override-vanilla-exp: true 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 force-class-choose-on-first-login: false
# Check the target player's RPG profile when shift when shift right clicking. # Check the target player's RPG profile when shift when shift right clicking.