Package com.sk89q.craftbook.mechanics.minecart.blocks

Examples of com.sk89q.craftbook.mechanics.minecart.blocks.CartMechanismBlocks


        CraftBookPlugin.server().getScheduler().runTask(CraftBookPlugin.inst(), new Runnable() {

            @Override
            public void run () {
                try {
                    CartMechanismBlocks cmb = CartMechanismBlocks.find(event.getBlock());
                    CartBlockRedstoneEvent ev = new CartBlockRedstoneEvent(event.getBlock(), event.getSource(), event.getOldCurrent(), event.getNewCurrent(), cmb, CartBlockMechanism.getCart(cmb.rail));
                    CraftBookPlugin.inst().getServer().getPluginManager().callEvent(ev);
                } catch (InvalidMechanismException ignored) {
                }
            }
View Full Code Here


            return;

        if(event.getVehicle() instanceof Minecart) {
            try {
                Minecart cart = (Minecart) event.getVehicle();
                CartMechanismBlocks cmb = CartMechanismBlocks.findByRail(event.getTo().getBlock());
                cmb.setFromBlock(event.getFrom().getBlock());
                Location from = event.getFrom();
                Location to = event.getTo();
                if(LocationUtil.getDistanceSquared(from, to) > 2*2) //Further than max distance
                    return;
                boolean minor = from.getBlockX() == to.getBlockX() && from.getBlockY() == to.getBlockY() && from.getBlockZ() == to.getBlockZ();
View Full Code Here

        if(event.getVehicle() instanceof Minecart) {
            try {
                Minecart cart = (Minecart) event.getVehicle();
                Block block = event.getVehicle().getLocation().getBlock();
                CartMechanismBlocks cmb = CartMechanismBlocks.findByRail(block);
                cmb.setFromBlock(block); // WAI
                CartBlockEnterEvent ev = new CartBlockEnterEvent(cart, event.getEntered(), cmb);
                CraftBookPlugin.inst().getServer().getPluginManager().callEvent(ev);
                if(ev.isCancelled())
                    event.setCancelled(true);
            } catch (InvalidMechanismException ignored) {
View Full Code Here

TOP

Related Classes of com.sk89q.craftbook.mechanics.minecart.blocks.CartMechanismBlocks

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.