Skip to content

Commit

Permalink
[minecraft-onedrive-linker] New tool
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdotweb committed Jan 1, 2024
1 parent 29f8ec2 commit 4f131d1
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Scott's Tools

Small web-based utilities for fixing data in one way or another.
Small utilities, mostly for fixing data in one way or another.

* Bookmarklets: open `bookmarklets/index.html` in your browser
* [Minecraft OneDrive Linker](minecraft-onedrive-linker/README.md) ![New!](assets/new.gif)
* [Renaming Script Generator](renaming-script-generator/README.md)
* [Strip URL Parameters](strip-url-params/README.md) ![New!](assets/new.gif)
* [VLC Playlist Fixer](vlc-playlist-fixer/README.md)

## Author and license

Copyright 2022 [Scott Martin](https://github.com/scottdotjs).
Copyright [Scott Martin](https://github.com/scottdotjs).

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ <h1>Scott&rsquo;s Tools</h1>

<ul>
<li><a href=bookmarklets/>Bookmarklets</a>
<li><a href=minecraft-onedrive-linker/>Minecraft OneDrive Linker</a>
<li><a href=renaming-script-generator/>Renaming Script Generator</a>
<li><a href=vlc-playlist-fixer/>VLC Playlist Fixer</a>
</ul>
Expand Down
43 changes: 43 additions & 0 deletions minecraft-onedrive-linker/MinecraftOneDriveLinker.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@echo off

set /p HasBackup="Have you backed up your Minecraft folder? [y/n] "

if not "%HasBackup%"=="Y" if not "%HasBackup%"=="y" (
echo Please back up your Minecraft folder first.
pause
exit
)

set /p MinecraftFolderLocation="Enter the path to your Minecraft folder within your OneDrive folder, not including the path to OneDrive itself (eg. path\to\folder): "

if not defined MinecraftFolderLocation (
echo Please start again and enter something this time.
pause
exit
)

set MinecraftFolderPath=%userprofile%\OneDrive\%MinecraftFolderLocation%\.minecraft

if exist "%appdata%\.minecraft" (
echo There's already a .minecraft in %appdata%, please check.
pause
exit
)

if not exist %MinecraftFolderPath% (
echo There's no Minecraft folder at %MinecraftFolderPath%, please check.
pause
exit
)

mklink /J "%appdata%\.minecraft" "%userprofile%\OneDrive\%MinecraftFolderLocation%\.minecraft"

chcp 65001 >nul

echo ╔════════════════════════════════════════════════════════════════════════════╗
echo ║ VERY IMPORTANT: ║
echo ║ Go to where your Minecraft folder is, right-click it, and choose ║
echo"Always keep on this device". It might get corrupted if you don't! ║
echo ╚════════════════════════════════════════════════════════════════════════════╝

pause
38 changes: 38 additions & 0 deletions minecraft-onedrive-linker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Minecraft OneDrive Linker

This Windows batch script will let you keep your Minecraft game data folder on
OneDrive and thus synchronized between different computers.

# How to use it

Before doing anything: MAKE A BACKUP OF YOUR MINECRAFT FOLDER. This script
comes with no guarantees! On Windows it's called `.minecraft` and is found in
the `%AppData%` folder. Type that into the Explorer address bar and it will
expand to the full path.

On the computer that has the Minecraft installation you want to synchronize:

1. Move your Minecraft folder into wherever you want to keep it in your OneDrive folder.
2. Run the script by double-clicking it and answer the prompts.
3. Wait for the folder to finish uploading to OneDrive.

On the other computer(s):

1. Move any existing Minecraft folder out of `%AppData%`.
2. Run the script by double-clicking it and answer the prompts.
3. Wait for the folder to finish downloading from OneDrive.

Go mine and craft!

# Important note

The script will tell you how to get OneDrive to always keep a local copy of the folder (exempt it from Files On-Demand). If you don't there's a risk of the game getting confused looking for files that aren't technically there. Also, when switching between machines, YOU MUST wait for the game files to sync up and then down again before starting to play.

# Putting things back how they were

Delete the `.minecraft` directory link in `%AppData%` and move the real folder back there. Obviously make sure it's fully synchronized before doing that.

# DISCLAIMER

This is a very hacky workaround for OneDrive not letting you add arbitrary file paths. This software comes with no guarantees or warranty of usefulness whatsoever and you run it at your own risk. Regularly back up your Minecraft folder!

0 comments on commit 4f131d1

Please sign in to comment.