Skip to content

Commit

Permalink
Respect when command sender does not want command feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
asanetargoss committed Mar 1, 2020
1 parent 4af705d commit 853474d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
throw new CommandException("metamorph.error.acquire", args[1]);
}

sender.addChatMessage(new TextComponentTranslation("metamorph.success.acquire", args[0], args[1]));

if (sender.sendCommandFeedback())
{
sender.addChatMessage(new TextComponentTranslation("metamorph.success.acquire", args[0], args[1]));
}
}

/**
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/mchorse/metamorph/commands/CommandMorph.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
if (args.length < 2)
{
MorphAPI.demorph(player);
sender.addChatMessage(new TextComponentTranslation("metamorph.success.demorph", args[0]));
if (sender.sendCommandFeedback())
{
sender.addChatMessage(new TextComponentTranslation("metamorph.success.demorph", args[0]));
}
}
else
{
Expand Down Expand Up @@ -106,7 +109,10 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
}

MorphAPI.morph(player, newMorph, true);
sender.addChatMessage(new TextComponentTranslation("metamorph.success.morph", args[0], args[1]));
if (sender.sendCommandFeedback())
{
sender.addChatMessage(new TextComponentTranslation("metamorph.success.morph", args[0], args[1]));
}
}
}

Expand Down

0 comments on commit 853474d

Please sign in to comment.