Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SpGerg committed Apr 22, 2024
1 parent c153616 commit 2ff79ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions UncomplicatedCustomItems/API/Features/CustomItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ public CustomItem(Player player, ItemInfo itemInfo, SerializableCustomItem seria
/// </summary>
public void Execute()
{
Player.SendConsoleMessage(_itemInfo.Response, string.Empty);

if (_itemInfo.Commands is null)
{
return;
}

foreach (var command in _itemInfo.Commands)
{
if (command is not null && command != string.Empty)
{
Server.ExecuteCommand(command.Replace("%id%", Player.Id.ToString()), Player.Sender);
}
}

Player.SendConsoleMessage(_itemInfo.Response, string.Empty);
}
}
}

0 comments on commit 2ff79ee

Please sign in to comment.