#Migrating your Server Utilities Homes to Forge Essentials Home / Pwarps

1 messages · Page 1 of 1 (latest)

open flume
#

I have written a migration script below that you can use to migrate your growing server from Server Utilities homes to Forge Essentials home / pwarps.
migrateHomes.sh

echo $rootDir
players=($(ls serverutilities/players))
PATH=$rootDir:$PATH
rm -r ../SUHomes
mkdir ../SUHomes/
for player in ${players[*]}; do
    NBTUtil.exe --path=serverutilities/players/$player/UUID -json=../SUHomes/$player-uuid.txt
    uuid=$(cat ../SUHomes/$player-uuid.txt)
    uuid=${uuid//\"/}
    uuid=${uuid:0:8}-${uuid:8:4}-${uuid:12:4}-${uuid:16:4}-${uuid:20:12}
    echo $uuid
    NBTUtil.exe --path=serverutilities/players/$player/Data/serverutilities/Homes -json=../SUHomes/$player.json
    path=.home
    x=$($rootDir/jq -c "$path[0]" ../SUHomes/$player.json)
    y=$($rootDir/jq -c "$path[1]" ../SUHomes/$player.json)
    z=$($rootDir/jq -c "$path[2]" ../SUHomes/$player.json)
    dim=$($rootDir/jq -c "$path[3]" ../SUHomes/$player.json)
    
    mkdir -p FEData/json/PlayerInfo/
    if [ ! -f FEData/json/PlayerInfo/$uuid.json ]; then
        echo "{}" > FEData/json/PlayerInfo/$uuid.json
    fi
    jq -c "$path = {} | $path.xd = $x | $path.yd = $y | $path.zd = $z | $path.dim = $dim" FEData/json/PlayerInfo/$uuid.json > tmp.$$.json && mv tmp.$$.json FEData/json/PlayerInfo/$uuid.json
    
    echo $x, $y, $z, $dim
    
    jq -c "del($path)" ../SUHomes/$player.json > tmp.$$.json && mv tmp.$$.json ../SUHomes/$player.json
    
    keys=($($rootDir/jq 'keys_unsorted | .[]' ../SUHomes/$player.json))
    mkdir -p FEData/json/PersonalWarp/
    if [ ! -f FEData/json/PersonalWarp/$uuid.json ]; then
        echo "{}" > FEData/json/PersonalWarp/$uuid.json
    fi
    for key in ${keys[*]}; do
        path=.`echo "$key" | awk -F'"' '{print $2}'`
        x=$($rootDir/jq -c "$path[0]" ../SUHomes/$player.json)
        y=$($rootDir/jq -c "$path[1]" ../SUHomes/$player.json)
        z=$($rootDir/jq -c "$path[2]" ../SUHomes/$player.json)
        dim=$($rootDir/jq -c "$path[3]" ../SUHomes/$player.json)
        
        jq -c "$path.xd = $x | $path.yd = $y | $path.zd = $z | $path.dim = $dim" FEData/json/PersonalWarp/$uuid.json > tmp.$$.json && mv tmp.$$.json FEData/json/PersonalWarp/$uuid.json
        
        echo $path = $x, $y, $z, $dim
    done
done

To use you will want to first download https://github.com/jaquadro/NBTExplorer. You will then copy the script above to the NBT Exploror folder.
On Windows, you will also want a bash intepreter such as git bash or cygwin. In addition, you will need to download https://github.com/jqlang/jq for windows and install it in the same folder as the script. (rename the file to download to jq)
(On linux, you can either install jq with your package manager or you can install the linux version to the script directory)

After installing, to run, you will need to change directory to your world folder and run /full/path/to/migrateHomes.sh. It is important that your current directory is the world directory in order for the script to work correctly.

GitHub

Command-line JSON processor. Contribute to jqlang/jq development by creating an account on GitHub.

wary marsh
#

what's the difference?

#

(between SU and FE homes)

open flume
#

Some of it is cosmetic, but for the most part, FE has a more robust teleportation module. Technically, FE only has one 'home' and a configurable number of personal warps. (thus the script converts the homes not named 'home' into personal warps)

#

I think technically you could use SU homes and then the use the teleporation module for other stuff such as portals but it is not recommended since FE doesn't currently have a way to disable individual commands, it can only change the alias of commands.

#

(on 1.12, all commands start with fe to prevent collision but that isn't the case 100 percent on 1.7.10)

#

FE also has a /bed command to teleport you to your bed

#

it's tpa also has a 'tpahere' function with /tpa here

#

Lastly, you can build portals on your server that players can walk through and they will be teleported to a destination point.