-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/plugin/Edelstein.Plugin.Rue/Commands/Admin/ClearDropsCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters