Skip to content

Commit

Permalink
Add cleardrops command
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Dec 7, 2023
1 parent 6879c21 commit f97f035
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections.Immutable;
using Edelstein.Protocol.Gameplay.Game.Objects;
using Edelstein.Protocol.Gameplay.Game.Objects.User;

namespace Edelstein.Plugin.Rue.Commands.Admin;

public class ClearDropsCommand : AbstractCommand
{
public override string Name => "ClearDrops";
public override string Description => "Clears all drops in the map";

public override async Task Execute(IFieldUser user, string[] args)
{
if (user.Field == null) return;
foreach (var drop in user.Field.GetPool(FieldObjectType.Drop)?.Objects ?? ImmutableArray<IFieldObject>.Empty)
await user.Field.Leave(drop);
}
}
4 changes: 0 additions & 4 deletions src/plugin/Edelstein.Plugin.Rue/Edelstein.Plugin.Rue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@
<PackageReference Include="TrieNet" Version="1.0.3.26316" />
</ItemGroup>

<ItemGroup>
<Folder Include="Commands\v2\" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/plugin/Edelstein.Plugin.Rue/RueGamePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ await commandManager.Insert(new QuestCommand(
await commandManager.Insert(new EquipCommand());
await commandManager.Insert(new StatCommand());
await commandManager.Insert(new TemporaryStatCommand());
await commandManager.Insert(new ClearDropsCommand());

await commandManager.Insert(new PluginCommand(host.Manager));
await commandManager.Insert(new DebugCommand());
Expand Down

0 comments on commit f97f035

Please sign in to comment.