mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
fancynpcs: Send warning when adding player_command_as_op action
This commit is contained in:
@@ -1 +1 @@
|
||||
2.7.0.285
|
||||
2.7.0.286
|
||||
@@ -13,14 +13,13 @@ import org.incendo.cloud.annotations.Permission;
|
||||
import org.incendo.cloud.annotations.suggestion.Suggestions;
|
||||
import org.incendo.cloud.context.CommandContext;
|
||||
import org.incendo.cloud.context.CommandInput;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public enum ActionCMD {
|
||||
INSTANCE; // SINGLETON
|
||||
|
||||
@@ -49,6 +48,11 @@ public enum ActionCMD {
|
||||
.translate("npc_action_add_success")
|
||||
.replaceStripped("total", String.valueOf(npc.getData().getActions(trigger).size()))
|
||||
.send(sender);
|
||||
|
||||
if (actionType.getName().equalsIgnoreCase("player_command_as_op")) {
|
||||
translator.translate("npc_action_add_op_warning")
|
||||
.send(sender);
|
||||
}
|
||||
}
|
||||
|
||||
@Command("npc action <npc> <trigger> add_before <index> <actionType> [value]")
|
||||
@@ -77,6 +81,11 @@ public enum ActionCMD {
|
||||
.replaceStripped("number", String.valueOf(index))
|
||||
.replaceStripped("total", String.valueOf(npc.getData().getActions(trigger).size()))
|
||||
.send(sender);
|
||||
|
||||
if (actionType.getName().equalsIgnoreCase("player_command_as_op")) {
|
||||
translator.translate("npc_action_add_op_warning")
|
||||
.send(sender);
|
||||
}
|
||||
}
|
||||
|
||||
@Command("npc action <npc> <trigger> add_after <index> <actionType> [value]")
|
||||
@@ -105,6 +114,11 @@ public enum ActionCMD {
|
||||
.replaceStripped("number", String.valueOf(index))
|
||||
.replaceStripped("total", String.valueOf(npc.getData().getActions(trigger).size()))
|
||||
.send(sender);
|
||||
|
||||
if (actionType.getName().equalsIgnoreCase("player_command_as_op")) {
|
||||
translator.translate("npc_action_add_op_warning")
|
||||
.send(sender);
|
||||
}
|
||||
}
|
||||
|
||||
@Command("npc action <npc> <trigger> set <number> <actionType> [value]")
|
||||
@@ -140,6 +154,11 @@ public enum ActionCMD {
|
||||
.replaceStripped("number", String.valueOf(number))
|
||||
.replaceStripped("total", String.valueOf(npc.getData().getActions(trigger).size()))
|
||||
.send(sender);
|
||||
|
||||
if (actionType.getName().equalsIgnoreCase("player_command_as_op")) {
|
||||
translator.translate("npc_action_add_op_warning")
|
||||
.send(sender);
|
||||
}
|
||||
}
|
||||
|
||||
@Command("npc action <npc> <trigger> remove <number>")
|
||||
|
||||
@@ -189,6 +189,7 @@ messages:
|
||||
npc_action_add_success: "<dark_gray>› <gray>Action has been added. There are {warningColor}{total}<gray> actions in total."
|
||||
npc_action_add_before_success: "<dark_gray>› <gray>Action has been added before action {warningColor}{number}<gray>. There are {warningColor}{total}<gray> actions in total."
|
||||
npc_action_add_after_success: "<dark_gray>› <gray>Action has been added after action {warningColor}{number}<gray>. There are {warningColor}{total}<gray> actions in total."
|
||||
npc_action_add_op_warning: "<dark_gray>› {warningColor}FancyNpcs will give the player operator permissions for the duration of the command execution. This means that the player will have access to all commands and permissions during that time. This can be a security risk if not used carefully, so make sure to use this action only when necessary and with trusted players."
|
||||
npc_action_set_success: "<dark_gray>› <gray>Action trigger {warningColor}{number}<gray> has been updated. There are {warningColor}{total}<gray> actions in total."
|
||||
npc_action_set_failure: "<dark_gray>› {errorColor}Action trigger {warningColor}{number}{errorColor} does not exist."
|
||||
npc_action_move_up_success: "<dark_gray>› <gray>Action trigger {warningColor}{number}<gray> has been moved up."
|
||||
|
||||
Reference in New Issue
Block a user