Package buildcraft.core.blueprints

Examples of buildcraft.core.blueprints.BlueprintBase


    // client, and then store it to the client.
    if (progressIn == 100 && getStackInSlot(1) == null) {
      setInventorySlotContents(1, getStackInSlot(0));
      setInventorySlotContents(0, null);

      BlueprintBase bpt = ItemBlueprint.loadBlueprint(getStackInSlot(1));

      if (bpt != null && uploadingPlayer != null) {
        RPCHandler.rpcPlayer(uploadingPlayer, this, "downloadBlueprintToClient",
            bpt.id, bpt.getData());
        uploadingPlayer = null;
      }
    }

    if (progressOut == 100 && getStackInSlot(3) == null) {
View Full Code Here


  @RPC (RPCSide.CLIENT)
  public void requestSelectedBlueprint () {
    if (isOutputConsistent()) {
      if (selected > -1 && selected < currentPage.size()) {
        BlueprintBase bpt = BuildCraftBuilders.clientDB
            .load(currentPage.get(selected));

        RPCHandler.rpcServer(this, "uploadBlueprintToServer", bpt.id,
            bpt.getData());
      } else {
        RPCHandler.rpcServer(this, "uploadBlueprintToServer", null,
            null);
      }
    }
View Full Code Here

  @RPC (RPCSide.SERVER)
  public void uploadBlueprintToServer (BlueprintId id, byte [] data) {
    try {
      if (data != null) {
        NBTTagCompound nbt = CompressedStreamTools.func_152457_a(data, NBTSizeTracker.field_152451_a);
        BlueprintBase bpt = BlueprintBase.loadBluePrint(nbt);
        bpt.setData(data);
        bpt.id = id;
        BuildCraftBuilders.serverDB.add(bpt);
        setInventorySlotContents(3, bpt.getStack());
      } else {
        setInventorySlotContents(3, getStackInSlot(2));
      }

      setInventorySlotContents(2, null);
View Full Code Here

  @RPC (RPCSide.CLIENT)
  public void downloadBlueprintToClient (BlueprintId id, byte [] data) {
    try {
      NBTTagCompound nbt = CompressedStreamTools.func_152457_a(data, NBTSizeTracker.field_152451_a);
      BlueprintBase bpt = BlueprintBase.loadBluePrint(nbt);
      bpt.setData(data);
      bpt.id = id;

      BuildCraftBuilders.clientDB.add(bpt);
      setCurrentPage(BuildCraftBuilders.clientDB.getPage(pageId));
    } catch (IOException e) {
View Full Code Here

    if (worldObj.isRemote) {
      return;
    }

    if (itemBlueprint != null && ItemBlueprint.getId(itemBlueprint) != null && bluePrintBuilder == null) {
      BlueprintBase bpt = BlueprintBase.instantiate(itemBlueprint, worldObj, xCoord, yCoord, zCoord, direction);

      bluePrintBuilder = new BptBuilderBlueprint((Blueprint) bpt, worldObj, xCoord, yCoord, zCoord);
      bptContext = bluePrintBuilder.getContext();
      box.initialize(bluePrintBuilder);
      sendNetworkUpdate();
View Full Code Here

  public BlueprintBase load(final BlueprintId id) {
    if (id == null) {
      return null;
    }

    BlueprintBase bpt = load (getBlueprintFile(id));

    if (bpt != null) {
      bpt.id = id;
    }
View Full Code Here

  public static BlueprintBase load(byte[] data) {
    try {
      NBTTagCompound nbt = CompressedStreamTools.func_152457_a(data, NBTSizeTracker.field_152451_a);

      BlueprintBase blueprint = BlueprintBase.loadBluePrint(nbt);
      blueprint.setData(data);

      return blueprint;
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

      previous = b;
    }
  }

  public BlueprintBase instanciateBlueprint() {
    BlueprintBase bpt = null;

    try {
      bpt = ItemBlueprint.loadBlueprint(getStackInSlot(0));
    } catch (Throwable t) {
      setInventorySlotContents(0, null);
View Full Code Here

    return bpt;
  }

  @Deprecated
  public BptBuilderBase instanciateBluePrintBuilder(int x, int y, int z, ForgeDirection o) {
    BlueprintBase bpt = instanciateBlueprint();
        if (bpt == null) {
            return null;
        }

    bpt = bpt.adjustToWorld(worldObj, x, y, z, o);

    if (getStackInSlot(0).getItem() instanceof ItemBlueprintStandard) {
      return new BptBuilderBlueprint((Blueprint) bpt, worldObj, x, y, z);
    } else if (getStackInSlot(0).getItem() instanceof ItemBlueprintTemplate) {
      return new BptBuilderTemplate(bpt, worldObj, x, y, z);
View Full Code Here

      } else {
        if (currentBuilder != null && currentBuilder.isDone(this)) {
          currentBuilder.postProcessing(worldObj);
          currentBuilder = recursiveBuilder.nextBuilder();
        } else {
          BlueprintBase bpt = instanciateBlueprint();

          if (bpt != null) {
            recursiveBuilder = new RecursiveBlueprintBuilder(bpt, worldObj, xCoord, yCoord, zCoord,
                ForgeDirection.values()[worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].getOpposite());
View Full Code Here

TOP

Related Classes of buildcraft.core.blueprints.BlueprintBase

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.