Package com.sk89q.craftbook.util

Examples of com.sk89q.craftbook.util.LogListBlock


    }

    private void appendGlobalConfiguration(BukkitConfiguration config) {
        appendHeader("Global Configuration");

        LogListBlock log = new LogListBlock();
        LogListBlock configLog = log.putChild("Configuration");

        Class<? extends BukkitConfiguration> cls = config.getClass();
        for (Field field : cls.getFields()) {
            try {
                if (field.getName().equalsIgnoreCase("config")) continue;
                Object val = field.get(config);
                configLog.put(field.getName(), val);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException ignore) {
            }
        }
        Class<? extends BukkitConfiguration> cls2 = config.getClass();
        for (Field field : cls2.getFields()) {
            try {
                if (field.getName().equalsIgnoreCase("config")) continue;
                if (field.getName().equalsIgnoreCase("plugin")) continue;
                Object val = field.get(config);
                configLog.put(field.getName(), val);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException ignore) {
            }
        }
View Full Code Here


    }

    private void appendServerInformation(Server server) {
        appendHeader("Server Information");

        LogListBlock log = new LogListBlock();

        Runtime runtime = Runtime.getRuntime();

        log.put("Java", "%s %s (%s)",
                System.getProperty("java.vendor"),
                System.getProperty("java.version"),
                System.getProperty("java.vendor.url"));
        log.put("Operating system", "%s %s (%s)",
                System.getProperty("os.name"),
                System.getProperty("os.version"),
                System.getProperty("os.arch"));
        log.put("Available processors", runtime.availableProcessors());
        log.put("Free memory", runtime.freeMemory() / 1024 / 1024 + " MB");
        log.put("Max memory", runtime.maxMemory() / 1024 / 1024 + " MB");
        log.put("Total memory", runtime.totalMemory() / 1024 / 1024 + " MB");
        log.put("Server ID", server.getServerId());
        log.put("Server name", server.getServerName());
        log.put("Implementation", server.getVersion());
        //log.put("Address", server.getIp(), server.getPort());
        log.put("Player count", "%d/%d",
                server.getOnlinePlayers().size(), server.getMaxPlayers());

        append(log);
        appendln();
    }
View Full Code Here

    }

    private void appendCraftBookInformation(CraftBookPlugin plugin) {
        appendHeader("CraftBook Information");

        LogListBlock log = new LogListBlock();

        int i = CraftBookPlugin.inst().getMechanics().size();
        log.put("Mechanics Loaded", "%d", i);
        log.put("ST Mechanics Loaded", "%d", plugin.getSelfTriggerManager().getSelfTriggeringMechanics().size());

        append(log);
        appendln();

        appendHeader("Loaded Mechanics");

        log = new LogListBlock();

        for(CraftBookMechanic mech : CraftBookPlugin.inst().getMechanics())
            log.put(mech.getClass().getSimpleName(), mech.getClass().getPackage().toString());

        append(log);
        appendln();

        if(flags.contains("i")) {

            appendHeader("Loaded Self Triggering ICs");

            log = new LogListBlock();
            for(Entry<Location, IC> mech : ICManager.getCachedICs().entrySet()) {
                log.put(mech.getKey().toString(), "%s", mech.getValue().getSign().toString());
            }
            append(log);
            appendln();
        }
    }
View Full Code Here

    }

    private void appendCustomCraftingInformation(CraftBookPlugin plugin) {
        appendHeader("Custom Crafting");

        LogListBlock log = new LogListBlock();

        if(RecipeManager.INSTANCE == null) {
            log.put("CustomCrafting is disabled!","");
            append(log);
            appendln();
            return;
        }

        for(Recipe rec : RecipeManager.INSTANCE.getRecipes()) {

            log.put("Recipe ID", "%s", rec.getId());
            log.put("Recipe Type", "%s", rec.getType().name());
            if(rec.getType() == RecipeType.SHAPED) {
                log.put("Recipe Shape", Arrays.toString(rec.getShape()));
                for(Entry<CraftingItemStack, Character> bits : rec.getShapedIngredients().entrySet()) {
                    log.put("Ingredient", "%s %c", bits.getKey().toString(), bits.getValue());
                }
            } else {
                for(CraftingItemStack bits : rec.getIngredients())
                    log.put("Ingredient", "%s", bits.toString());
            }
            log.put("Result", "%s", rec.getResult().toString());
            log.put("Advanced-Data", rec.getAdvancedDataMap());
        }

        append(log);
        appendln();
    }
View Full Code Here

    }

    private void appendPluginInformation(Plugin[] plugins) {
        appendHeader("Plugins (" + plugins.length + ")");

        LogListBlock log = new LogListBlock();

        for (Plugin plugin : plugins) {
            log.put(plugin.getDescription().getName(), plugin.getDescription().getVersion());
        }

        append(log);
        appendln();
View Full Code Here

TOP

Related Classes of com.sk89q.craftbook.util.LogListBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.