Closed sakura-ryoko closed 1 week ago
Sorry, never commented on this, but last time I looked, passing null as world will cause an NPE, because the world variable is used to get the server field in the command source.
Sorry, never commented on this, but last time I looked, passing null as world will cause an NPE, because the world variable is used to get the server field in the command source.
This is why I was hoping that Lucko would take your input before merging the PR. Let's just hope things don't break badly.
This will only cause problems if the api is used on a client side entity, which afaik luckperms (pretty much the main provider for the api) doesn't even support (see line 72 & 118).
This sadly doesn't seem to return accurate permission results, at least for fallback checking operator levels. It turns out that there's a ServerPlayerEntity.getCommandSource()
aswell as a Entity.getCommandSource(ServerWorld)
. The entity one (which is used here) always passes op level 0.
Not the "Prettiest" solution, but it works.