mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 03:25:19 +01:00
Fabric fix compat with fake players
https://github.com/lucko/fabric-permissions-api/issues/3
This commit is contained in:
parent
82488140ee
commit
c533446ab0
@ -110,6 +110,10 @@ public abstract class ServerPlayerEntityMixin implements MixinUser {
|
|||||||
if (permission == null) {
|
if (permission == null) {
|
||||||
throw new NullPointerException("permission");
|
throw new NullPointerException("permission");
|
||||||
}
|
}
|
||||||
|
if (this.luckperms$user == null || this.luckperms$queryOptions == null) {
|
||||||
|
// "fake" players will have our mixin, but won't have been initialised.
|
||||||
|
return Tristate.UNDEFINED;
|
||||||
|
}
|
||||||
return hasPermission(permission, this.luckperms$queryOptions.getQueryOptions());
|
return hasPermission(permission, this.luckperms$queryOptions.getQueryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +127,9 @@ public abstract class ServerPlayerEntityMixin implements MixinUser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final User user = this.luckperms$user;
|
final User user = this.luckperms$user;
|
||||||
if (user == null) {
|
if (user == null || this.luckperms$queryOptions == null) {
|
||||||
throw new IllegalStateException("Permissions have not been initialised for this player yet.");
|
// "fake" players will have our mixin, but won't have been initialised.
|
||||||
|
return Tristate.UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PermissionCache data = user.getCachedData().getPermissionData(queryOptions);
|
PermissionCache data = user.getCachedData().getPermissionData(queryOptions);
|
||||||
|
Loading…
Reference in New Issue
Block a user