mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-07-02 10:43:51 +00:00
31 lines
668 B
Java
31 lines
668 B
Java
package com.earth2me.essentials.textreader;
|
|
|
|
import com.earth2me.essentials.CommandSource;
|
|
|
|
import java.util.List;
|
|
|
|
public class SimpleTextPager {
|
|
private final transient IText text;
|
|
|
|
public SimpleTextPager(final IText text) {
|
|
this.text = text;
|
|
}
|
|
|
|
public void showPage(final CommandSource sender) {
|
|
for (String line : text.getLines()) {
|
|
sender.sendMessage(line);
|
|
}
|
|
}
|
|
|
|
public List<String> getLines() {
|
|
return text.getLines();
|
|
}
|
|
|
|
public String getLine(int line) {
|
|
if (text.getLines().size() < line) {
|
|
return null;
|
|
}
|
|
return text.getLines().get(line);
|
|
}
|
|
}
|