Package erogenousbeef.core.multiblock

Examples of erogenousbeef.core.multiblock.MultiblockControllerBase


    // If the player's hands are empty and they rightclick on a multiblock, they get a
    // multiblock-debugging message if the machine is not assembled.
    if(player.getCurrentEquippedItem() == null) {
      TileEntity te = world.getTileEntity(x, y, z);
      if(te instanceof IMultiblockPart) {
        MultiblockControllerBase controller = ((IMultiblockPart)te).getMultiblockController();

        if(controller == null) {
          player.addChatMessage(new ChatComponentText(String.format("SERIOUS ERROR - server part @ %d, %d, %d has no controller!", x, y, z))); //TODO Localize
        }
        else {
          Exception e = controller.getLastValidationException();
          if(e != null) {
            player.addChatMessage(new ChatComponentText(e.getMessage() + " - controller " + Integer.toString(controller.hashCode()))); //Would it be worth it to localize one word?
            return true;
          }
        }
      }
    }
View Full Code Here


    }

    int metadata = world.getBlockMetadata(x, y, z);
    TileEntity te = world.getTileEntity(x, y, z);
    IMultiblockPart part = null;
    MultiblockControllerBase controller = null;

    if(te instanceof IMultiblockPart) {
      part = (IMultiblockPart)te;
      controller = part.getMultiblockController();
    }
   
    if(isCasing(metadata) || isPowerTap(metadata) || isComputerPort(metadata)) {
      // If the player's hands are empty and they rightclick on a multiblock, they get a
      // multiblock-debugging message if the machine is not assembled.
      if(player.getCurrentEquippedItem() == null) {
        if(controller != null) {
          Exception e = controller.getLastValidationException();
          if(e != null) {
            player.addChatMessage(new ChatComponentText(e.getMessage()));
            return true;
          }
        }
        else {
          player.addChatMessage(new ChatComponentText("Block is not connected to a reactor. This could be due to lag, or a bug. If the problem persists, try breaking and re-placing the block.")); //TODO Localize
          return true;
        }
      }

      // If nonempty, or there was no error, just fall through
      return false;
    }

    // Do toggly fiddly things for access/coolant ports
    if(!world.isRemote && (isAccessPort(metadata) || isCoolantPort(metadata))) {
      if(StaticUtils.Inventory.isPlayerHoldingWrench(player)) {
        if(te instanceof TileEntityReactorCoolantPort) {
          TileEntityReactorCoolantPort cp = (TileEntityReactorCoolantPort)te;
          cp.setInlet(!cp.isInlet(), true);
          return true;
        }
        else if(te instanceof TileEntityReactorAccessPort) {
          TileEntityReactorAccessPort cp = (TileEntityReactorAccessPort)te;
          cp.setInlet(!cp.isInlet());
          return true;
        }
      }
      else if(isCoolantPort(metadata)) {
        return false;
      }
    }
   
    // Don't open the controller GUI if the reactor isn't assembled
    if(isController(metadata) && (controller == null || !controller.isAssembled())) { return false; }

    if(!world.isRemote) {
      player.openGui(BRLoader.instance, 0, world, x, y, z);
    }
    return true;
View Full Code Here

    int metadata = blockAccess.getBlockMetadata(x, y, z);
    TileEntity te = blockAccess.getTileEntity(x, y, z);
   
    if(te instanceof RectangularMultiblockTileEntityBase) {
      RectangularMultiblockTileEntityBase rte = (RectangularMultiblockTileEntityBase)te;
      MultiblockControllerBase controller = rte.getMultiblockController();
      if(controller != null && controller.isAssembled()) {
        if(rte.getOutwardsDir().ordinal() == side) {
          return getIconFromTileEntity(rte, metadata);
        }
      }
    }
View Full Code Here

    // If the player's hands are empty and they rightclick on a multiblock, they get a
    // multiblock-debugging message if the machine is not assembled.
    if(!world.isRemote && player.getCurrentEquippedItem() == null) {
      TileEntity te = world.getTileEntity(x, y, z);
      if(te instanceof IMultiblockPart) {
        MultiblockControllerBase controller = ((IMultiblockPart)te).getMultiblockController();

        if(controller == null) {
          player.addChatMessage(new ChatComponentText(String.format("SERIOUS ERROR - server part @ %d, %d, %d has no controller!", x, y, z))); //TODO Localize
        }
        else {
          Exception e = controller.getLastValidationException();
          if(e != null) {
            player.addChatMessage(new ChatComponentText(e.getMessage()));
            return true;
          }
        }
View Full Code Here

TOP

Related Classes of erogenousbeef.core.multiblock.MultiblockControllerBase

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.