mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +01:00
Fix some errors without Vault / PEX
This commit is contained in:
parent
2ee39cbba8
commit
e3aeebd07f
@ -531,7 +531,7 @@ public class PlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.getPermissionProvider() == null) {
|
||||
if (plugin.getPermissionProvider() == null || !plugin.getPermissionProvider().hasGroupSupport()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -575,28 +575,34 @@ public class PlayerListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void onPlayerLogin(PlayerLoginEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
MainConfig config = plugin.getMainConfig();
|
||||
|
||||
if (!config.isTutorialActivated()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (DGamePlayer.getByPlayer(player) != null) {
|
||||
return;
|
||||
}
|
||||
if (plugin.getPermissionProvider() == null) {
|
||||
|
||||
if (plugin.getPermissionProvider() == null || !plugin.getPermissionProvider().hasGroupSupport()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((config.getTutorialDungeon() == null || config.getTutorialStartGroup() == null || config.getTutorialEndGroup() == null)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (String group : plugin.getPermissionProvider().getPlayerGroups(player)) {
|
||||
if (!config.getTutorialStartGroup().equalsIgnoreCase(group)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (plugin.getGameWorlds().size() >= config.getMaxInstances()) {
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_FULL);
|
||||
event.setKickMessage(DMessages.ERROR_TOO_MANY_TUTORIALS.getMessage());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -405,7 +405,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
getData().logTimeLastPlayed(dGroup.getDungeon().getName());
|
||||
|
||||
// Tutorial Permissions
|
||||
if (gameWorld.isTutorial()) {
|
||||
if (gameWorld.isTutorial() && plugin.getPermissionProvider() != null && plugin.getPermissionProvider().hasGroupSupport()) {
|
||||
String endGroup = plugin.getMainConfig().getTutorialEndGroup();
|
||||
if (plugin.isGroupEnabled(endGroup)) {
|
||||
plugin.getPermissionProvider().playerAddGroup(getPlayer(), endGroup);
|
||||
|
Loading…
Reference in New Issue
Block a user