Skip to content

Commit

Permalink
Fixed issue #72 (#152)
Browse files Browse the repository at this point in the history
* fixed issue #72
#72

* Issue #72
cancelt the running command if the provided text is empty
implemented changes to the InsertBeforeCMD.java

* Issue #72
removed command lines

---------

Co-authored-by: peaqe <[email protected]>
  • Loading branch information
devpeaqe and peaqe authored Nov 3, 2024
1 parent 029c783 commit 912014a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public boolean run(@NotNull CommandSender player, @Nullable Hologram hologram, @
for (int i = 4; i < args.length; i++) {
text += args[i] + " ";
}

if (text.isEmpty()) {
MessageHelper.error(player, "You need to provide a text to insert");
return true;
}

text = text.substring(0, text.length() - 1);

final var lines = new ArrayList<>(textData.getText());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public boolean run(@NotNull CommandSender player, @Nullable Hologram hologram, @
for (int i = 4; i < args.length; i++) {
text += args[i] + " ";
}

if (text.isEmpty()) {
MessageHelper.error(player, "You need to provide a text to insert");
return true;
}

text = text.substring(0, text.length() - 1);

final var lines = new ArrayList<>(textData.getText());
Expand Down

0 comments on commit 912014a

Please sign in to comment.