55 TELEPORT_TO(
PlayerRight.getColor(MODERATOR) +
"Teleport To") {
59 Player other = player.managing.get();
62 player.instance = other.instance;
63 player.pvpInstance = other.pvpInstance;
67 TELEPORT_TO_ME(
PlayerRight.getColor(MODERATOR) +
"Teleport To Me") {
71 Player other = player.managing.get();
74 other.instance = player.instance;
75 other.pvpInstance = player.pvpInstance;
76 other.message(
"<col=FF0D5D>You have been force teleported to " + player.
getName() +
".");
80 MOVE_HOME(
PlayerRight.getColor(MODERATOR) +
"Move Home") {
84 Player other = player.managing.get();
87 other.instance =
Mob.DEFAULT_INSTANCE;
88 other.pvpInstance =
false;
89 other.message(
"<col=FF0D5D>You have been force teleported home by " + player.
getName() +
".");
97 Player other = player.managing.get();
99 confirm(player, () -> {
100 World.kickPlayer(other);
101 player.message(
"<col=FF0D5D>You have force kicked: " + other.
getName() +
".");
110 Player other = player.managing.get();
112 confirm(player, () -> {
115 factory.
onAction(() -> player.send(
new SendInputAmount(
"How long do you want this jail to last for?", 2, input -> {
116 other.punishment.
jail(Integer.parseInt(input), TimeUnit.DAYS);
119 },
"Jail by hour", () -> {
120 factory.
onAction(() -> player.send(
new SendInputAmount(
"How long do you want this jail to last for?", 3, input -> {
121 other.punishment.
jail(Integer.parseInt(input), TimeUnit.HOURS);
124 },
"Jail by minute", () -> {
125 factory.
onAction(() -> player.send(
new SendInputAmount(
"How long do you want this jail to last for?", 3, input -> {
126 other.punishment.
jail(Integer.parseInt(input), TimeUnit.MINUTES);
129 },
"Jail forever", () -> {
131 other.punishment.
jail(9999, TimeUnit.DAYS);
139 UNJAIL(
PlayerRight.getColor(MODERATOR) +
"Un-Jail") {
143 Player other = player.managing.get();
145 other.punishment.unJail();
147 other.message(
"<col=FF0D5D>You have been unjailed by: " + player.
getName());
148 player.message(
"<col=FF0D5D>You have unjailed: " + other.
getName());
156 Player other = player.managing.get();
158 confirm(player, () -> {
161 factory.
onAction(() -> player.send(
new SendInputAmount(
"How long do you want this mute to last for?", 2, input -> {
162 other.punishment.
mute(Integer.parseInt(input), TimeUnit.DAYS);
165 },
"Mute by hour", () -> {
166 factory.
onAction(() -> player.send(
new SendInputAmount(
"How long do you want this mute to last for?", 3, input -> {
167 other.punishment.
mute(Integer.parseInt(input), TimeUnit.HOURS);
170 },
"Mute by minute", () -> {
171 factory.
onAction(() -> player.send(
new SendInputAmount(
"How long do you want this mute to last for?", 3, input -> {
172 other.punishment.
mute(Integer.parseInt(input), TimeUnit.MINUTES);
175 },
"Mute forever", () -> {
177 other.punishment.
mute(9999, TimeUnit.DAYS);
185 UNMUTE(
PlayerRight.getColor(MODERATOR) +
"Un-Mute") {
189 Player other = player.managing.get();
191 other.punishment.unmute();
193 other.message(
"<col=FF0D5D>You have been unmuted by: " + player.
getName());
194 player.message(
"<col=FF0D5D>You have unmuted: " + other.
getName());
198 CHECK_BANK(
PlayerRight.getColor(MODERATOR) +
"Check Bank") {
202 Player other = player.managing.get();
204 long vaultCoins = other.bankVault.coinsContainer;
205 long vaultBM = other.bankVault.bloodMoneyContainer;
211 player.dialogueFactory.sendInformationBox(other.
getName() +
"'s Bank:",
"Bank Value: " + (totalValue),
"Bank Vault (Coins): " + (vaultCoins),
"Bank Vault (BM): " + (vaultBM)).
execute();
215 LINKED_ACCOUNTS(
PlayerRight.getColor(MODERATOR) +
"Linked Accounts") {
219 Player other = player.managing.get();
222 if (!list.isEmpty()) {
223 for (
int index = 0; index < 50; index++) {
224 String name = index >= list.size() ?
"" : list.get(index);
225 player.send(
new SendString(name, 37111 + index));
228 player.message(
"<col=FF0D5D>There are " + list.size() +
" accounts linked to " +
Utility.formatName(other.
getName()) +
".");
229 player.send(
new SendString(
"Profiles:\\n" + list.size(), 37107));
231 player.interfaceManager.
open(37100);
236 PROMOTE(
PlayerRight.getColor(ADMINISTRATOR) +
"Promote") {
240 Player other = player.managing.get();
242 player.dialogueFactory.
sendOption(
"Helper", () -> {
246 player.message(
"You have promoted " + other.
getName() +
" to helper.");
247 },
"Moderator", () -> {
251 player.message(
"You have promoted " + other.
getName() +
" to moderator.");
252 },
"Administrator", () -> {
256 player.message(
"You have promoted " + other.
getName() +
" to administrator.");
261 DEMOTE(
PlayerRight.getColor(ADMINISTRATOR) +
"Demote") {
265 Player other = player.managing.get();
270 player.message(
"You have demoted " + other.
getName() +
".");
274 COPY(
PlayerRight.getColor(ADMINISTRATOR) +
"Copy") {
278 Player other = player.managing.get();
280 player.playerAssistant.
copy(other);
281 player.updateFlags.add(
UpdateFlag.APPEARANCE);
282 player.message(
"<col=FF0D5D>You have copied " + other.
getName() +
".");
289 if (
PlayerRight.isOwner(player) && player.managing.isPresent()) {
290 Player other = player.managing.get();
292 other.playerAssistant.
copy(player);
294 player.message(
"<col=FF0D5D>You have X-copied " + other.
getName() +
".");
298 CLEAR(
PlayerRight.getColor(OWNER) +
"Clear Account") {
301 if (
PlayerRight.isOwner(player) && player.managing.isPresent()) {
302 Player other = player.managing.get();
304 confirm(player, () -> {
306 other.inventory.
clear();
309 other.skills.
setLevel(index, index == 3 ? 10 : 1);
310 other.skills.
setMaxLevel(index, index == 3 ? 10 : 1);
322 if (
PlayerRight.isOwner(player) && player.managing.isPresent()) {
323 Player other = player.managing.get();
326 int id = Integer.parseInt(input);
335 CHANGE_USERNAME(
PlayerRight.getColor(OWNER) +
"Change Username") {
338 if (
PlayerRight.isOwner(player) && player.managing.isPresent()) {
339 Player other = player.managing.get();
346 other.setUsername(input);
349 player.dialogueFactory.
sendStatement(
"You have successfully changed their username.").
execute();
356 public final String string;
358 PlayerManagement(String
string) {
359 this.string = string;
362 public static void confirm(
Player player, Runnable runnable) {
364 factory.
sendStatement(
"Are you sure you want to execute this action?");
365 factory.
sendOption(
"Confirm action", runnable,
"Nevermind", factory::clear);
369 public static PlayerManagement forOrdinal(
int ordinal) {
370 for (PlayerManagement management : values()) {
371 if (management.ordinal() == ordinal) {
final DialogueFactory sendOption(String option1, Runnable action1, String option2, Runnable action2)