fix warnings

This commit is contained in:
zznty
2023-11-12 14:51:56 +07:00
parent 989088cee8
commit aecc7ee66f
3 changed files with 7 additions and 11 deletions

View File

@@ -15,14 +15,10 @@ public static class IteratorExtensions
{
public bool MoveNext()
{
if (iterator.hasNext())
{
Current = iterator.next() is T ? (T)iterator.next() : default;
return true;
}
Current = default;
return false;
if (!iterator.hasNext()) return false;
Current = (T)iterator.next();
return true;
}
public void Reset()
@@ -32,7 +28,7 @@ public static class IteratorExtensions
object? IEnumerator.Current => Current;
public T? Current { get; private set; }
public T Current { get; private set; }
public void Dispose()
{

View File

@@ -1,6 +1,5 @@
using me.lucko.luckperms.common.command.utils;
using me.lucko.luckperms.common.plugin;
using me.lucko.luckperms.common.sender;
using Torch.API.Managers;
using Torch.Commands;
using Torch.Managers;
@@ -24,7 +23,7 @@ public class LpCommandManager(LuckPermsPlugin plugin, LpSenderFactory senderFact
foreach (var alias in Aliases)
{
_commandManager.Commands.AddCommand(new(alias, "LuckPerms commands", (ctx, _) => Execute(alias, ctx),
((LpTorchBootstrap)plugin.getBootstrap()).GetTorchPlugin(), MyPromoteLevel.None));
((LpTorchBootstrap)getPlugin().getBootstrap()).GetTorchPlugin(), MyPromoteLevel.None));
}
}

View File

@@ -8,6 +8,7 @@
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<NoWarn>CS9107</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">