Restitutor is the pride of <SUBJECT HOMETOWN HERE>

MC1 WorldEdit Analysis + Repair Process

1 reply [Last post]
RestitutorOrbis's picture
Name: RestitutorOrbis (Restitutor)
Offline
Princeps
Joined: Aug 24 2014
Posts:

Analysis
BBCode Image

A large accidental WorldEdit operation deleted a large part of creative. Here's the process through which the person who caused it was found and the restoration of the map.

Given how it was a worldedit operation, there are no CoreProtect logs. Therefore, the only way to find the person involved looking through the logs.

latest.log was opened. (if nothing useful was found, older files would need to be opened).

Notepad++ searched for "issued server command: //" and "Find All in Current Document".

//set Podzol sticks out. Given how worldedit with values corresponding to no existing block results in air, an attempt to make podzol may match air being placed. It was used on a smaller selection which confirmed that the command caused the issue.

An attempt to run //restore was run on a small part of the missing selection. Once a snapshot was found with the needed data, //restore was run. Given the size of the selection, //restore was not possible.

Addressing the issue
Technically, loading a backup could be done. However, a few people did build in the time since the last backup which means map splicing would save several hours of work.

MC1 was shutdown in the meantime so new builds don't pile up. The locations.yml in BungeeCord was editted so that users who last logged in MC1 Hub would be sent to SkyBlock. This was done with a Find/Replace of "Hub" and "Skyblock". As there's a bug where if the user's last logged in server is down, they can't connect to any Arcator server at all.

Gathering Info
First, two corners were located. For one we have a screenshot with F3, so grabbing the coords are straightforward. X: -1720 Z:1383

The other one is inside /warp temp. While we could start the server up and warp there to grab the coords, there's a faster way.

The plugins/Essentials/warps/temp.yml has the coords.
x: 1832.699999988079
y: 73.0
z: -1904.699999988079

With the x and y coords for the two corners. We can now plug them into Dinnerbone's Coordinate Tools. This will give us the mca file for each coordinate pair.

X: -1720 Z:1383 -> r.-4.2.mca
X: 1832 Z: -1904 -> r.3.-4.mca

Preparing Commands
Given how we're only splicing the part of the map within the two vertices. We only need the mca files in that area. Rather than downloading the entire old and new creative folder, time and bandwidth was saved by only downloading (and then uploading) the mca files affected by the worldedit incident.

Notepad++ was used to type out a list of all 56 mca files that need to be downloaded. Rectangular selection and copy paste was used extensively.

The list was converted from being delimited with new lines to spaces.

In the Find what field: [rn]+
In the Replace: (space)

The following 3 commands were typed in the creativeBak folder which has the old map without the worldedit incident.

Exporting Files to a Local Machine
The following command was run.
cp -t temp r.-4.2.mca r.-3.2.mca r.-2.2.mca r.-1.2.mca r.0.2.mca r.1.2.mca r.2.2.mca r.3.2.mca r.-4.1.mca r.-3.1.mca r.-2.1.mca r.-1.1.mca r.0.1.mca r.1.1.mca r.2.1.mca r.3.1.mca r.-4.0.mca r.-3.0.mca r.-2.0.mca r.-1.0.mca r.0.0.mca r.1.0.mca r.2.0.mca r.3.0.mca r.-4.-1.mca r.-3.-1.mca r.-2.-1.mca r.-1.-1.mca r.0.-1.mca r.1.-1.mca r.2.-1.mca r.3.-1.mca r.-4.-2.mca r.-3.-2.mca r.-2.-2.mca r.-1.-2.mca r.0.-2.mca r.1.-2.mca r.2.-2.mca r.3.-2.mca r.-4.-3.mca r.-3.-3.mca r.-2.-3.mca r.-1.-3.mca r.0.-3.mca r.1.-3.mca r.2.-3.mca r.3.-3.mca r.-4.-4.mca r.-3.-4.mca r.-2.-4.mca r.-1.-4.mca r.0.-4.mca r.1.-4.mca r.2.-4.mca r.3.-4.mca

This copied only the affected mca files into a folder called temp.
The folder temp was compressed with
zip -r temp.zip temp

The temp folder was removed
rm -r temp

The following three commands above were run again in the creative folder (newest world with worldedit issue).

