use of com.earth2me.essentials.textreader.TextInput in project Essentials by drtshock.
the class Commandrules method run.
@Override
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
if (sender.isPlayer()) {
ess.getUser(sender.getPlayer()).setDisplayNick();
}
final IText input = new TextInput(sender, "rules", true, ess);
final IText output = new KeywordReplacer(input, sender, ess);
final TextPager pager = new TextPager(output);
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, commandLabel, sender);
}
use of com.earth2me.essentials.textreader.TextInput in project Essentials by drtshock.
the class Commandcustomtext method run.
@Override
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
if (sender.isPlayer()) {
ess.getUser(sender.getPlayer()).setDisplayNick();
}
final IText input = new TextInput(sender, "custom", true, ess);
final IText output = new KeywordReplacer(input, sender, ess);
final TextPager pager = new TextPager(output);
String chapter = commandLabel;
String page;
if (commandLabel.equalsIgnoreCase("customtext") && args.length > 0 && !NumberUtil.isInt(commandLabel)) {
chapter = args[0];
page = args.length > 1 ? args[1] : null;
} else {
page = args.length > 0 ? args[0] : null;
}
pager.showPage(chapter, page, null, sender);
}
use of com.earth2me.essentials.textreader.TextInput in project Essentials by EssentialsX.
the class SignInfo method onSignInteract.
@Override
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException {
final Trade charge = getTrade(sign, 3, ess);
charge.isAffordableFor(player);
String chapter = sign.getLine(1);
String page = sign.getLine(2);
final IText input;
try {
player.setDisplayNick();
input = new TextInput(player.getSource(), "info", true, ess);
final IText output = new KeywordReplacer(input, player.getSource(), ess);
final TextPager pager = new TextPager(output);
pager.showPage(chapter, page, null, player.getSource());
} catch (IOException ex) {
throw new SignException(ex.getMessage(), ex);
}
charge.charge(player);
Trade.log("Sign", "Info", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess);
return true;
}
use of com.earth2me.essentials.textreader.TextInput in project Essentials by EssentialsX.
the class Commandrules method run.
@Override
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
if (sender.isPlayer()) {
ess.getUser(sender.getPlayer()).setDisplayNick();
}
final IText input = new TextInput(sender, "rules", true, ess);
final IText output = new KeywordReplacer(input, sender, ess);
final TextPager pager = new TextPager(output);
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, commandLabel, sender);
}
use of com.earth2me.essentials.textreader.TextInput in project Essentials by drtshock.
the class SignInfo method onSignInteract.
@Override
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException {
final Trade charge = getTrade(sign, 3, ess);
charge.isAffordableFor(player);
String chapter = sign.getLine(1);
String page = sign.getLine(2);
final IText input;
try {
player.setDisplayNick();
input = new TextInput(player.getSource(), "info", true, ess);
final IText output = new KeywordReplacer(input, player.getSource(), ess);
final TextPager pager = new TextPager(output);
pager.showPage(chapter, page, null, player.getSource());
} catch (IOException ex) {
throw new SignException(ex.getMessage(), ex);
}
charge.charge(player);
Trade.log("Sign", "Info", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess);
return true;
}
Aggregations