This repository was archived by the owner on Jun 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
cloudnet-api/cloudnet-api-bridge/src/main/java/de/dytanic/cloudnet/bridge/internal/listener/bukkit Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 11
11
import de .dytanic .cloudnet .bridge .internal .util .ReflectionUtil ;
12
12
import de .dytanic .cloudnet .lib .player .CloudPlayer ;
13
13
import de .dytanic .cloudnet .lib .player .permission .GroupEntityData ;
14
+ import de .dytanic .cloudnet .lib .player .permission .PermissionGroup ;
14
15
import de .dytanic .cloudnet .lib .server .ServerConfig ;
15
16
import de .dytanic .cloudnet .lib .server .ServerGroupMode ;
16
17
import de .dytanic .cloudnet .lib .utility .document .Document ;
@@ -124,14 +125,26 @@ public void handleFirst(PlayerLoginEvent event)
124
125
{
125
126
CloudPlayer cloudPlayer = CloudServer .getInstance ().getCloudPlayers ().get (event .getPlayer ().getUniqueId ());
126
127
int joinPower = CloudAPI .getInstance ().getServerGroupData (CloudAPI .getInstance ().getGroup ()).getJoinPower ();
128
+
127
129
boolean acceptLogin = false ;
128
- for (GroupEntityData entityData : cloudPlayer .getPermissionEntity ().getGroups ())
130
+
131
+ if (CloudAPI .getInstance ().getPermissionPool () != null )
129
132
{
130
- if (CloudAPI .getInstance ().getPermissionGroup (entityData .getGroup ()).getJoinPower () >= joinPower )
131
- acceptLogin = true ;
133
+ for (GroupEntityData entityData : cloudPlayer .getPermissionEntity ().getGroups ())
134
+ {
135
+ PermissionGroup permissionGroup = CloudAPI .getInstance ().getPermissionGroup (entityData .getGroup ());
132
136
133
- if (event .getPlayer ().hasPermission ("cloudnet.joinpower." + CloudAPI .getInstance ().getPermissionGroup (entityData .getGroup ()).getJoinPower ()))
134
- acceptLogin = true ;
137
+ if (permissionGroup != null )
138
+ {
139
+ if (permissionGroup .getJoinPower () >= joinPower )
140
+ acceptLogin = true ;
141
+ }
142
+ }
143
+ }
144
+
145
+ if (event .getPlayer ().hasPermission ("cloudnet.joinpower." + joinPower ))
146
+ {
147
+ acceptLogin = true ;
135
148
}
136
149
137
150
if (!acceptLogin )
You can’t perform that action at this time.
0 commit comments