The temp.zip files for both the new and old map were downloaded locally and removed from fela's machine with, rm temp.zip.

On the local machine
Made a folder called oldMap and copied over level.dat, session.lock, and uid.dat from the creative folder on fela's machine. These files are needed to open a map.

Copied the oldMap folder and renamed it to newMap.
Extracted the folders from the temp.zips. The region folder was recreated on both oldMap and newMap.
Counted the number of mca files in the region folder to verify all previous steps went well, as expected there are 56 mca files.

With MCEdit
The newMap folder was opened up.
Ctrl-G was used to jump to the two corners.

A selection was made, this is to get an idea of the selection size we want from oldMap.
BBCode Image

A screenshot was made of the pivot, we can't see the hole to select from in oldMap. So we'll start one corner at this build and then fiddle with the other corner until the sizes line up.
BBCode Image

Ctrl-G was used again with oldMap opened up.
BBCode Image

Unfortunately the pivot can't be found, so the newMap was reopened.
BBCode Image

Luckily pressing 0 toggles debug mode so we can see the coords that are selected.
Vertex 1 -> -1718, 72, 1380
Vertex 2 -> 1831, 77, -1906
BBCode Image

Opening oldMap again and using ctrl-g, the selection was made.
BBCode Image

The selection was copied to produce a schematic. It took about 6 minutes to copy
BBCode Image

Luckily, it's easier to paste the schematic into newMap than it was to copy. We just need to watch the edges and make sure they align with the village at Vertex 2. The nudge tool was use to align the selections.
BBCode Image

Issues and A New Approach
After a few issues with copy pasting the schematic, a completely new approach was taken. One of the issues with attempting the above is that copying the old backup for a slice of the map may cause entities to be duplicated. An entity on the map with the worldedit incident may fall outside of the given selection. When the backup is pasted in, there's now two entities present.

The solution is now a fairly common procedure. Map splicing.

Preparing Splicing
Initially, the creative map is the map with the worldedit incident and the creativeBak is the backup. We need to swap their map data, but we can keep all the player data the same. In order to do this, we just need to swap their region folders rather than the entire save folders.

mv creative/region creativeBak/temp2
mv creativeBak/region creative/region
mv creativeBak/temp2 mv creative/region

Map Splicing
BBCode Image
jordizzle140398 was taught how to use //copy and //paste in preparation for map splicing.

Jordi and I worked on map splicing. Two major sites were spliced together.

Final Edits
BBCode Image
Komodo found lighting issues on the creative map. To fix this, the "data" folder was copied from creativeBak to creative.
cp -r creativeBak/data creative/data

Closing
Bungee was restarted with the locations of players set back from SkyBlock to Hub.

n/a
RestitutorOrbis's picture
Name: RestitutorOrbis (Restitutor)
Offline
Princeps
Joined: Aug 24 2014
Posts:

r.-4.2.mca
r.-3.2.mca
r.-2.2.mca
r.-1.2.mca
r.-0.2.mca
r.1.2.mca
r.2.2.mca
r.3.2.mca
r.-4.1.mca
r.-3.1.mca
r.-2.1.mca
r.-1.1.mca
r.-0.1.mca
r.1.1.mca
r.2.1.mca
r.3.1.mca
r.-4.0.mca
r.-3.0.mca
r.-2.0.mca
r.-1.0.mca
r.-0.0.mca
r.1.0.mca
r.2.0.mca
r.3.0.mca
r.-4.-1.mca
r.-3.-1.mca
r.-2.-1.mca
r.-1.-1.mca
r.-0.-1.mca
r.1.-1.mca
r.2.-1.mca
r.3.-1.mca
r.-4.-2.mca
r.-3.-2.mca
r.-2.-2.mca
r.-1.-2.mca
r.-0.-2.mca
r.1.-2.mca
r.2.-2.mca
r.3.-2.mca
r.-4.-3.mca
r.-3.-3.mca
r.-2.-3.mca
r.-1.-3.mca
r.-0.-3.mca
r.1.-3.mca
r.2.-3.mca
r.3.-3.mca
r.-4.-4.mca
r.-3.-4.mca
r.-2.-4.mca
r.-1.-4.mca
r.-0.-4.mca
r.1.-4.mca
r.2.-4.mca
r.3.-4.mca

n/a

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.