From 5a881fe694854d5365511a136542a2b0d484fe35 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 11 Dec 2024 22:21:17 +0100 Subject: [PATCH] Minor fixes to operator checks --- Obsidian.API/_Attributes/RequirePermissionAttribute.cs | 2 +- Obsidian/Entities/Player.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Obsidian.API/_Attributes/RequirePermissionAttribute.cs b/Obsidian.API/_Attributes/RequirePermissionAttribute.cs index 6a834fd24..45f6b87e3 100644 --- a/Obsidian.API/_Attributes/RequirePermissionAttribute.cs +++ b/Obsidian.API/_Attributes/RequirePermissionAttribute.cs @@ -23,7 +23,7 @@ public override Task RunChecksAsync(CommandContext context) return Task.FromResult(true); if (context.Player == null) return Task.FromResult(false); - if (_op && context.Player.IsOperator) + if(_op && context.Server.Operators.IsOperator(context.Player)) return Task.FromResult(true); if (_permissions.Length > 0) diff --git a/Obsidian/Entities/Player.cs b/Obsidian/Entities/Player.cs index 3094e676d..3cec67886 100644 --- a/Obsidian/Entities/Player.cs +++ b/Obsidian/Entities/Player.cs @@ -43,8 +43,7 @@ public sealed partial class Player : Living, IPlayer /// public ConcurrentHashSet LoadedChunks { get; internal set; } = []; - //TODO - public bool IsOperator { get; private set; } + public bool IsOperator => this.client.server.Operators.IsOperator(this); public string Username { get; }