Java Code Examples for com.sk89q.worldedit.extension.platform.Actor#print()

The following examples show how to use com.sk89q.worldedit.extension.platform.Actor#print() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PolyhedralRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void explainPrimarySelection(Actor player, LocalSession session, Vector pos) {
    checkNotNull(player);
    checkNotNull(session);
    checkNotNull(pos);

    session.describeCUI(player);

    player.print("Started new selection with vertex " + pos + ".");
}
 
Example 2
Source File: PolyhedralRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
    checkNotNull(player);
    checkNotNull(session);
    checkNotNull(pos);

    session.describeCUI(player);

    player.print("Added vertex " + pos + " to the selection.");
}
 
Example 3
Source File: WorldEditCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Command(
        aliases = {"reload"},
        usage = "",
        desc = "Reload configuration",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.reload")
public void reload(Actor actor) throws WorldEditException {
    we.getServer().reload();
    we.getEventBus().post(new ConfigurationLoadEvent(we.getPlatformManager().queryCapability(Capability.CONFIGURATION).getConfiguration()));
    Fawe.get().setupConfigs();
    actor.print(BBC.getPrefix() + "Reloaded WorldEdit " + we.getVersion() + " and FAWE (" + Fawe.get().getVersion() + ")");
}
 
Example 4
Source File: WorldEditCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
@Command(
        aliases = {"changelog", "cl"},
        usage = "",
        desc = "View the FAWE changelog",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.changelog")
public void changelog(Actor actor) throws WorldEditException {
    try {
        Updater updater = Fawe.get().getUpdater();
        String changes = updater != null ? updater.getChanges() : null;

        String url = "https://empcraft.com/fawe/cl?" + Integer.toHexString(Fawe.get().getVersion().hash);
        if (changes == null) {
            try (Scanner scanner = new Scanner(new URL(url).openStream(), "UTF-8")) {
                changes = scanner.useDelimiter("\\A").next();
            }
        }
        changes = changes.replaceAll("#([0-9]+)", "github.com/boy0001/FastAsyncWorldedit/issues/$1");

        String[] split = changes.substring(1).split("[\n](?! )");
        if (changes.length() <= 1) actor.print(BBC.getPrefix() + "No description available");
        else {
            StringBuilder msg = new StringBuilder();
            msg.append(BBC.getPrefix() + split.length + " commits:");
            for (String change : split) {
                String[] split2 = change.split("\n    ");
                msg.append("\n&a&l" + split2[0]);
                if (split2.length != 0) {
                    for (int i = 1; i < split2.length; i++) {
                        msg.append('\n');
                        String[] split3 = split2[i].split("\n");
                        String subChange = "&8 - &7" + StringMan.join(split3, "\n&7   ");
                        msg.append(subChange);
                    }
                }
            }
            msg.append("\n&7More info: &9&o" + url);
            msg.append("\n&7Discuss: &9&ohttps://discord.gg/ngZCzbU");
            actor.print(BBC.color(msg.toString()));
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}