Package buildcraft.api.events

Examples of buildcraft.api.events.RobotPlacementEvent


        if (rayTraceResult != null && rayTraceResult.hitPart == Part.RobotStation) {
          DockingStation station = (DockingStation) pipe.container.tilePart.getStation(rayTraceResult.sideHit);

          if (!station.isTaken()) {
            if(ItemRobot.getRobotNBT(currentItem) == null) { return true; }
            RobotPlacementEvent robotEvent = new RobotPlacementEvent(player, ((NBTTagCompound)currentItem.stackTagCompound.getTag("board")).getString("id"));
            FMLCommonHandler.instance().bus().post(robotEvent);
            if(robotEvent.isCanceled()) { return true; }
            EntityRobot robot = ((ItemRobot)currentItem.getItem()).createRobot(currentItem, world);
           
            if(robot != null && robot.getRegistry() != null) {
              robot.setUniqueRobotId(robot.getRegistry().getNextRobotId());
              robot.getBattery().setEnergy(EntityRobotBase.MAX_ENERGY);
View Full Code Here


            if (!station.isTaken()) {
              if (ItemRobot.getRobotNBT(currentItem) == null) {
                return true;
              }
              RobotPlacementEvent robotEvent = new RobotPlacementEvent(player, ((NBTTagCompound) currentItem.stackTagCompound.getTag("board")).getString("id"));
              FMLCommonHandler.instance().bus().post(robotEvent);
              if (robotEvent.isCanceled()) {
                return true;
              }
              EntityRobot robot = ((ItemRobot) currentItem.getItem())
                  .createRobot(currentItem, world);
             
View Full Code Here

TOP

Related Classes of buildcraft.api.events.RobotPlacementEvent

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.