Package com.sk89q.craftbook

Examples of com.sk89q.craftbook.CraftBookMechanic


            Class<? extends CraftBookMechanic> mechClass = availableMechanics.get(enabled);
            try {
                if(mechClass != null) {

                    CraftBookMechanic mech = mechClass.newInstance();
                    mech.loadConfiguration(mechanismsConfig, "mechanics." + enabled + ".");
                    mechanics.add(mech);
                }
            } catch (Throwable t) {
                getLogger().log(Level.WARNING, "Failed to load mechanic: " + enabled, t);
            }
        }

        mechanismsConfig.save();

        Iterator<CraftBookMechanic> iter = mechanics.iterator();
        while(iter.hasNext()) {
            CraftBookMechanic mech = iter.next();
            try {
                if(!mech.enable()) {
                    getLogger().warning("Failed to enable mechanic: " + mech.getClass().getSimpleName());
                    mech.disable();
                    iter.remove();
                    continue;
                }
                getServer().getPluginManager().registerEvents(mech, this);
            } catch(Throwable t) {
                getLogger().log(Level.WARNING, "Failed to enable mechanic: " + mech.getClass().getSimpleName(), t);
            }
        }

        setupSelfTriggered();
    }
View Full Code Here


        Class<? extends CraftBookMechanic> mechClass = availableMechanics.get(mechanic);
        try {
            if(mechClass != null) {

                CraftBookMechanic mech = mechClass.newInstance();
                mech.loadConfiguration(mechanismsConfig, "mechanics." + mechanic + ".");
                mechanics.add(mech);

                if(!mech.enable()) {
                    getLogger().warning("Failed to enable mechanic: " + mech.getClass().getSimpleName());
                    mech.disable();
                    return false;
                }
                getServer().getPluginManager().registerEvents(mech, this);
            } else
                return false;
View Full Code Here

            Class<? extends CraftBookMechanic> mechClass = CraftBookPlugin.availableMechanics.get(enabled);
            try {
                if(mechClass != null) {

                    CraftBookMechanic mech = mechClass.newInstance();
                    mech.loadConfiguration(proc, "mechanics." + enabled + ".");
                }
            } catch (Throwable t) {
                Bukkit.getLogger().log(Level.WARNING, "Failed to load mechanic: " + enabled, t);
            }
        }
View Full Code Here

TOP

Related Classes of com.sk89q.craftbook.CraftBookMechanic

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.