コード例 #1
0
  @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) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
コード例 #2
0
  @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);

      downloadingPlayer = null;
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }