mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 20:29:20 +00:00
33 lines
873 B
Java
33 lines
873 B
Java
|
package com.earth2me.essentials.commands;
|
||
|
|
||
|
import static com.earth2me.essentials.I18n.tl;
|
||
|
|
||
|
import com.earth2me.essentials.I18n;
|
||
|
import com.earth2me.essentials.User;
|
||
|
|
||
|
import org.bukkit.Server;
|
||
|
|
||
|
public class Commandpaytoggle extends EssentialsCommand {
|
||
|
|
||
|
public Commandpaytoggle() {
|
||
|
super("paytoggle");
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception {
|
||
|
boolean acceptingPay = !user.isAcceptingPay();
|
||
|
if (commandLabel.contains("payon")) {
|
||
|
acceptingPay = true;
|
||
|
} else if (commandLabel.contains("payoff")) {
|
||
|
acceptingPay = false;
|
||
|
}
|
||
|
user.setAcceptingPay(acceptingPay);
|
||
|
if (acceptingPay) {
|
||
|
user.sendMessage(tl("payToggleOn"));
|
||
|
} else {
|
||
|
user.sendMessage(tl("payToggleOff"));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|