mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-26 18:33:04 +00:00
Add auto-op. Closes #8
This commit is contained in:
4 files changed
+36
-7
No files matched your search
@@ -47,14 +47,16 @@ public class BukkitUserManager extends UserManager {
|
||||
public void preUnload(User user) {
|
||||
if (user instanceof BukkitUser) {
|
||||
BukkitUser u = (BukkitUser) user;
|
||||
|
||||
if (u.getAttachment() != null) {
|
||||
Player player = plugin.getServer().getPlayer(plugin.getUuidCache().getExternalUUID(u.getUuid()));
|
||||
|
||||
if (player != null) {
|
||||
Player player = plugin.getServer().getPlayer(plugin.getUuidCache().getExternalUUID(u.getUuid()));
|
||||
if (player != null) {
|
||||
if (u.getAttachment() != null) {
|
||||
player.removeAttachment(u.getAttachment().getAttachment());
|
||||
u.setAttachment(null);
|
||||
}
|
||||
|
||||
if (plugin.getConfiguration().getAutoOp()) {
|
||||
player.setOp(false);
|
||||
}
|
||||
u.setAttachment(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user